|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CMSPRESENCEDATA__ |
|
21 #define __CMSPRESENCEDATA__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <s32std.h> |
|
25 #include "cmscontactbase.h" |
|
26 #include "cmscontactfield.h" |
|
27 #include "cmscontactfielditem.h" |
|
28 |
|
29 enum TCmsIconData |
|
30 { |
|
31 ECmsIcon = 0, |
|
32 ECmsIconMask |
|
33 }; |
|
34 |
|
35 _LIT8( KDefaultVoipApplicationId, "xsp" ); |
|
36 |
|
37 class CFbsBitmap; |
|
38 class CBSFactory; |
|
39 class RCmsContact; |
|
40 class CCmsContactFieldItem; |
|
41 class MBSAccess; |
|
42 class TSize; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 class CCmsPresenceData : public CCmsContactFieldItem |
|
46 { |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Get the contact field data. |
|
51 * |
|
52 * @return TPtrC contact field data. May be zero length especially when public traffic light |
|
53 */ |
|
54 IMPORT_C TPtrC8 UserIdentity() const; |
|
55 |
|
56 /** |
|
57 * Get the mask of the presence icon |
|
58 * |
|
59 * @return mask of the presence icon |
|
60 */ |
|
61 IMPORT_C CFbsBitmap* Mask() const; |
|
62 |
|
63 /** |
|
64 * Get the bitmap of the presence icon |
|
65 * |
|
66 * @return bitmap of the presence icon |
|
67 */ |
|
68 IMPORT_C CFbsBitmap* Bitmap() const; |
|
69 |
|
70 /** |
|
71 * Get branded status text |
|
72 * |
|
73 * @return branded status text |
|
74 */ |
|
75 IMPORT_C TPtrC BrandedText() const; |
|
76 |
|
77 /** |
|
78 * Get the type of this presence |
|
79 * |
|
80 * @return TUint32. Refer to CCmsContactFieldItem::TCmsContactNotification. |
|
81 */ |
|
82 IMPORT_C TUint32 ServiceType() const; |
|
83 |
|
84 /** |
|
85 * Get the type of this presence |
|
86 * |
|
87 * @param aBitmapSize size of the returned bitmap |
|
88 * @return error code |
|
89 */ |
|
90 IMPORT_C TInt PreparePresenceDataL( TSize aBitmapSize ); |
|
91 |
|
92 /** |
|
93 * Destructor |
|
94 */ |
|
95 IMPORT_C virtual ~CCmsPresenceData(); |
|
96 |
|
97 public: |
|
98 |
|
99 /** |
|
100 * Symbian constructor |
|
101 * |
|
102 * @param RCmsContact& Handle to the client-side contact |
|
103 * @return CCmsPresenceIcon* New instance |
|
104 */ |
|
105 static CCmsPresenceData* NewL( RCmsContact& aContact ); |
|
106 |
|
107 /** |
|
108 * Append a data field |
|
109 * |
|
110 * @param const TDesC8& Data descriptor |
|
111 * @return CCmsPresenceData::TPresenceDataField Type of the data |
|
112 */ |
|
113 void AssignDataL( TInt aFieldType, const TDesC8& aFieldData ); |
|
114 |
|
115 /** |
|
116 * Append a data field |
|
117 * |
|
118 * @param const TDesC8& Data descriptor |
|
119 * @return CCmsPresenceData::TPresenceDataField Type of the data |
|
120 */ |
|
121 CFbsBitmap* CopyBitmapL( CFbsBitmap& aBitmap ); |
|
122 |
|
123 private: |
|
124 |
|
125 /** |
|
126 * C++ constructor is private |
|
127 * |
|
128 * @param RCmsContact& Handle to the client-side contact |
|
129 * @return CCmsPresenceIcon |
|
130 */ |
|
131 CCmsPresenceData( RCmsContact& aContact ); |
|
132 |
|
133 /** |
|
134 * Symbian OS second-phase constructor |
|
135 * |
|
136 * @return void |
|
137 */ |
|
138 void ConstructL(); |
|
139 |
|
140 /** |
|
141 * Symbian OS second-phase constructor |
|
142 * |
|
143 * @return void |
|
144 */ |
|
145 TPtrC8 ElementIdImage(); |
|
146 |
|
147 /** |
|
148 * Symbian OS second-phase constructor |
|
149 * |
|
150 * @return void |
|
151 */ |
|
152 CBSFactory* CreateBrandingFactoryL(); |
|
153 |
|
154 /** |
|
155 * Retreives the icon from the presencetrafficlights.mif |
|
156 * @param aBitmapSize - Bitmap Size |
|
157 */ |
|
158 TInt DoGetIconFromFileL( TSize aBitmapSize ); |
|
159 |
|
160 /** |
|
161 * Retreives the icon from the Branding Server |
|
162 * @param aFactory - Branding Server Factory object |
|
163 * @param aBitmapSize - Bitmap Size |
|
164 * @param aLanguageId - Language for which Brand is requested |
|
165 * @return ErrCode |
|
166 */ |
|
167 TInt DoGetIconFromBrandSrvL( CBSFactory& aFactory, TSize aBitmapSize, TLanguage aLanguage ); |
|
168 |
|
169 /** |
|
170 * Retreives the icon from the Branding Server |
|
171 * @param aFactory - Branding Server Factory object |
|
172 * @param aBitmapSize - Bitmap Size |
|
173 * @return ErrCode |
|
174 */ |
|
175 TInt DoGetIconFromBrandSrvL( CBSFactory& aFactory, TSize aBitmapSize ); |
|
176 |
|
177 private: //Data |
|
178 |
|
179 TInt iLanguageId; |
|
180 HBufC* iBrandedText; |
|
181 HBufC8* iUserIdentity; |
|
182 HBufC8* iBrandId; |
|
183 HBufC8* iElementIdText; |
|
184 HBufC8* iElementIdImage; |
|
185 CFbsBitmap* iMask; |
|
186 CFbsBitmap* iBitmap; |
|
187 RCmsContact& iContact; |
|
188 TInt iServiceType; |
|
189 }; |
|
190 |
|
191 #endif //__CMSPRESENCEDATA__ |
|
192 |
|
193 |
|
194 // End of File |