summaryrefslogtreecommitdiff
path: root/plugins/FloatingContacts/src/thumbs.h
blob: c1bedb61efc25338a87f5ab609b411fff35ab0d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/////////////////////////////////////////////////////////////////////////////
//
#define	USERNAME_LEN				50
class CDropTarget;

typedef struct _DockOpt
{
	HWND	hwndLeft;
	HWND	hwndRight;
}
DockOpt;

struct ThumbInfo
{
	MCONTACT     hContact;
	HWND         hwnd;
	TCHAR        ptszName[USERNAME_LEN];
	int          iIcon;
	CDropTarget *dropTarget;
	DockOpt      dockOpt;
	BOOL         fTipActive;
	BOOL         fTipTimerActive;
	POINT        ptTipSt;

	BYTE         btAlpha;
	MyBitmap     bmpContent;

	POINT        ptPos;
	SIZE         szSize;

public:
	ThumbInfo();
	~ThumbInfo();

	void GetThumbRect(RECT *rc);
	void PositionThumb(int nX, int nY); 
	void PositionThumbWorker(int nX, int nY, POINT *rcNewPos); 
	void ResizeThumb();
	void RefreshContactIcon(int iIcon);
	void RefreshContactStatus(int idStatus);
	void DeleteContactPos();
	void OnLButtonDown(int nX, int nY);
	void OnLButtonUp();
	void OnMouseMove(int nX, int nY, WPARAM wParam);
	void ThumbSelect(BOOL bMouse);
	void ThumbDeselect(BOOL bMouse);
	void SetThumbOpacity(BYTE btAlpha);
	void KillTip();
	void UpdateContent();
	void PopupMessageDialog();
	void OnTimer(BYTE idTimer);
};

void UndockThumbs(ThumbInfo *pThumb1, ThumbInfo *pThumb2);
void DockThumbs(ThumbInfo *pThumbLeft, ThumbInfo *pThumbRight, BOOL bMoveLeft);

class ThumbList: public OBJLIST<ThumbInfo>
{
public:
	ThumbList();
	~ThumbList();

	ThumbInfo* AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact);
	void       RemoveThumb(ThumbInfo *pThumb);

	ThumbInfo* FindThumb(HWND hwnd);
	ThumbInfo* FindThumbByContact(MCONTACT hContact);
};

extern ThumbList thumbList;