|
1 /* |
|
2 * Copyright (c) 2005 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: Attribute list model implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGATTRIBUTELISTMODEL_H__ |
|
19 #define __CPENGATTRIBUTELISTMODEL_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include "MPEngAttributeList2.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MPEngPresenceAttrManager; |
|
27 |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Attribute list model |
|
33 * |
|
34 * @lib PEngListLib2 |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CPEngAttributeListModel ): public CBase, |
|
38 public MPEngAttributeList2 |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 static CPEngAttributeListModel* NewL( |
|
45 MPEngPresenceAttrManager* aAttributeManager ); |
|
46 |
|
47 static CPEngAttributeListModel* NewLC( |
|
48 MPEngPresenceAttrManager* aAttributeManager ); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CPEngAttributeListModel* NewL( |
|
54 MPEngPresenceAttrManager* aAttributeManager, |
|
55 const RArray<TUint32>& aPresenceAttributes ); |
|
56 |
|
57 static CPEngAttributeListModel* NewLC( |
|
58 MPEngPresenceAttrManager* aAttributeManager, |
|
59 const RArray<TUint32>& aPresenceAttributes ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 ~CPEngAttributeListModel(); |
|
65 |
|
66 |
|
67 public: // From MPEngAttributeList2 |
|
68 |
|
69 /** |
|
70 * Adds a presence attribute into the attribute list. |
|
71 * @see <MPEngAttributeList2.h> |
|
72 */ |
|
73 void AddPresenceAttributeL( TUint32 aPresenceAttribute ); |
|
74 |
|
75 |
|
76 /** |
|
77 * Removes the presence attribute from the attribute list. |
|
78 * @see <MPEngAttributeList2.h> |
|
79 */ |
|
80 TInt RemovePresenceAttribute( TUint32 aPresenceAttribute ); |
|
81 |
|
82 |
|
83 /** |
|
84 * Removes all presence attributes from the attribute list |
|
85 * @see <MPEngAttributeList2.h> |
|
86 */ |
|
87 void RemoveAllAttributes(); |
|
88 |
|
89 |
|
90 /** |
|
91 * Checks is the presence attribute valid and can it be added |
|
92 * @see <MPEngAttributeList2.h> |
|
93 */ |
|
94 TInt ConfirmPresenceAttribute( TUint32 aPresenceAttribute ) const; |
|
95 |
|
96 |
|
97 /** |
|
98 * Current set of presence attributes in the attribute list. |
|
99 * @see <MPEngAttributeList2.h> |
|
100 */ |
|
101 TArray<TUint32> ListOfAttributes() const; |
|
102 |
|
103 |
|
104 |
|
105 /** |
|
106 * Generic attribute list extension interface. |
|
107 * @see <MPEngAttributeList2.h> |
|
108 * @since 3.0 |
|
109 */ |
|
110 MPEngAttributeListExt2* Extension() |
|
111 { |
|
112 return NULL; |
|
113 } |
|
114 |
|
115 /** |
|
116 * Presence Engine internal attribute list interface. |
|
117 * @see <MPEngAttributeList2.h> |
|
118 * @since 3.0 |
|
119 */ |
|
120 const MPEngAdvancedAttributeList2* Advanced() const |
|
121 { |
|
122 return NULL; |
|
123 } |
|
124 |
|
125 MPEngAdvancedAttributeList2* Advanced() |
|
126 { |
|
127 return NULL; |
|
128 } |
|
129 |
|
130 |
|
131 /** |
|
132 * Close reference to the object |
|
133 * |
|
134 * @since 3.0 |
|
135 */ |
|
136 void Close(); |
|
137 |
|
138 |
|
139 public: // New functions |
|
140 |
|
141 /** |
|
142 * Reference to the array of the attributes |
|
143 * |
|
144 * @since 3.0 |
|
145 * @return array of presence attributes |
|
146 */ |
|
147 const RArray<TUint32>& PresenceAttributes() const; |
|
148 |
|
149 |
|
150 private: // constructors |
|
151 |
|
152 /** |
|
153 * Symbian constructor. |
|
154 */ |
|
155 void ConstructL( const RArray<TUint32>& aPresenceAttributes ); |
|
156 |
|
157 /** |
|
158 * C++ constructor. |
|
159 */ |
|
160 CPEngAttributeListModel( MPEngPresenceAttrManager* aAttributeManager ); |
|
161 |
|
162 |
|
163 private: // Data |
|
164 |
|
165 /// OWN: List of presence attributes |
|
166 RArray<TUint32> iListOfAttributes; |
|
167 |
|
168 /// REF: Attribute manager |
|
169 MPEngPresenceAttrManager* iAttributeManager; |
|
170 |
|
171 }; |
|
172 |
|
173 #endif // __CPENGATTRIBUTELISTMODEL_H__ |
|
174 |
|
175 // End of File |
|
176 |