summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/SmileyBase.h
blob: f7453c39f824af0828791f328c5b7be0bc113736 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
Miranda SmileyAdd Plugin
Copyright (C) 2008 - 2011 Boris Krasnovskiy All Rights Reserved

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#define OLEIVERB_SETOWNER		(-24)

EXTERN_C const IID IID_ITooltipData;

class ITooltipData : public IUnknown 
{
public:
	STDMETHOD(SetTooltip) (BSTR bstrHint)   PURE;
	STDMETHOD(GetTooltip) (BSTR *bstrHint) PURE; 
};


EXTERN_C const IID IID_ISmileyAddSmiley;

class ISmileyBase : public IOleObject, public IViewObject2, public ITooltipData
{
	IOleAdviseHolder* m_spAdviseHolder;
	IAdviseSink*      m_spAdviseSink;
	IOleClientSite*   m_spClientSite;
	
	DWORD  m_advf;
	LONG   m_lRefCount;

	wchar_t* m_smltxt;

protected:
	SIZEL  m_sizeExtent;
	SIZEL  m_sizeExtentHiM;
	RECT   m_orect;
	HWND   m_hwnd;
	bool   m_visible;
	bool   m_dirAniAllow;

public:
	ISmileyBase(void);
	virtual ~ISmileyBase(void);

	virtual void OnClose(void);
	void SendOnViewChange(void);

	bool QueryHitPointSpecial(int x, int y, HWND hwnd, wchar_t **smltxt);
	void SetHint(wchar_t *smltxt);

	virtual void Draw() PURE;
	virtual void SetPosition(HWND hwnd, LPCRECT lpRect);

	//
	// IUnknown members
	//
	STDMETHOD_(ULONG, AddRef)(void);
	STDMETHOD_(ULONG, Release)(void);
	STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject);

	//
	// IOleObject members
	//
	STDMETHOD(SetClientSite)(IOleClientSite *pClientSite);
	STDMETHOD(GetClientSite)(IOleClientSite **ppClientSite);
	STDMETHOD(SetHostNames)(LPCOLESTR /* szContainerApp */, LPCOLESTR /* szContainerObj */);
	STDMETHOD(Close)(DWORD /* dwSaveOption */);
	STDMETHOD(SetMoniker)(DWORD /* dwWhichMoniker */, IMoniker* /* pmk */);
	STDMETHOD(GetMoniker)(DWORD /* dwAssign */, DWORD /* dwWhichMoniker */, IMoniker** /* ppmk */);
	STDMETHOD(InitFromData)(IDataObject* /* pDataObject */, BOOL /* fCreation */, DWORD /* dwReserved */);
	STDMETHOD(GetClipboardData)(DWORD /* dwReserved */, IDataObject** /* ppDataObject */);
	STDMETHOD(DoVerb)(LONG /*iVerb*/, LPMSG /* pMsg */, IOleClientSite* /* pActiveSite */, LONG /* lindex */, HWND /*hwndParent*/, LPCRECT /*lprcPosRect*/);
	STDMETHOD(EnumVerbs)(IEnumOLEVERB** /*ppEnumOleVerb*/);
	STDMETHOD(Update)(void);
	STDMETHOD(IsUpToDate)(void);
	STDMETHOD(GetUserClassID)(CLSID *pClsid);
	STDMETHOD(GetUserType)(DWORD /*dwFormOfType*/, LPOLESTR* /*pszUserType*/);
	STDMETHOD(SetExtent)(DWORD /*dwDrawAspect*/, SIZEL* /*psizel*/);
	STDMETHOD(GetExtent)(DWORD dwDrawAspect, SIZEL *psizel);
	STDMETHOD(Advise)(IAdviseSink *pAdvSink, DWORD *pdwConnection);
	STDMETHOD(Unadvise)(DWORD dwConnection);
	STDMETHOD(EnumAdvise)(IEnumSTATDATA **ppEnumAdvise);
	STDMETHOD(GetMiscStatus)(DWORD dwAspect, DWORD *pdwStatus);
	STDMETHOD(SetColorScheme)(LOGPALETTE* /* pLogpal */);

	//
	// IViewObject members
	//
	STDMETHOD(SetAdvise)(DWORD aspect, DWORD advf, IAdviseSink* pAdvSink);
	STDMETHOD(GetAdvise)(DWORD* /*pAspects*/, DWORD* /*pAdvf*/, IAdviseSink** ppAdvSink);
	STDMETHOD(Freeze)(DWORD, long, void*, DWORD*);
	STDMETHOD(Unfreeze)(DWORD);
	STDMETHOD(GetColorSet)(DWORD, long, void*, DVTARGETDEVICE*, HDC, LOGPALETTE**);

	//
	// IViewObject2 members
	//
	STDMETHOD(GetExtent)(DWORD aspect, long, DVTARGETDEVICE*, SIZEL *pSize);

	//
	// ITooltipData members
	//
	STDMETHOD(SetTooltip)(BSTR bstrHint);
	STDMETHOD(GetTooltip)(BSTR *bstrHint);
};