summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-18 18:37:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-18 18:37:18 +0000
commit3791ce0c509d1d7a64cbba67015db38f4db5404c (patch)
tree360f57c9d567cb9a83f3c7bd09349324673ae184 /include
parenta154027918d0a5f2f270615e606d463e35a80d1e (diff)
- introducing ME_DB_EVENT_MARKED_READ - an event being called upon the call of db_event_markRead;
- various m_database.h related code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r--include/delphi/m_database.inc7
-rw-r--r--include/m_database.h69
2 files changed, 42 insertions, 34 deletions
diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc
index eefe7657d8..7a5cda29b5 100644
--- a/include/delphi/m_database.inc
+++ b/include/delphi/m_database.inc
@@ -363,6 +363,13 @@ const
{
wParam : HCONTACT
lParam : HANDLE
+ Affect : Called when an event is marked read
+ }
+ ME_DB_EVENT_MARKED_READ:PAnsiChar = 'DB/Event/Marked/Read';
+
+ {
+ wParam : HCONTACT
+ lParam : HANDLE
Affect : Called when an event is about to be deleted from the event chain
for a contact, see notes
notes : Returning non zero from your hook will NOT stop the deletion,
diff --git a/include/m_database.h b/include/m_database.h
index 01922171f8..7f9d4a921d 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -25,10 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef M_DATABASE_H__
#define M_DATABASE_H__ 1
-#ifndef M_CORE_H__
- #include <m_core.h>
-#endif
-
/******************* DATABASE MODULE ***************************/
/* Notes (as I think of them):
@@ -69,8 +65,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/******************** GENERALLY USEFUL STUFF***********************/
-#include <tchar.h>
-
#if !defined(M_SYSTEM_H__)
#include "m_system.h"
#endif
@@ -142,23 +136,23 @@ Implemented in the dbchecker plugins, thus it might not exist
/************************* Contact ********************************/
typedef struct {
- const char *szModule; // pointer to name of the module that wrote the
+ const char *szModule; // pointer to name of the module that wrote the
// setting to get
- const char *szSetting; // pointer to name of the setting to get
- DBVARIANT *pValue; // pointer to variant to receive the value
+ const char *szSetting; // pointer to name of the setting to get
+ DBVARIANT *pValue; // pointer to variant to receive the value
} DBCONTACTGETSETTING;
typedef struct {
- const char *szModule; // pointer to name of the module that wrote the
+ const char *szModule; // pointer to name of the module that wrote the
// setting to get
- const char *szSetting; // pointer to name of the setting to get
- DBVARIANT value; // variant containing the value to set
+ const char *szSetting; // pointer to name of the setting to get
+ DBVARIANT value; // variant containing the value to set
} DBCONTACTWRITESETTING;
/* db/contact/enumsettings v0.1.0.1+
Lists all the settings a specific modules has stored in the database for a
specific contact.
-wParam = (WPARAM)(HANDLE)hContact
+wParam = (WPARAM)(MCONTACT)hContact
lParam = (LPARAM)(DBCONTACTENUMSETTINGS*)&dbces
Returns the return value of the last call to pfnEnumProc, or -1 if there are
no settings for that module/contact pair
@@ -171,10 +165,10 @@ you want to keep it for longer you must allocation your own storage.
typedef int (*DBSETTINGENUMPROC)(const char *szSetting, LPARAM lParam);
typedef struct {
DBSETTINGENUMPROC pfnEnumProc;
- LPARAM lParam; //passed direct to pfnEnumProc
- const char *szModule; //name of the module to get settings for
- DWORD ofsSettings; //filled by the function to contain the offset from
- //the start of the database of the requested settings group.
+ LPARAM lParam; // passed direct to pfnEnumProc
+ const char *szModule; // name of the module to get settings for
+ DWORD ofsSettings; // filled by the function to contain the offset from
+ // the start of the database of the requested settings group.
} DBCONTACTENUMSETTINGS;
#define MS_DB_CONTACT_ENUMSETTINGS "DB/Contact/EnumSettings"
@@ -189,7 +183,7 @@ and contact/findnext
/* DB/Contact/Delete
Deletes the contact hContact from the database and all events and settings
associated with it.
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = 0
Returns 0 on success or nonzero if hContact was invalid
Please don't try to delete the user contact (hContact = NULL)
@@ -234,20 +228,17 @@ Always returns 0.
typedef struct
{
- int cbSize; // structure size in bytes
- char* module; // event module name
- int eventType; // event id, unique for this module
- char* descr; // event type description (i.e. "File Transfer")
- char* textService; // service name for MS_DB_EVENT_GETTEXT (0.8+, default Module+'/GetEventText'+EvtID)
- char* iconService; // service name for MS_DB_EVENT_GETICON (0.8+, default Module+'/GetEventIcon'+EvtID)
+ int cbSize; // structure size in bytes
+ LPSTR module; // event module name
+ int eventType; // event id, unique for this module
+ LPSTR descr; // event type description (i.e. "File Transfer")
+ LPSTR textService; // service name for MS_DB_EVENT_GETTEXT (0.8+, default Module+'/GetEventText'+EvtID)
+ LPSTR iconService; // service name for MS_DB_EVENT_GETICON (0.8+, default Module+'/GetEventIcon'+EvtID)
HANDLE eventIcon; // icolib handle to eventicon (0.8+, default 'eventicon_'+Module+EvtID)
- DWORD flags; // flags, combination of the DETF_*
+ DWORD flags; // flags, combination of the DETF_*
}
DBEVENTTYPEDESCR;
-#define DBEVENTTYPEDESCR_SIZE sizeof(DBEVENTTYPEDESCR)
-#define DBEVENTTYPEDESCR_SIZE_V1 (offsetof(DBEVENTTYPEDESCR, textService))
-
// constants for default event behaviour
#define DETF_HISTORY 1 // show event in history
#define DETF_MSGWINDOW 2 // show event in message window
@@ -447,7 +438,7 @@ lParam = (LPARAM)(char*)szModuleName - the module name to be deleted
/* DB/Event/Added event
Called when a new event has been added to the event chain for a contact
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = (LPARAM)(HANDLE)hDbEvent
hDbEvent is a valid handle to the event. hContact is a valid handle to the
contact to which hDbEvent refers.
@@ -465,7 +456,7 @@ passed to db_event_add.
The point of this hook is to stop any unwanted database events, to stop
an event being added, return 1, to allow the event to pass through return
0.
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = (LPARAM)&DBEVENTINFO
Any changed made to the said DBEVENTINFO are also passed along to the database,
@@ -473,9 +464,19 @@ therefore it is possible to shape the data, however DO NOT DO THIS.
*/
#define ME_DB_EVENT_FILTER_ADD "DB/Event/FilterAdd"
+/* DB/Event/Marked/Read event
+Called when an event is marked read
+wParam = (WPARAM)(MCONTACT)hContact
+lParam = (LPARAM)(HANDLE)hDbEvent
+hDbEvent is a valid handle to the event.
+hContact is a valid handle to the contact to which hDbEvent refers, and will
+remain valid.
+*/
+#define ME_DB_EVENT_MARKED_READ "DB/Event/Marked/Read"
+
/* DB/Event/Deleted event
Called when an event is about to be deleted from the event chain for a contact
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = (LPARAM)(HANDLE)hDbEvent
hDbEvent is a valid handle to the event which is about to be deleted, but it
won't be once your hook has returned.
@@ -488,7 +489,7 @@ usual, stop other hooks from being called.
/* DB/Contact/Added event
Called when a new contact has been added to the database
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = 0
hContact is a valid handle to the new contact.
Contacts are initially created without any settings, so if you hook this event
@@ -498,7 +499,7 @@ you will almost certainly also want to hook db/contact/settingchanged as well.
/* DB/Contact/Deleted event
Called when an contact is about to be deleted
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = 0
hContact is a valid handle to the contact which is about to be deleted, but it
won't be once your hook has returned.
@@ -510,7 +511,7 @@ Deleting a contact invalidates all events in its chain.
/* DB/Contact/SettingChanged event
Called when a contact has had one of its settings changed
- wParam = (WPARAM)(HANDLE)hContact
+ wParam = (WPARAM)(MCONTACT)hContact
lParam = (LPARAM)(DBCONTACTWRITESETTING*)&dbcws
hContact is a valid handle to the contact that has changed.
This event will be triggered many times rapidly when a whole bunch of values