summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/include/nen.h
blob: d3a8fa8bdd621e46ed61ca19956deafc51430a89 (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
 * astyle --force-indent=tab=4 --brackets=linux --indent-switches
 *		  --pad=oper --one-line=keep-blocks  --unpad=paren
 *
 * Miranda IM: the free IM client for Microsoft* Windows*
 *
 * Copyright 2000-2009 Miranda ICQ/IM project,
 * all portions of this codebase are copyrighted to the people
 * listed in contributors.txt.
 *
 * 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; either version 2
 * of the License, or (at your option) any later version.
 *
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * part of tabSRMM messaging plugin for Miranda.
 *
 * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
 *
 * $Id: nen.h 13750 2011-08-03 20:10:43Z george.hazan $
 *
 * This implements the event notification module for tabSRMM. The code
 * is largely based on the NewEventNotify plugin for Miranda IM. See
 * notices below for original copyright
 *
 *  Name: NewEventNotify - Plugin for Miranda ICQ
 * 	Description: Notifies you when you receive a message
 * 	Author: icebreaker, <icebreaker@newmail.net>
 * 	Date: 18.07.02 13:59 / Update: 16.09.02 17:45
 * 	Copyright: (C) 2002 Starzinger Michael
 *
 */

#ifndef _NEN_H_
#define _NEN_H_

//#include "m_popup.h"
//#include "m_popupw.h"

#define MODULE "tabSRMM_NEN"

int tabSRMM_ShowPopup(WPARAM wParam, LPARAM lParam, WORD eventType, int windowOpen, struct TContainerData *pContainer, HWND hwndChild, const char *szProto, struct TWindowData *dat);


#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
#define DEFAULT_MASKNOTIFY (MASK_MESSAGE|MASK_URL|MASK_FILE|MASK_OTHER)
#define DEFAULT_MASKACTL (MASK_OPEN|MASK_DISMISS)
#define DEFAULT_MASKACTR (MASK_DISMISS)
#define DEFAULT_DELAY -1

#define MASK_MESSAGE    0x0001
#define MASK_URL        0x0002
#define MASK_FILE       0x0004
#define MASK_OTHER      0x0008

#define MASK_DISMISS    0x0001
#define MASK_OPEN       0x0002
#define MASK_REMOVE     0x0004

#define PU_REMOVE_ON_FOCUS 1
#define PU_REMOVE_ON_TYPE 2
#define PU_REMOVE_ON_SEND 4

#define SETTING_LIFETIME_MIN		1
#define SETTING_LIFETIME_MAX		60
#define SETTING_LIFETIME_DEFAULT	4

//Entrys in the database, don't translate
#define OPT_PREVIEW "Preview"
#define OPT_COLDEFAULT_MESSAGE "DefaultColorMsg"
#define OPT_COLBACK_MESSAGE "ColorBackMsg"
#define OPT_COLTEXT_MESSAGE "ColorTextMsg"
#define OPT_COLDEFAULT_OTHERS "DefaultColorOthers"
#define OPT_COLDEFAULT_ERR "DefaultColorErr"
#define OPT_COLBACK_OTHERS "ColorBackOthers"
#define OPT_COLTEXT_OTHERS "ColorTextOthers"
#define OPT_COLBACK_ERR "ColorBackErr"
#define OPT_COLTEXT_ERR "ColorTextErr"
#define OPT_MASKNOTIFY "Notify"
#define OPT_MASKACTL "ActionLeft"
#define OPT_MASKACTR "ActionRight"
#define OPT_MASKACTTE "ActionTimeExpires"
#define OPT_MERGEPOPUP "MergePopup"
#define OPT_DELAY_MESSAGE "DelayMessage"
#define OPT_DELAY_OTHERS "DelayOthers"
#define OPT_DELAY_ERR "DelayErr"
#define OPT_SHOW_HEADERS "ShowHeaders"
#define OPT_NORSS "NoRSSAnnounces"
#define OPT_DISABLE "Disabled"
#define OPT_MUCDISABLE "MUCDisabled"
#define OPT_WINDOWCHECK "WindowCheck"
#define OPT_LIMITPREVIEW "LimitPreview"
#define OPT_REMOVEMASK "removemask"

struct NEN_OPTIONS {
	BOOL bPreview;
	BOOL bDefaultColorMsg;
	BOOL bDefaultColorOthers;
	BOOL bDefaultColorErr;
	BOOL bDisableNonMessage;
	COLORREF colBackMsg;
	COLORREF colTextMsg;
	COLORREF colBackOthers;
	COLORREF colTextOthers;
	COLORREF colBackErr;
	COLORREF colTextErr;
	UINT maskActL;
	UINT maskActR;
	UINT maskActTE;
	int iDelayMsg;
	int iDelayOthers;
	int iDelayErr;
	int iDelayDefault;
	BOOL bMergePopup;
	BOOL bShowHeaders;
	BOOL bNoRSS;
	int  iDisable;
	int	 iMUCDisable;
	int  dwStatusMask;
	BOOL bTraySupport;
	BOOL bTrayExist;
	BOOL iNoSounds;
	BOOL iNoAutoPopup;
	BOOL bWindowCheck;
	int  iLimitPreview;
	WORD wMaxRecent;
	WORD wMaxFavorites;
	DWORD dwRemoveMask;
};

typedef struct {
	HANDLE hEvent;
	TCHAR szText[MAX_SECONDLINE + 2];
	DWORD timestamp;
} EVENT_DATAT;

typedef struct {
	UINT 		eventType;
	HANDLE 		hContact;
	NEN_OPTIONS *pluginOptions;
	POPUPDATAT_V2* pud;
	HWND 		hWnd;
	long 		iSeconds;
	TCHAR 		szHeader[256];
	int  		nrMerged;
	EVENT_DATAT *eventData;
	int  		nrEventsAlloced;
	int  		iActionTaken;
	HWND     hContainer;
} PLUGIN_DATAT;

#define NR_MERGED 5

#define TIMER_TO_ACTION 50685

#define MAX_DATASIZE	50
#define MAX_POPUPS 20

#endif