diff options
| author | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
|---|---|---|
| committer | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
| commit | 97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch) | |
| tree | 46f3701832d70b420eb0fc0eb93261f9da45db3f /wpd/WpdServiceSampleDriver/FakeContactsServiceContent.h | |
| parent | ef1905bf1e8825bb31120dfb27e0daf3154d859a (diff) | |
Initial publish
Diffstat (limited to 'wpd/WpdServiceSampleDriver/FakeContactsServiceContent.h')
| -rw-r--r-- | wpd/WpdServiceSampleDriver/FakeContactsServiceContent.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/wpd/WpdServiceSampleDriver/FakeContactsServiceContent.h b/wpd/WpdServiceSampleDriver/FakeContactsServiceContent.h new file mode 100644 index 00000000..e7dbee0e --- /dev/null +++ b/wpd/WpdServiceSampleDriver/FakeContactsServiceContent.h @@ -0,0 +1,92 @@ +#pragma once + +/** + * This class represents an abstraction of a contacts service content object + * Driver implementors should replace this with their own + * device I/O classes/libraries. + */ + +#define CONTACTS_SERVICE_OBJECT_ID L"789DEF" +#define CONTACTS_SERVICE_PERSISTENT_UNIQUE_ID L"{95A95EA9-9904-430E-8FF6-70851F208478}" +#define CONTACTS_SERVICE_OBJECT_NAME_VALUE NAME_ContactsSvc +#define CONTACTS_SERVICE_HUMAN_READABLE_NAME L"Hello World Phone Contacts" +#define CONTACTS_SERVICE_PREFERRED_FORMAT WPD_OBJECT_FORMAT_ABSTRACT_CONTACT +#define CONTACTS_SERVICE_VERSION L"1.0" +#define CONTACTS_SERVICE_LOCAL_ONLY_DELETE 1 + +#define NUM_CONTACT_OBJECTS 10 + +class FakeContactsServiceContent : public FakeContent +{ +public: + FakeContactsServiceContent() + { + ObjectID = CONTACTS_SERVICE_OBJECT_ID; + PersistentUniqueID = CONTACTS_SERVICE_PERSISTENT_UNIQUE_ID; + ParentID = WPD_DEVICE_OBJECT_ID; + Name = CONTACTS_SERVICE_OBJECT_NAME_VALUE; + ContentType = WPD_CONTENT_TYPE_FUNCTIONAL_OBJECT; + Format = WPD_OBJECT_FORMAT_UNSPECIFIED; + ParentPersistentUniqueID = WPD_DEVICE_OBJECT_ID; + ContainerFunctionalObjectID = WPD_DEVICE_OBJECT_ID; + + Version = CONTACTS_SERVICE_VERSION; + FunctionalCategory = SERVICE_Contacts; + HumanReadableName = CONTACTS_SERVICE_HUMAN_READABLE_NAME; + PreferredSyncFormat = CONTACTS_SERVICE_PREFERRED_FORMAT; + RequiredScope = CONTACTS_SERVICE_ACCESS; + LocalOnlyDelete = CONTACTS_SERVICE_LOCAL_ONLY_DELETE; + FilterType = SYNCSVC_FILTER_CONTACTS_WITH_PHONE; + CopyMemory(&ReplicaId, &MyFullEnumSyncReplicaId, sizeof(ReplicaId)); + } + + FakeContactsServiceContent(const FakeContent& src) + { + *this = src; + } + + virtual ~FakeContactsServiceContent() + { + } + + virtual HRESULT InitializeContent( + _Inout_ DWORD *pdwLastObjectID); + + virtual HRESULT CreatePropertiesOnlyObject( + _In_ IPortableDeviceValues* pObjectProperties, + _Out_ DWORD* pdwLastObjectID, + _Outptr_result_nullonfailure_ FakeContent** ppNewObject); + + virtual HRESULT GetSupportedProperties( + _In_ IPortableDeviceKeyCollection *pKeys); + + virtual HRESULT GetPropertyAttributes( + _In_ REFPROPERTYKEY Key, + _In_ IPortableDeviceValues* pAttributes); + + virtual HRESULT GetValue( + _In_ REFPROPERTYKEY Key, + _In_ IPortableDeviceValues* pStore); + + virtual HRESULT WriteValue( + _In_ REFPROPERTYKEY Key, + _In_ REFPROPVARIANT Value); + +private: + HRESULT GetIconData( + _In_ IPortableDeviceValues* pStore); + + HRESULT GetVICData( + _In_ IPortableDeviceValues* pStore); + +public: + CAtlStringW Version; + CAtlStringW HumanReadableName; + + GUID FunctionalCategory; + GUID PreferredSyncFormat; + GUID ReplicaId; + + BYTE LocalOnlyDelete; + BYTE FilterType; +}; |
