|
1 /* |
|
2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: A store property implementation class for the stores |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVPBKCONTACTSTOREPROPERTIES_H |
|
21 #define CVPBKCONTACTSTOREPROPERTIES_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <mvpbkcontactstoreproperties.h> |
|
26 |
|
27 |
|
28 // FORWARD DECLARATION |
|
29 class TVPbkContactStoreProperties2; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * A store property implementation class for the stores |
|
35 * |
|
36 * @lib VPbkEng.lib |
|
37 */ |
|
38 class CVPbkContactStoreProperties : |
|
39 public CBase, |
|
40 public MVPbkContactStoreProperties |
|
41 { |
|
42 public: // Types |
|
43 /// Flags for boolean properties |
|
44 enum TPropertyFlag |
|
45 { |
|
46 EPropertyReadOnly = 0x00000001, |
|
47 EPropertyPersistent = 0x00000002, |
|
48 EPropertyLocal = 0x00000004, |
|
49 EPropertyRemovable = 0x00000008, |
|
50 EPropertyFieldLabelSupported = 0x00000010, |
|
51 EPropertyDefaultsSupported = 0x00000020, |
|
52 EPropertyVoiceTagsSupported = 0x00000040, |
|
53 EPropertySpeedDialsSupported = 0x00000080, |
|
54 EPropertyContactGroupsSupported = 0x00000100, |
|
55 EPropertyOwnContactSupported = 0x00000200 |
|
56 }; |
|
57 |
|
58 public: // Constructors and destructor |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 * @return a new instance of this class |
|
62 */ |
|
63 IMPORT_C static CVPbkContactStoreProperties* NewL(); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 */ |
|
68 ~CVPbkContactStoreProperties(); |
|
69 |
|
70 public: // New functions |
|
71 |
|
72 /** |
|
73 * Sets the name of the store. Only a reference to the name is stored. |
|
74 * The reference must be valid for the lifetime of this object. |
|
75 * @param aName the name of the store |
|
76 */ |
|
77 IMPORT_C void SetName(const TVPbkContactStoreUriPtr& aName); |
|
78 |
|
79 /** |
|
80 * Sets supported fields of contact store. |
|
81 * @param aSupportedFields a list of field types that are supported |
|
82 * by the store. |
|
83 */ |
|
84 IMPORT_C void SetSupportedFields(const MVPbkFieldTypeList& aSupportedFields); |
|
85 |
|
86 /** |
|
87 * Sets the value of a boolean property. |
|
88 * @param aFlag the flag to set |
|
89 * @param aValue the boolean value for the flag |
|
90 */ |
|
91 IMPORT_C void SetBooleanProperty(TPropertyFlag aFlag, TBool aValue); |
|
92 |
|
93 /** |
|
94 * Sets the aServiceUid service UID to aValue. |
|
95 * @param aServiceUid a service UID that is mapped to a service. |
|
96 * @param aValue The property to set as the value for the service. |
|
97 */ |
|
98 IMPORT_C void SetServicePropertyL(TUid aServiceUid, TBool aValue); |
|
99 |
|
100 public: // from MVPbkContactStoreProperties |
|
101 TVPbkContactStoreUriPtr Name() const; |
|
102 TVPbkContactStoreUriPtr Uri() const; |
|
103 TBool ReadOnly() const; |
|
104 TBool Persistent() const; |
|
105 TBool Local() const; |
|
106 TBool Removable() const; |
|
107 TBool SupportsFieldLabels() const; |
|
108 TBool SupportsDefaults() const; |
|
109 TBool SupportsVoiceTags() const; |
|
110 TBool SupportsSpeedDials() const; |
|
111 TBool SupportsContactGroups() const; |
|
112 const MVPbkFieldTypeList& SupportedFields() const; |
|
113 TBool SupportsService(TUid aServiceUid) const; |
|
114 |
|
115 |
|
116 private: // Construction |
|
117 CVPbkContactStoreProperties(); |
|
118 |
|
119 void ConstructL(); |
|
120 |
|
121 public: // from MVPbkContactStoreProperties |
|
122 |
|
123 TAny* ContactStorePropertiesExtension( TUid aExtensionUid ); |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * Service table element. |
|
129 */ |
|
130 struct TServiceElement |
|
131 { |
|
132 /// Own: UID associated with a service |
|
133 TUid iServiceUid; |
|
134 /// Own: value of the service |
|
135 TBool iValue; |
|
136 }; |
|
137 |
|
138 private: // Data |
|
139 /// Ref: Store name, the store name descriptor is owned by the plugin |
|
140 TVPbkContactStoreUriPtr iUriName; |
|
141 /// Own: Boolean flags |
|
142 TUint32 iFlags; |
|
143 /// Own: Number of supported digits in phone number matching |
|
144 TInt iMaxNumberMatchDigits; |
|
145 /// Ref: List of supported fields |
|
146 const MVPbkFieldTypeList* iSupportedFields; |
|
147 /// Own: Service property map |
|
148 RArray<TServiceElement> iServiceTable; |
|
149 /// Own: Extended properties |
|
150 TVPbkContactStoreProperties2* iExtension2; |
|
151 }; |
|
152 |
|
153 #endif // CVPBKCONTACTSTOREPROPERTIES_H |
|
154 |
|
155 // End of File |