|
1 /* |
|
2 * Copyright (c) 2004 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: WV Status content attribute implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPENGWVSTATUSCONTENTMODEL_H |
|
19 #define CPENGWVSTATUSCONTENTMODEL_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "CPEngWVAttributeConstructBase.h" |
|
23 #include "CPEngWVAttributeModelBase.h" |
|
24 #include "CPEngMyLogoConverter.h" |
|
25 |
|
26 #include <PEngWVPresenceAttributes2.h> |
|
27 #include <E32Base.h> |
|
28 |
|
29 |
|
30 |
|
31 //FORWARD DECLARATION |
|
32 class T_CWVStatusContentModel; |
|
33 |
|
34 |
|
35 /** |
|
36 * WV Status content attribute implementation. |
|
37 * |
|
38 * @lib PEngAttrLib |
|
39 * @since 3.0 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CPEngWVStatusContentModel ): public CPEngWVAttributeModelBase, |
|
42 public MPEngMyLogoConversionObserver |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CPEngWVStatusContentModel(); |
|
50 |
|
51 |
|
52 /** |
|
53 * C++ constructor. |
|
54 */ |
|
55 CPEngWVStatusContentModel( TBool aUserOwnAttribute ); |
|
56 |
|
57 |
|
58 public: // From MPEngPresenceAttrModelTypeImp |
|
59 |
|
60 |
|
61 /** |
|
62 * From MPEngPresenceAttrModelTypeImp. |
|
63 */ |
|
64 TBool GetData( TInt* aIntData, |
|
65 TPtrC8* a8Data, |
|
66 TPtrC16* a16Data, |
|
67 TInt aField, |
|
68 TInt aGroup ) const; |
|
69 |
|
70 TBool SetDataL( TInt* aIntData, |
|
71 const TDesC8* a8Data, |
|
72 const TDesC16* a16Data, |
|
73 TInt aField, |
|
74 TInt aGroup ); |
|
75 |
|
76 TBool SetDataAsyncL( const TDesC8* a8Data, |
|
77 const TDesC16* a16Data, |
|
78 TRequestStatus& aRequestStatus, |
|
79 TInt aField, |
|
80 TInt aGroup ); |
|
81 |
|
82 void CancelSetDataAsync(); |
|
83 |
|
84 void EncodeDataToXmlL( MPEngXMLSerializer& aSerializer ) const; |
|
85 |
|
86 void DecodeDataFromXmlL( MPEngXMLParser& aParser, |
|
87 const TDesC8& aValueBlock ); |
|
88 |
|
89 void ResetDataL(); |
|
90 TInt DataExternalizeSize() const; |
|
91 void ExternalizeDataL( RWriteStream& aStream ) const; |
|
92 void InternalizeDataL( RReadStream& aStream ); |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 private: // MPEngMyLogoConversionObserver |
|
98 |
|
99 void HandleNewMyLogo( HBufC8* aImageData, |
|
100 HBufC8* aImageMimeType, |
|
101 HBufC* aImageSoureFileName ); |
|
102 void HandleConverterDestroy(); |
|
103 |
|
104 private: // Helper |
|
105 |
|
106 void CheckReceivedStatusContentL(); |
|
107 |
|
108 |
|
109 |
|
110 private: //Friend declaration |
|
111 |
|
112 |
|
113 /** |
|
114 * Unit test class is friend so it can access members. |
|
115 */ |
|
116 friend class T_CWVStatusContentModel; // CSI: 36 # |
|
117 |
|
118 |
|
119 private: //Data |
|
120 |
|
121 |
|
122 //OWN: MyLogo status content data. |
|
123 HBufC8* iMyLogoData; |
|
124 |
|
125 //OWN: MyLogo status content mime type. |
|
126 HBufC8* iMyLogoMimeType; |
|
127 |
|
128 //OWN: MyLogo status source file name. |
|
129 HBufC* iMyLogoSoureFileName; |
|
130 |
|
131 |
|
132 //OWN: Raw status content data from network. |
|
133 HBufC8* iStatusContentNW; |
|
134 |
|
135 //OWN: Asynchronous MyLogo converter, lazy initialized |
|
136 CPEngMyLogoConverter* iMyLogoConverter; |
|
137 |
|
138 }; |
|
139 |
|
140 |
|
141 #endif //CPENGWVSTATUSCONTENTMODEL_H |
|
142 |
|
143 // End of File |
|
144 |