From 4d01f5f5096cb4d22c4a7ba17cc82977c7f5f19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 29 Oct 2013 18:17:04 +0000 Subject: Adopted MirandaG15 plugin First compilable version and 32-bit only. git-svn-id: http://svn.miranda-ng.org/main/trunk@6681 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirandaG15/src/CContactList.h | 145 ++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 plugins/MirandaG15/src/CContactList.h (limited to 'plugins/MirandaG15/src/CContactList.h') diff --git a/plugins/MirandaG15/src/CContactList.h b/plugins/MirandaG15/src/CContactList.h new file mode 100644 index 0000000000..75b129f8fc --- /dev/null +++ b/plugins/MirandaG15/src/CContactList.h @@ -0,0 +1,145 @@ +#ifndef _CCONTACTLIST_H_ +#define _CCONTACTLIST_H_ + +#include "CLCDList.h" + +class CContactListEntry +{ +public: + int iMessages; + tstring strMessages; + HANDLE hHandle; + tstring strName; + tstring strProto; + tstring strStatus; + int iStatus; +}; + +class CContactListGroup +{ +public: + tstring strName; + tstring strPath; + int iMembers; + int iGroups; + int iOnline; + int iEvents; + + HANDLE hMetaContact; + CContactListEntry *pContactListEntry; +}; + +class CContactList : public CLCDList +{ +public: + // constructor + CContactList(); + // destructor + ~CContactList(); + + // initializes the list + bool Initialize(); + // deinitializes the list + bool Shutdown(); + + // called when a contact has been added + void OnContactAdded(HANDLE hContact); + // called when a contact has been deleted + void OnContactDeleted(HANDLE hContact); + // called when the configuration has changed + void OnConfigChanged(); + // called when a contacts group has changed + void OnContactGroupChanged(HANDLE hContact,tstring strGroup); + // called when a contacts hidden flag has changed + void OnContactHiddenChanged(HANDLE hContact, bool bVisibility); + // called when a contacts nickname has changed + void OnContactNickChanged(HANDLE hContact, tstring strNick); + // called when a contacts status has changed + void OnStatusChange(HANDLE hContact,int iStatus); + // called when the contacts message count has changed + void OnMessageCountChanged(HANDLE hContact); + // returns the contact's status + int GetContactStatus(HANDLE hContact); + + // Called to compare two entrys + static bool CompareEntries(CListEntry *pLeft,CListEntry *pRight); + + void SetPosition(CListEntry *pEntry); + bool ScrollUp(); + bool ScrollDown(); + void ShowSelection(); + + bool SetFont(LOGFONT &lf); +protected: + // returns the contacts group path + tstring GetContactGroupPath(HANDLE hContact); + + // adds a contact to the list + void AddContact(HANDLE hContact); + // removes a contact from the list + void RemoveContact(HANDLE hContact); + + // uninitializes the group objects + void UninitializeGroupObjects(); + + // initializes the group objects + void InitializeGroupObjects(); + // get group object by string + CContactListGroup *GetGroupObjectByPath(tstring strPath); + // creates a group object by string + CContactListGroup *CreateGroupObjectByPath(tstring strPath); + // deletes a group object by string + void DeleteGroupObjectByPath(tstring strPath); + + // changes the groups membercount + void ChangeGroupObjectCounters(tstring strGroup,int iMembers,int iOnline=0,int iEvents=0); + + // returns wether a contact should be listed or not + bool IsVisible(CContactListEntry *pEntry); + + // sorts all entries of a group + void SortGroup(CListContainer *pGroup); + + // tries to find a contact in the specified group + CListEntry *FindContactInGroup(HANDLE hContact,CListContainer *pGroup); + + // tries to find a group in the specified group + CListContainer *FindGroupInGroup(tstring strGroup,CListContainer *pGroup); + + // Adds a group + CListContainer *AddGroupByString(tstring strGroup); + // get group by string + CListContainer *GetGroupByString(tstring strGroup); + + // updates the message counter for the specified entry + void UpdateMessageCounter(CListEntry *pContactEntry); + // refreshes the list + void RefreshList(); + + // returns the entry for the specified handle + CListEntry *FindContact(HANDLE hContact); + + // returns the entry for the specified group name + CListContainer *FindGroup(tstring strGroup); + + // returns the contacts ccontactlistentry class + static CContactListEntry *GetContactData(CListEntry *pEntry); + + // Called to delete the specified item + void DeleteItem(CContactListEntry *pEntry); + // Called to delete the specified group + void DeleteGroup(CContactListGroup* pGroup); + // Called to draw the specified group + void DrawGroup(CLCDGfx *pGfx,CContactListGroup* pGroup,bool bOpen,bool bSelected); + // Called to draw the specified entry + void DrawEntry(CLCDGfx *pGfx,CContactListEntry *pEntry,bool bSelected); + + bool m_bUseGroups; + bool m_bUseMetaContacts; + vector m_Groups; + DWORD m_dwLastScroll; + + HBITMAP m_ahBitmaps[8]; +}; + +#endif \ No newline at end of file -- cgit v1.2.3