30 #ifndef ___IKPDATABASE_H___
31 #define ___IKPDATABASE_H___
35 #include "../../SysDefEx.h"
37 #include "../../PwStructs.h"
44 struct KP_DECL_INTERFACE("29A5C55A-7100-4A1E-B74D-986C0E085AB2")
IKpDatabase :
49 STDMETHOD(InitPrimaryInstance)() = 0;
53 STDMETHOD_(INT, SetMasterKey)(LPCTSTR lpMasterKey, BOOL bDiskDrive,
54 LPCTSTR lpSecondKey) = 0;
56 STDMETHOD_(DWORD, GetEntryCount)() = 0;
57 STDMETHOD_(DWORD, GetGroupCount)() = 0;
60 STDMETHOD_(DWORD, GetEntryCountInGroup)(LPCTSTR lpGroup) = 0;
62 STDMETHOD_(DWORD, GetEntryCountInGroupN)(DWORD dwGroupId) = 0;
67 STDMETHOD_(PW_ENTRY*, GetEntry)(DWORD dwIndex) = 0;
69 STDMETHOD_(PW_ENTRY*, GetEntryByGroup)(DWORD dwGroupId, DWORD dwIndex) = 0;
70 STDMETHOD_(DWORD, GetEntryByGroupN)(DWORD dwGroupId, DWORD dwIndex) = 0;
72 STDMETHOD_(PW_ENTRY*, GetEntryByUuid)(
const BYTE* pUuid) = 0;
73 STDMETHOD_(DWORD, GetEntryByUuidN)(
const BYTE* pUuid) = 0;
74 STDMETHOD_(DWORD, GetEntryPosInGroup)(
const PW_ENTRY* pEntry) = 0;
76 STDMETHOD_(PW_ENTRY*, GetLastEditedEntry)() = 0;
81 STDMETHOD_(PW_GROUP*, GetGroup)(DWORD dwIndex) = 0;
83 STDMETHOD_(PW_GROUP*, GetGroupById)(DWORD dwGroupId) = 0;
84 STDMETHOD_(DWORD, GetGroupByIdN)(DWORD dwGroupId) = 0;
85 STDMETHOD_(DWORD, GetGroupId)(LPCTSTR lpGroupName) = 0;
86 STDMETHOD_(DWORD, GetGroupIdByIndex)(DWORD dwIndex) = 0;
87 STDMETHOD_(DWORD, GetLastChildGroup)(DWORD dwParentIndex) = 0;
88 STDMETHOD_(BOOL, GetGroupTree)(DWORD dwGroupId, DWORD* pvIndices) = 0;
91 STDMETHOD_(BOOL, AddGroup)(
const PW_GROUP* pTemplate) = 0;
92 STDMETHOD_(BOOL, AddEntry)(
const PW_ENTRY* pTemplate) = 0;
93 STDMETHOD_(BOOL, BackupEntry)(
const PW_ENTRY* pe, BOOL* pbGroupCreated) = 0;
96 STDMETHOD_(BOOL, DeleteEntry)(DWORD dwIndex) = 0;
97 STDMETHOD_(BOOL, DeleteGroupById)(DWORD dwGroupId, BOOL bCreateBackupEntries) = 0;
99 STDMETHOD_(BOOL, SetGroup)(DWORD dwIndex,
const PW_GROUP* pTemplate) = 0;
100 STDMETHOD_(BOOL, SetEntry)(DWORD dwIndex,
const PW_ENTRY* pTemplate) = 0;
104 STDMETHOD(LockEntryPassword)(PW_ENTRY* pEntry) = 0;
111 STDMETHOD(UnlockEntryPassword)(PW_ENTRY* pEntry) = 0;
113 STDMETHOD(NewDatabase)() = 0;
114 STDMETHOD_(INT, OpenDatabase)(LPCTSTR lpFile, PWDB_REPAIR_INFO* pRepair) = 0;
115 STDMETHOD_(INT, SaveDatabase)(LPCTSTR lpFile, BYTE* pWrittenDataHash32) = 0;
118 STDMETHOD(MoveEntry)(DWORD dwGroupId, DWORD dwFrom, DWORD dwTo) = 0;
119 STDMETHOD_(BOOL, MoveGroup)(DWORD dwFrom, DWORD dwTo) = 0;
120 STDMETHOD_(BOOL, MoveGroupEx)(DWORD dwFromId, DWORD dwToId) = 0;
121 STDMETHOD_(BOOL, MoveGroupExDir)(DWORD dwGroupId, INT iDirection) = 0;
124 STDMETHOD(SortGroup)(DWORD dwGroupId, DWORD dwSortByField) = 0;
125 STDMETHOD(SortGroupList)() = 0;
128 STDMETHOD_(DWORD, Find)(LPCTSTR lpFindString, BOOL bCaseSensitive,
129 DWORD dwSearchFlags, DWORD dwStart) = 0;
132 STDMETHOD_(BOOL, SetEncryptionAlgorithm)(INT nAlgorithm) = 0;
133 STDMETHOD_(INT, GetEncryptionAlgorithm)() = 0;
135 STDMETHOD_(DWORD, GetKeyEncRounds)() = 0;
136 STDMETHOD(SetKeyEncRounds)(DWORD dwRounds) = 0;
139 STDMETHOD_(
const PW_DBHEADER*, GetLastDatabaseHeader)() = 0;
142 STDMETHOD(FixGroupTree)() = 0;
144 STDMETHOD(SubstEntryGroupIds)(DWORD dwExistingId, DWORD dwNewId) = 0;
146 STDMETHOD(GetRawMasterKey)(BYTE* pStorage) = 0;
147 STDMETHOD(SetRawMasterKey)(
const BYTE* pNewKey) = 0;
149 STDMETHOD(GetPropertyString)(DWORD dwPropertyId, LPTSTR lpBuf, DWORD dwBufMaxChars) = 0;
150 STDMETHOD_(BOOL, SetPropertyString)(DWORD dwPropertyId, LPCTSTR lpValue) = 0;
154 STDMETHOD_(BOOL, SetCustomKvp)(LPCTSTR lpKey, LPCTSTR lpValue) = 0;
157 STDMETHOD_(LPCTSTR, GetCustomKvp)(LPCTSTR lpKey) = 0;
160 STDMETHOD_(LPCTSTR, GetBackupGroupName)(BOOL bTranslated) = 0;
165 #endif // ___IKPDATABASE_H___