|
1 /* |
|
2 * Copyright (c) 2008 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: Dynamic soft notification data store |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef AKNDYNAMICSOFTNOTIFICATIONDATA_H |
|
19 #define AKNDYNAMICSOFTNOTIFICATIONDATA_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <vwsdef.h> // For view server definitions |
|
24 #include <aknnotedialog.h> // For CAknNoteDialog::TTone |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Dynamic soft notification data store. |
|
30 * |
|
31 * @lib AknNotifyPlugin.lib |
|
32 * @since S60 3.2 |
|
33 */ |
|
34 NONSHARABLE_CLASS( CAknDynamicNotificationData ) : public CBase |
|
35 { |
|
36 public: // constructor |
|
37 |
|
38 /** |
|
39 * Static constructor. Construct data from stream. |
|
40 * @param aStream Source stream. |
|
41 * @return New CAknDynamicNotificationData instance. |
|
42 */ |
|
43 static CAknDynamicNotificationData* NewL ( RReadStream& aStream ); |
|
44 |
|
45 /** |
|
46 * Static constructor. Construct data from stream. |
|
47 * @param aStream Source stream. |
|
48 * @return New CAknDynamicNotificationData instance. |
|
49 */ |
|
50 static CAknDynamicNotificationData* NewLC( RReadStream& aStream ); |
|
51 |
|
52 /// Destructor. |
|
53 ~CAknDynamicNotificationData(); |
|
54 |
|
55 public: // new methods |
|
56 |
|
57 /** |
|
58 * Internalize data into stream. |
|
59 * @param aStream Destination stream. |
|
60 */ |
|
61 void InternalizeL( RReadStream& aStream ); |
|
62 |
|
63 /** |
|
64 * Externalize data from stream. |
|
65 * @param aStream Source stream. |
|
66 */ |
|
67 void ExternalizeL( RWriteStream& aStream ) const; |
|
68 |
|
69 /** |
|
70 * Reset the Id of the soft notification. |
|
71 * @param aId New id of the notification. |
|
72 */ |
|
73 void SetId( TInt aId ); |
|
74 |
|
75 /** |
|
76 * @return Notification identification. |
|
77 */ |
|
78 TInt Id() const; |
|
79 |
|
80 /** |
|
81 * @return Notification priority. |
|
82 */ |
|
83 TInt Priority() const; |
|
84 |
|
85 /** |
|
86 * @return Notification tone. |
|
87 */ |
|
88 CAknNoteDialog::TTone Tone() const; |
|
89 |
|
90 /** |
|
91 * @return Destination view when note is accepted. |
|
92 */ |
|
93 TVwsViewId ViewId() const; |
|
94 |
|
95 /** |
|
96 * @return Destination view when note is accepted. When note count is > 1. |
|
97 */ |
|
98 TVwsViewId PluralViewId() const; |
|
99 |
|
100 /** |
|
101 * @return Custom data uid for launched view. |
|
102 */ |
|
103 TUid CustomMsgUid() const; |
|
104 |
|
105 /** |
|
106 * @return Custom data for launched view. |
|
107 */ |
|
108 const TDesC8& CustomMsg() const; |
|
109 |
|
110 /** |
|
111 * @return Left softkey text. |
|
112 */ |
|
113 const TDesC& LeftSoftkey() const; |
|
114 |
|
115 /** |
|
116 * @return Right softkey text. |
|
117 */ |
|
118 const TDesC& RightSoftkey() const; |
|
119 |
|
120 /** |
|
121 * @return Text shown when count == 1. |
|
122 */ |
|
123 const TDesC& SingularLabel() const; |
|
124 |
|
125 /** |
|
126 * @return Text shown when count > 1. |
|
127 */ |
|
128 const TDesC& PluralLabel() const; |
|
129 |
|
130 /** |
|
131 * @return Text shown when count == 1. Only in grouped view. |
|
132 */ |
|
133 const TDesC& SingularLabelGroup() const; |
|
134 |
|
135 /** |
|
136 * @return Text shown when count > 1. Only in grouped view. |
|
137 */ |
|
138 const TDesC& PluralLabelGroup() const; |
|
139 |
|
140 /** |
|
141 * @return Flag whether the user events are wanted by the event manager. |
|
142 */ |
|
143 TBool EnableObserver() const; |
|
144 |
|
145 /** |
|
146 * @return Binary data for notification image. |
|
147 */ |
|
148 const TDesC8& ImageData() const; |
|
149 |
|
150 private: // new methods |
|
151 CAknDynamicNotificationData(); |
|
152 void ConstructL( RReadStream& aStream ); |
|
153 |
|
154 void ResetContent(); |
|
155 |
|
156 HBufC8* InternalizeText8L( RReadStream& aStream ) const; |
|
157 HBufC16* InternalizeText16L( RReadStream& aStream ) const; |
|
158 |
|
159 void ExternalizeTextL( RWriteStream& aStream, const TDesC16* aText ) const; |
|
160 void ExternalizeTextL( RWriteStream& aStream, const TDesC8* aText ) const; |
|
161 |
|
162 protected: // data |
|
163 |
|
164 /// Identification of the note. |
|
165 TInt iNoteId; |
|
166 /// Priority of the note (see AknSoftNotificationPlugin.cpp). |
|
167 TInt iPriority; |
|
168 /// Tone played when note is shown. |
|
169 CAknNoteDialog::TTone iTone; |
|
170 /// Flag whether the user events are wanted by the event manager. |
|
171 TBool iEnableObserver; |
|
172 |
|
173 |
|
174 /// Launched view when count == 1. |
|
175 TVwsViewId iViewId; |
|
176 /// Launched view when count > 1. |
|
177 TVwsViewId iPluralViewId; |
|
178 /// Uid for the new view. |
|
179 TUid iCustomMessageId; |
|
180 /// Own. Custom message for new view. |
|
181 HBufC8* iCustomMessage; |
|
182 |
|
183 /// Own. Left softkey. |
|
184 HBufC* iLeftSoftkey; |
|
185 /// Own. Right softkey. |
|
186 HBufC* iRightSoftkey; |
|
187 |
|
188 /// Own. Single non-group label. |
|
189 HBufC* iNoteSingularLabel; |
|
190 /// Own. Plural non-group label. |
|
191 HBufC* iNotePluralLabel; |
|
192 /// Own. Single group label. |
|
193 HBufC* iGroupSingularLabel; |
|
194 /// Own. Plural group label. |
|
195 HBufC* iGroupPluralLabel; |
|
196 |
|
197 /// Own. Image data. |
|
198 HBufC8* iImageData; |
|
199 }; |
|
200 |
|
201 #endif // AKNDYNAMICSOFTNOTIFICATIONDATA_H |