|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * imps common group props class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "impsgroupprops.h" |
|
22 #include "impsgrouppropsint.h" |
|
23 |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 // --------------------------------------------------------- |
|
27 // CImpsCommonGroupPropsInt::CImpsCommonGroupPropsInt |
|
28 // --------------------------------------------------------- |
|
29 // |
|
30 CImpsCommonGroupPropsInt::CImpsCommonGroupPropsInt() |
|
31 : CImpsCommonGroupProps() |
|
32 { |
|
33 |
|
34 } |
|
35 |
|
36 |
|
37 // --------------------------------------------------------- |
|
38 // CImpsCommonGroupPropsInt::NewL |
|
39 // --------------------------------------------------------- |
|
40 // |
|
41 EXPORT_C CImpsCommonGroupPropsInt* CImpsCommonGroupPropsInt::NewL() |
|
42 { |
|
43 CImpsCommonGroupPropsInt* self = new ( ELeave ) CImpsCommonGroupPropsInt; |
|
44 CleanupStack::PushL( self ); |
|
45 self->ConstructL(); |
|
46 CleanupStack::Pop(); |
|
47 return self; |
|
48 } |
|
49 |
|
50 // --------------------------------------------------------- |
|
51 // CImpsCommonGroupPropsInt::~CImpsCommonGroupPropsInt |
|
52 // --------------------------------------------------------- |
|
53 // |
|
54 CImpsCommonGroupPropsInt::~CImpsCommonGroupPropsInt() |
|
55 { |
|
56 Reset(); |
|
57 } |
|
58 |
|
59 // Symbian OS default constructor can leave. |
|
60 void CImpsCommonGroupPropsInt::ConstructL() |
|
61 { |
|
62 Reset( ); |
|
63 } |
|
64 |
|
65 // --------------------------------------------------------- |
|
66 // CImpsCommonGroupPropsInt::Reset |
|
67 // --------------------------------------------------------- |
|
68 // |
|
69 EXPORT_C void CImpsCommonGroupPropsInt::Reset() |
|
70 { |
|
71 CImpsCommonGroupProps::Reset(); |
|
72 iTypePublic = EImpsPropUndef; // type public/private |
|
73 iNbrActive = EImpsPropUndef; // nbr of active users |
|
74 } |
|
75 |
|
76 // --------------------------------------------------------- |
|
77 // CImpsCommonGroupPropsInt::HasData |
|
78 // --------------------------------------------------------- |
|
79 // |
|
80 TBool CImpsCommonGroupPropsInt::HasData() const |
|
81 { |
|
82 if ( ( iAccessOpen != EImpsPropUndef ) || |
|
83 ( iTypePublic != EImpsPropUndef ) || |
|
84 ( iSearchable != EImpsPropUndef ) || |
|
85 ( iNbrActive >= 0 ) || |
|
86 ( iMaxUsers >= 0 ) || |
|
87 ( iName ) || |
|
88 ( iTopic ) || |
|
89 ( iWelcome ) || |
|
90 ( iPrivateMessages != EImpsPropUndef ) ) // from base class |
|
91 { |
|
92 return ETrue; |
|
93 } |
|
94 return EFalse; |
|
95 } |
|
96 |
|
97 |
|
98 // --------------------------------------------------------- |
|
99 // CImpsCommonGroupPropsInt::SetPublic |
|
100 // --------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C void CImpsCommonGroupPropsInt::SetPublic( |
|
103 TImpsPropertyBool aType ) |
|
104 { |
|
105 iTypePublic = aType; |
|
106 } |
|
107 |
|
108 // --------------------------------------------------------- |
|
109 // CImpsCommonGroupPropsInt::SetNbrOfUsers |
|
110 // --------------------------------------------------------- |
|
111 // |
|
112 EXPORT_C void CImpsCommonGroupPropsInt::SetNbrOfUsers( |
|
113 TInt aNbr ) |
|
114 { |
|
115 iNbrActive = aNbr; |
|
116 } |
|
117 |
|
118 |
|
119 // --------------------------------------------------------- |
|
120 // CImpsPrivateGroupPropsInt::CImpsPrivateGroupPropsInt |
|
121 // --------------------------------------------------------- |
|
122 // |
|
123 CImpsPrivateGroupPropsInt::CImpsPrivateGroupPropsInt() |
|
124 : CImpsPrivateGroupProps() |
|
125 { |
|
126 |
|
127 } |
|
128 |
|
129 // --------------------------------------------------------- |
|
130 // CImpsPrivateGroupPropsInt::NewL |
|
131 // --------------------------------------------------------- |
|
132 // |
|
133 EXPORT_C CImpsPrivateGroupPropsInt* CImpsPrivateGroupPropsInt::NewL() |
|
134 { |
|
135 CImpsPrivateGroupPropsInt* self = new (ELeave) CImpsPrivateGroupPropsInt; |
|
136 CleanupStack::PushL( self ); |
|
137 self->ConstructL(); |
|
138 CleanupStack::Pop(); |
|
139 return self; |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------- |
|
143 // CImpsPrivateGroupPropsInt::~CImpsPrivateGroupPropsInt |
|
144 // --------------------------------------------------------- |
|
145 // |
|
146 CImpsPrivateGroupPropsInt::~CImpsPrivateGroupPropsInt() |
|
147 { |
|
148 Reset(); |
|
149 } |
|
150 |
|
151 // Symbian OS default constructor can leave. |
|
152 void CImpsPrivateGroupPropsInt::ConstructL() |
|
153 { |
|
154 Reset( ); |
|
155 } |
|
156 |
|
157 // --------------------------------------------------------- |
|
158 // CImpsPrivateGroupPropsInt::Reset |
|
159 // --------------------------------------------------------- |
|
160 // |
|
161 EXPORT_C void CImpsPrivateGroupPropsInt::Reset() |
|
162 { |
|
163 CImpsPrivateGroupProps::Reset(); |
|
164 iMember = EImpsPropUndef; // Am i member |
|
165 iPrivilege = EImpsUserUndef; // privilege level |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------- |
|
169 // CImpsPrivateGroupPropsInt::SetMember |
|
170 // --------------------------------------------------------- |
|
171 // |
|
172 EXPORT_C void CImpsPrivateGroupPropsInt::SetMember( |
|
173 TImpsPropertyBool aValue ) |
|
174 { |
|
175 iMember = aValue; |
|
176 } |
|
177 |
|
178 // --------------------------------------------------------- |
|
179 // CImpsPrivateGroupPropsInt::SetPrivileges |
|
180 // --------------------------------------------------------- |
|
181 // |
|
182 EXPORT_C void CImpsPrivateGroupPropsInt::SetPrivileges( |
|
183 TImpsGroupUsers aValue ) |
|
184 { |
|
185 iPrivilege = aValue; |
|
186 } |
|
187 |
|
188 // --------------------------------------------------------- |
|
189 // CImpsPrivateGroupPropsInt::Size |
|
190 // --------------------------------------------------------- |
|
191 // |
|
192 TInt CImpsPrivateGroupPropsInt::Size() const |
|
193 { |
|
194 TInt sizeEntry = Align4( KImpsPackedPrivateProps ); |
|
195 sizeEntry += Align4( KImpsPackedProps ); |
|
196 |
|
197 // Notice: update this always when class definition changes |
|
198 TInt sizeStrings = 0; |
|
199 |
|
200 TInt size = sizeEntry + sizeStrings; |
|
201 |
|
202 // no arrays |
|
203 |
|
204 return size; |
|
205 } |
|
206 |
|
207 |
|
208 // ================= OTHER EXPORTED FUNCTIONS ============== |
|
209 |
|
210 |
|
211 // End of File |
|
212 |