summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/CNotificationScreen.h
blob: f5142c554cf53188a4f81a5f630c4f94676dd51d (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
#ifndef _CNOTIFICATIONSCREEN_H_
#define _CNOTIFICATIONSCREEN_H_

#include "CScreen.h"
#include "LCDFramework/CLCDLabel.h"
#include "LCDFramework/CLCDTextLog.h"
#include "LCDFramework/CLCDBar.h"
#include "LCDFramework/CLCDInput.h"

class CNotificationEntry
{
public:
	bool bMessage;
	tm Time;
	tstring strText;
	tstring strTitle;
	MCONTACT hContact;
	EventType eType;
};

class CNotificationScreen : public CScreen
{
public:
	// Constructor
	CNotificationScreen();
	// Destructor
	~CNotificationScreen();

	// Initializes the screen 
	bool Initialize();
	// Shutdown the scren
	bool Shutdown();
	// Updates the screen
	bool Update();
	// Draws the screen
	bool Draw(CLCDGfx *pGfx);

	// Called when the screen size has changed
	void OnSizeChanged();
	// Called when the configuration has changed
	void OnConfigChanged();
	// Called when an event is received
	void OnEventReceived(CEvent *pEvent);
	// Called when an LCD-button is pressed
	void OnLCDButtonDown(int iButton);
	// Called when an LCD-button event is repeated
	void OnLCDButtonRepeated(int iButton);
	// Called when an LCD-button is released
	void OnLCDButtonUp(int iButton);
	// Called when the screen is activated
	void OnActivation();
	// Called when the screen is deactivated
	void OnDeactivation();
	// Called when the screen has expired
	void OnExpiration();
private:
	/*
	// activates the input box
	void ActivateMessageMode();
	// deactivates the input box
	void DeactivateMessageMode();
	// sends the message
	void SendCurrentMessage();
	// invalidates the message
	void InvalidateMessageMode(tstring strMessage);
	*/

	// displays the specified notification
	void DisplayNotification(CNotificationEntry *pEntry);
	// updates all objects
	void UpdateObjects();

	// cached notifications
	list<CNotificationEntry*> m_LNotifications;

	// objects
	CLCDLabel		m_EventText;
	CLCDTextLog		m_MessageText;
	CLCDLabel		m_TitleText;
	CLCDLabel		m_Timestamp;
	CLCDBar			m_Scrollbar;
	//CLCDInput		m_Input;

	// Contact off the current event
	CNotificationEntry *m_pEntry;

	// message mode variables
	/*
	bool m_bMessageMode;
	enum { REPLY_STATE_NONE,REPLY_STATE_INPUT,REPLY_STATE_SENDING,REPLY_STATE_FAILED} m_eReplyState;
	HANDLE m_hMessage;
	*/
};

#endif