summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/LCDFramework/CLCDConnection.h
blob: 099f850ec961dc5d3b81e770b5bcd52f85031422 (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
#ifndef _CLCDCONNECTION_H_
#define _CLCDCONNECTION_H_

#include "CLCDDevice.h"

#define TYPE_LOGITECH 0

#define CONNECTED 1
#define DISCONNECTED 0

class CLCDConnection
{
protected:
	bool m_bReconnect;
	
public:
	// returns the connection type
	virtual int GetConnectionType()=0;
	
	// returns a pointer to a vector of LCDDevices
	virtual CLCDDevice* GetAttachedDevice(int iIndex);
	// returns a pointer to the current device
	virtual CLCDDevice* GetConnectedDevice();

	// Initializes the connection to the LCD
	virtual bool Initialize(tstring strAppletName,bool bAutostart = false, bool bConfigDialog = false);

	// Connects to the specified LCD
	virtual bool Connect(int iIndex = 0);
	// Connects to the specified LCD
	virtual bool Disconnect();

	// toggles the automatic reconnection
	void SetReconnect(bool bSet);

	// Closes the connection with the LCD
	virtual bool Shutdown();
	// Update function
	virtual bool Update();
	// Draws the specified bitmap on the LCD
	virtual bool Draw();
	// Hides the applet
	virtual bool HideApplet();
	
	// returns the connections state
	virtual int GetConnectionState();

	// returns the id of the specified button
	virtual int GetButtonId(int iButton);
	// Returns the state of the specified Button
	virtual bool GetButtonState(int iButton);
	// Temporarily brings the applet to foreground
	virtual void SetAlert(bool bAlert);
	// Activates the applet on the LCD
	virtual void SetAsForeground(bool bSetAsForeground);
	// returns wether the applet is currently activated
	virtual bool IsForeground();

	// Returns the display size
	virtual SIZE GetDisplaySize();
	// Returns the number of buttons for the display
	virtual int GetButtonCount();
	// Returns the number of available colors
	virtual int GetColorCount();

	// Get the pointer to the pixel buffer
	virtual PBYTE GetPixelBuffer();

public:
	CLCDConnection();
	virtual ~CLCDConnection();
};

#endif