summaryrefslogtreecommitdiff
path: root/NewStatusNotify/newstatusnotify.h
blob: a24e94d27ed3befd4005f0012b6cad00ad73807d (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
/*
===============================================================================
                           NewStatusNotify plugin

This plugin notifies you when a contact changes his/hers status with a PopUp.
You can customize its look (style of popup, font, text...) and behaviour (the
position in the screen, the time to live, the action on a mouse click).

This file contains:
- definitions,
- structures,
- macros
which can be useful to different modules (example EventNotify) but mainly
useful to me in order to split my Plugin on different files :-)

Written by: Hrk (Luca Santarelli) (2002-2004), Vasilich (2005-2008)

Miranda IM can be found here:
http://miranda-im.org/

===============================================================================
*/

#ifndef NEWSTATUSNOTIFY_H
#define NEWSTATUSNOTIFY_H

#include "commonheaders.h"
#include "res\resource.h"

#define NAME_OF_UIPAGE "Status Notify"

#define LASTPOPUPTEXT "LastPopupText"
#define MAX_STATUSTEXT   36
#define MAX_STANDARDTEXT 36
#define MAX_SKINSOUNDNAME 36
#define MAX_SKINSOUNDDESC 36

#define MAX_PROTONAMELEN 64

//=== Objects =====
//This one is used to easily tie status id, icon, text...
typedef struct tagaStatus{
	int ID;
	int Icon;
	TCHAR lpzMStatusText[MAX_STATUSTEXT];
	TCHAR lpzFStatusText[MAX_STATUSTEXT];
	TCHAR lpzUStatusText[MAX_STATUSTEXT];
	TCHAR lpzStandardText[MAX_STANDARDTEXT];
	char lpzSkinSoundName[MAX_SKINSOUNDNAME];
	char lpzSkinSoundDesc[MAX_SKINSOUNDDESC];
	char lpzSkinSoundFile[MAX_PATH];
	DWORD dwProtoFlag;
	COLORREF colorBack;
	COLORREF colorText;
} aStatus;

#define Index(ID_STATUS) ID_STATUS - 40071
#define ID_STATUS_MIN	ID_STATUS_OFFLINE
#define ID_STATUS_MAX	ID_STATUS_OUTTOLUNCH

#define byCOLOR_OWN	0x1
#define byCOLOR_WINDOWS	0x2
#define byCOLOR_POPUP	0x3
#define DEFAULT_COLORS	byCOLOR_OWN

//===== Options flags
typedef struct tagMYOPTIONS {
	BYTE Colors;
	//BYTE UseWinColors;
	BYTE UseDullText;
	BYTE ReadAwayMsg;
	BYTE ShowPreviousStatus;
	BYTE TempDisable;
	BYTE AutoDisable;
	BYTE FromOffline;
	BYTE FromOfflinePopup;
	BYTE EnableSoundForMyCurrentStatus;
	BYTE EnablePopupForMyCurrentStatus;
	BYTE UseSpeaker;
	BYTE AvoidClipping;
	BYTE HiddenContactsToo;
	BYTE Log;
	BYTE UseIndSnd;
	BYTE ShowGroup;
	BYTE BlinkIcon;
	BYTE BlinkIcon_Status;
	BYTE byTimeout;
	int iTimeout;
} MYOPTIONS;

#define DB_READ_SUCCESS		0
#define DB_READ_FAIL		-1

typedef struct tagPLUGINDATA {
	WORD newStatus;
	WORD oldStatus;
	HANDLE hAwayMsgProcess;
	HANDLE hAwayMsgHook;
} PLUGINDATA;

typedef struct tagPUWinItem
{
	HANDLE hWnd;
	TCHAR StatMsg[MAX_SECONDLINE];
	HANDLE hContact;
	int Status;
	time_t TimeStamp;
} PUWinItem;

#ifndef MIID_NSN
#ifdef _UNICODE
#define MIID_NSN 	{ 0x481e45c3, 0xde03, 0x4ac6, { 0x80, 0x7b, 0xe3, 0x6d, 0xa2, 0xc8, 0xbb, 0x31 } } // {481E45C3-DE03-4ac6-807B-E36DA2C8BB31}
#else
#define MIID_NSN 	{ 0x90c33425, 0x3bcf, 0x4aeb, { 0xa7, 0xc9, 0x33, 0x64, 0x6b, 0x2f, 0x65, 0xec } } // {90C33425-3BCF-4aeb-A7C9-33646B2F65EC}
#endif
#endif

#endif //NEWSTATUSNOTIFY_H