summaryrefslogtreecommitdiff
path: root/yapp/popup_history.h
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-11-01 14:58:39 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-11-01 14:58:39 +0000
commit0c3d3e587e699d06352f269d887d749a8542559a (patch)
tree2ebcd55584339b04645f0bb79318f987c7efaa46 /yapp/popup_history.h
parent9a1b2f988762967da30e6f4d2575dc2dfe99a21a (diff)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@26 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'yapp/popup_history.h')
-rw-r--r--yapp/popup_history.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/yapp/popup_history.h b/yapp/popup_history.h
new file mode 100644
index 0000000..8bb6c7b
--- /dev/null
+++ b/yapp/popup_history.h
@@ -0,0 +1,59 @@
+#ifndef __popup_history_h__
+#define __popup_history_h__
+
+#define HISTORY_SIZE 200 //number of popup history items
+
+#define PHDF_UNICODE 1
+
+struct PopupHistoryData{
+ DWORD flags; //PHDF_* flags
+ union{
+ char *message;
+ wchar_t *messageW;
+ };
+ union{
+ char *title;
+ wchar_t *titleW;
+ };
+ time_t timestamp;
+};
+
+class PopupHistoryList{
+ protected:
+ private:
+ PopupHistoryData *historyData; //historyData[0] - oldest, historyData[size - 1] - newest
+ int count;
+ int size;
+
+ void DeleteData(int index);
+ void AddItem(PopupHistoryData item); //adds a PopupHistoryData item
+ void RemoveItem(int index);
+
+ public:
+ PopupHistoryList();
+ ~PopupHistoryList();
+
+ void Add(char *title, char *message, time_t timestamp);
+ void Add(wchar_t *title, wchar_t *message, time_t timestamp);
+
+ PopupHistoryData *Get(int index);
+
+ void Clear();
+ int Count();
+ int Size();
+};
+
+/*Shows a history with the last popups.
+Useful if you've missed a popup when it appeared.
+wParam - 0
+lParam - 0
+*/
+#define MS_POPUP_SHOWHISTORY "PopUp/ShowHistory"
+
+extern PopupHistoryList lstPopupHistory; //defined in main.cpp
+extern HWND hHistoryWindow; //the history window
+void RefreshPopupHistory(HWND hWnd);
+
+BOOL CALLBACK DlgProcHistLst(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif //__popup_history_h__