123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #ifndef IECPROPSTORAGE_H
- #define IECPROPSTORAGE_H
- #include <kopano/IECUnknown.h>
- #include <mapi.h>
- #include <mapispi.h>
- #include <list>
- #include <set>
- #include "ECPropertyEntry.h"
- #include "kcore.hpp"
- #include <kopano/Util.h>
- struct MAPIOBJECT {
- MAPIOBJECT() {
-
- };
-
- MAPIOBJECT(unsigned int ulType, unsigned int ulId) : ulUniqueId(ulId), ulObjType(ulType) {
- }
- bool operator < (const MAPIOBJECT &other) const {
- std::pair<unsigned int, unsigned int> me(ulObjType, ulUniqueId), him(other.ulObjType, other.ulUniqueId);
-
- return me < him;
- };
- struct CompareMAPIOBJECT {
- bool operator()(const MAPIOBJECT *a, const MAPIOBJECT *b) const
- {
- return *a < *b;
- }
- };
- MAPIOBJECT(const MAPIOBJECT *lpSource)
- {
- this->bChanged = lpSource->bChanged;
- this->bChangedInstance = lpSource->bChangedInstance;
- this->bDelete = lpSource->bDelete;
- this->ulUniqueId = lpSource->ulUniqueId;
- this->ulObjId = lpSource->ulObjId;
- this->ulObjType = lpSource->ulObjType;
- Util::HrCopyEntryId(lpSource->cbInstanceID, (LPENTRYID)lpSource->lpInstanceID,
- &this->cbInstanceID, (LPENTRYID *)&this->lpInstanceID);
- this->lstDeleted = lpSource->lstDeleted;
- this->lstModified = lpSource->lstModified;
- this->lstProperties = lpSource->lstProperties;
- this->lstAvailable = lpSource->lstAvailable;
- for (const auto &i : lpSource->lstChildren)
- this->lstChildren.insert(new MAPIOBJECT(i));
- };
-
- std::set<MAPIOBJECT *, CompareMAPIOBJECT> lstChildren;
- std::list<ULONG> lstDeleted;
- std::list<ULONG> lstAvailable;
- std::list<ECProperty> lstModified;
- std::list<ECProperty> lstProperties;
- LPSIEID lpInstanceID = nullptr;
- ULONG cbInstanceID = 0;
- BOOL bChangedInstance = false;
- BOOL bChanged = false;
- BOOL bDelete = false;
- ULONG ulUniqueId = 0;
- ULONG ulObjId = 0;
- ULONG ulObjType = 0;
- };
- typedef std::set<MAPIOBJECT*, MAPIOBJECT::CompareMAPIOBJECT> ECMapiObjects;
- class IECPropStorage : public IECUnknown {
- public:
-
- virtual HRESULT HrReadProps(LPSPropTagArray *lppPropTags,ULONG *cValues, LPSPropValue *ppValues) = 0;
-
- virtual HRESULT HrLoadProp(ULONG ulObjId, ULONG ulPropTag, LPSPropValue *lppsPropValue) = 0;
-
- virtual HRESULT HrWriteProps(ULONG cValues, LPSPropValue pValues, ULONG ulFlags = 0) = 0;
-
- virtual HRESULT HrDeleteProps(const SPropTagArray *lpsPropTagArray) = 0;
-
- virtual HRESULT HrSaveObject(ULONG ulFlags, MAPIOBJECT *lpSavedObjects) = 0;
-
- virtual HRESULT HrLoadObject(MAPIOBJECT **lppSavedObjects) = 0;
-
- virtual IECPropStorage* GetServerStorage() = 0;
- };
- #endif
|