|
1 /* |
|
2 * Copyright (c) 2002-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: An attribute class for contact defaults. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVPBKDEFAULTATTRIBUTE_H |
|
20 #define CVPBKDEFAULTATTRIBUTE_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <MVPbkContactAttribute.h> |
|
25 #include <MVPbkContactAttributeManager.h> |
|
26 #include <VPbkPublicUid.h> |
|
27 #include <VPbkFieldType.hrh> |
|
28 |
|
29 |
|
30 // CLASS DECLARATIONS |
|
31 /** |
|
32 * Virtual Phonebook default attribute for contacts. |
|
33 * Responsible for encapsulating the default attribute management for |
|
34 * contacts. |
|
35 * |
|
36 * The supported default types are declared in TVPbkDefaultType. |
|
37 */ |
|
38 class CVPbkDefaultAttribute : |
|
39 public CBase, |
|
40 public MVPbkContactAttribute |
|
41 { |
|
42 public: // static data |
|
43 /** |
|
44 * KDefaultTypeNotDefined. |
|
45 */ |
|
46 static const TVPbkDefaultType KDefaultTypeNotDefined = EVPbkDefaultTypeUndefined; |
|
47 |
|
48 /** |
|
49 * Returns the unique identifier associate with the default attribute. |
|
50 * |
|
51 * @return Default attribute implementation uid. |
|
52 */ |
|
53 inline static TUid Uid() { return TUid::Uid(KVPbkDefaultAttributeImplementationUID); } |
|
54 |
|
55 public: // constructor and destructor |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * |
|
59 * @param aType New default's type. |
|
60 * @return New instance of this class. |
|
61 */ |
|
62 IMPORT_C static CVPbkDefaultAttribute* NewL( |
|
63 TVPbkDefaultType aType); |
|
64 |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 * Default type will be initialised to EVPbkDefaultTypeUndefined. |
|
68 * |
|
69 * @return New instance of this class. |
|
70 */ |
|
71 IMPORT_C static CVPbkDefaultAttribute* NewL(); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 ~CVPbkDefaultAttribute(); |
|
77 |
|
78 public: // interface |
|
79 /** |
|
80 * Set default type. |
|
81 * |
|
82 * @param aType New default's type |
|
83 */ |
|
84 IMPORT_C void SetDefaultType(TVPbkDefaultType aType); |
|
85 |
|
86 /** |
|
87 * Returns default's type. |
|
88 * |
|
89 * @return Default's type. |
|
90 */ |
|
91 IMPORT_C TVPbkDefaultType DefaultType() const; |
|
92 |
|
93 public: // from MVPbkContactAttribute |
|
94 TUid AttributeType() const; |
|
95 MVPbkContactAttribute* CloneLC() const; |
|
96 |
|
97 private: // implementation |
|
98 CVPbkDefaultAttribute(); |
|
99 |
|
100 private: // Data |
|
101 /// Own: Default's type |
|
102 TVPbkDefaultType iDefaultType; |
|
103 }; |
|
104 |
|
105 #endif // CVPBKDEFAULTATTRIBUTE_H |
|
106 |
|
107 // End of File |