summaryrefslogtreecommitdiff
path: root/wpd/WpdServiceSampleDriver/FakeContactContent.h
diff options
context:
space:
mode:
authorDave Wilson <[email protected]>2015-03-17 19:50:07 -0700
committerDave Wilson <[email protected]>2015-03-17 19:50:07 -0700
commit97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch)
tree46f3701832d70b420eb0fc0eb93261f9da45db3f /wpd/WpdServiceSampleDriver/FakeContactContent.h
parentef1905bf1e8825bb31120dfb27e0daf3154d859a (diff)
Initial publish
Diffstat (limited to 'wpd/WpdServiceSampleDriver/FakeContactContent.h')
-rw-r--r--wpd/WpdServiceSampleDriver/FakeContactContent.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/wpd/WpdServiceSampleDriver/FakeContactContent.h b/wpd/WpdServiceSampleDriver/FakeContactContent.h
new file mode 100644
index 00000000..1b2d8dfb
--- /dev/null
+++ b/wpd/WpdServiceSampleDriver/FakeContactContent.h
@@ -0,0 +1,77 @@
+#pragma once
+
+/**
+ * This class represents an abstraction of a contact content object
+ * Driver implementors should replace this with their own
+ * device I/O classes/libraries.
+ */
+
+class FakeContactContent : public FakeContent
+{
+public:
+ FakeContactContent()
+ {
+ Format = FORMAT_AbstractContact;
+ ContentType = WPD_CONTENT_TYPE_CONTACT;
+ RequiredScope = CONTACTS_SERVICE_ACCESS;
+ CanDelete = true;
+ VersionIdentifier = 0;
+ }
+
+ FakeContactContent(const FakeContactContent& src)
+ {
+ *this = src;
+ }
+
+ ~FakeContactContent()
+ {
+ }
+
+ FakeContactContent& operator= (const FakeContactContent& src)
+ {
+ FamilyName = src.FamilyName;
+ GivenName = src.GivenName;
+ VersionIdentifier = src.VersionIdentifier;
+
+ return *this;
+ }
+
+ HRESULT GetValue(
+ _In_ REFPROPERTYKEY Key,
+ _In_ IPortableDeviceValues* pStore);
+
+ HRESULT WriteValue(
+ _In_ REFPROPERTYKEY Key,
+ _In_ REFPROPVARIANT Value);
+
+ HRESULT GetPropertyAttributes(
+ _In_ REFPROPERTYKEY Key,
+ _In_ IPortableDeviceValues* pAttributes);
+
+ HRESULT GetSupportedProperties(
+ _In_ IPortableDeviceKeyCollection* pKeys);
+
+ HRESULT WriteValues(
+ _In_ IPortableDeviceValues* pValues,
+ _In_ IPortableDeviceValues* pResults,
+ _Out_ bool* pbObjectChanged);
+
+private:
+ void UpdateVersion();
+
+public:
+ // Custom properties defined by the contacts service
+ CAtlStringW FamilyName;
+ CAtlStringW GivenName;
+
+private:
+ // Indicates whether the object has been updated
+ DWORD VersionIdentifier;
+};
+
+HRESULT GetSupportedContactProperties(
+ _In_ IPortableDeviceKeyCollection* pKeys);
+
+HRESULT GetContactPropertyAttributes(
+ _In_ REFPROPERTYKEY Key,
+ _In_ IPortableDeviceValues* pAttributes);