diff options
author | aunsane <aunsane@gmail.com> | 2018-09-23 00:17:09 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-09-23 00:17:09 +0300 |
commit | 96fb67177a90fb3ce4e18cad0ef1a3c7409e4f2d (patch) | |
tree | 8217dfeb2fe25a1f43e19e0290b3feb90c7e61b3 /plugins/Dbx_sqlite/src/dbintf.h | |
parent | dafbc9f884d3c696ecaadb9e32b90e831b04427a (diff) |
dbx_sqlite: initial commit (not for use)
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbintf.h')
-rw-r--r-- | plugins/Dbx_sqlite/src/dbintf.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/plugins/Dbx_sqlite/src/dbintf.h b/plugins/Dbx_sqlite/src/dbintf.h new file mode 100644 index 0000000000..4ab30580a5 --- /dev/null +++ b/plugins/Dbx_sqlite/src/dbintf.h @@ -0,0 +1,71 @@ +#pragma once + +struct CDbxSQLite : public MDatabaseCommon, public MZeroedObject +{ +private: + sqlite3 *m_db; + + HANDLE hContactAddedEvent; + HANDLE hContactDeletedEvent; + HANDLE hEventAddedEvent; + HANDLE hEventDeletedEvent; + HANDLE hEventFilterAddedEvent; + HANDLE hEventMarkedRead; + HANDLE hSettingChangeEvent; + + CDbxSQLite(sqlite3 *database); + + void InitContacts(); + void UninitContacts(); + + void InitEvents(); + void UninitEvents(); + + void InitSettings(); + void UninitSettings(); + +public: + ~CDbxSQLite(); + + static int Create(const wchar_t *profile); + static int Check(const wchar_t *profile); + static MDatabaseCommon* Load(const wchar_t *profile, int readonly); + + STDMETHODIMP_(BOOL) IsRelational(void) override; + STDMETHODIMP_(void) SetCacheSafetyMode(BOOL) override; + + STDMETHODIMP_(LONG) GetContactCount(void) override; + STDMETHODIMP_(LONG) DeleteContact(MCONTACT contactID) override; + STDMETHODIMP_(MCONTACT) AddContact(void) override; + STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID) override; + STDMETHODIMP_(LONG) GetContactSize(void) override; + + STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID) override; + STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe) override; + STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, MEVENT hDbEvent) override; + STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent) override; + STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe) override; + STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, MEVENT hDbEvent) override; + STDMETHODIMP_(MCONTACT) GetEventContact(MEVENT hDbEvent) override; + STDMETHODIMP_(MEVENT) FindFirstEvent(MCONTACT contactID) override; + STDMETHODIMP_(MEVENT) FindFirstUnreadEvent(MCONTACT contactID) override; + STDMETHODIMP_(MEVENT) FindLastEvent(MCONTACT contactID) override; + STDMETHODIMP_(MEVENT) FindNextEvent(MCONTACT contactID, MEVENT hDbEvent) override; + STDMETHODIMP_(MEVENT) FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent) override; + + STDMETHODIMP_(MEVENT) GetEventById(LPCSTR szModule, LPCSTR szId) override; + STDMETHODIMP_(BOOL) SetEventId(LPCSTR szModule, MEVENT, LPCSTR szId) override; + + STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam) override; + + STDMETHODIMP_(BOOL) GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, int isStatic) override; + STDMETHODIMP_(BOOL) WriteContactSetting(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws) override; + STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting) override; + STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT hContact, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, void *param) override; + + STDMETHODIMP_(BOOL) MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) override; + STDMETHODIMP_(BOOL) MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) override; + + STDMETHODIMP_(BOOL) Compact() override; + STDMETHODIMP_(BOOL) Backup(LPCWSTR) override; +}; |