williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002 - 2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*/
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#if !defined(__AKNMESSAGEQUERYDIALOG_H__)
|
williamr@2
|
21 |
#define __AKNMESSAGEQUERYDIALOG_H__
|
williamr@2
|
22 |
|
williamr@4
|
23 |
#include <AknQueryDialog.h>
|
williamr@2
|
24 |
class CEikImage;
|
williamr@2
|
25 |
class CAknMessageQueryDialogExtension;
|
williamr@2
|
26 |
|
williamr@2
|
27 |
_LIT( KOpeningLinkTag, "<AknMessageQuery Link>" );
|
williamr@2
|
28 |
_LIT( KClosingLinkTag, "</AknMessageQuery Link>" );
|
williamr@2
|
29 |
_LIT( KOpeningBoldTag, "<AknMessageQuery Bold>" );
|
williamr@2
|
30 |
_LIT( KClosingBoldTag, "</AknMessageQuery Bold>" );
|
williamr@2
|
31 |
|
williamr@2
|
32 |
|
williamr@2
|
33 |
/**
|
williamr@2
|
34 |
* Message query dialog.
|
williamr@2
|
35 |
*
|
williamr@2
|
36 |
* The dialog contains text that can be scrolled page by page.
|
williamr@2
|
37 |
*
|
williamr@2
|
38 |
* If you want to use links and/or bold text among message you
|
williamr@2
|
39 |
* must use @c SetMessageTextL method. Formatting text does not
|
williamr@2
|
40 |
* work through resource file. If there are incorrect/misplaced
|
williamr@2
|
41 |
* tags or tags are within each other, dialog will leave.
|
williamr@2
|
42 |
*/
|
williamr@2
|
43 |
class CAknMessageQueryDialog : public CAknQueryDialog
|
williamr@2
|
44 |
{
|
williamr@2
|
45 |
|
williamr@2
|
46 |
public:
|
williamr@2
|
47 |
|
williamr@2
|
48 |
/**
|
williamr@2
|
49 |
* Two-phased constructor.
|
williamr@2
|
50 |
*
|
williamr@2
|
51 |
* @param aMessage Text for the dialog.
|
williamr@2
|
52 |
* @param aTone=ENoTone Tone played by the dialog.
|
williamr@2
|
53 |
*/
|
williamr@2
|
54 |
IMPORT_C static CAknMessageQueryDialog* NewL(TDesC& aMessage,
|
williamr@2
|
55 |
const TTone& aTone = ENoTone);
|
williamr@2
|
56 |
|
williamr@2
|
57 |
/**
|
williamr@2
|
58 |
* Destructor.
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
IMPORT_C ~CAknMessageQueryDialog();
|
williamr@2
|
61 |
|
williamr@2
|
62 |
/**
|
williamr@2
|
63 |
* C++ default constructor.
|
williamr@2
|
64 |
*
|
williamr@2
|
65 |
* @param aTone Tone played with the dialog.
|
williamr@2
|
66 |
*/
|
williamr@2
|
67 |
IMPORT_C CAknMessageQueryDialog(const TTone aTone);
|
williamr@2
|
68 |
|
williamr@2
|
69 |
public:
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
* Sets message text. If you have links in your message you can mark
|
williamr@2
|
73 |
* link texts between tags @c <AknMessageQuery Link> and
|
williamr@2
|
74 |
* @c </AknMessageQuery Link> in the message text. For links see also @c SetLink.
|
williamr@2
|
75 |
* Bold text can be achieved using tags @c <AknMessageQuery Bold> and @c </AknMessageQuery Bold>
|
williamr@2
|
76 |
*
|
williamr@2
|
77 |
* @param aMessage Message text inside query. Insert '\\n' to get new line.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
IMPORT_C void SetMessageTextL(const TDesC& aMessage);
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
* Sets header text.
|
williamr@2
|
83 |
*
|
williamr@2
|
84 |
* @param aHeader Message query header text
|
williamr@2
|
85 |
* @deprecated - use @c Heading() + @c CAknPopupHeadingPane API instead
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
IMPORT_C void SetHeaderTextL(const TDesC& aHeader);
|
williamr@2
|
88 |
|
williamr@2
|
89 |
/**
|
williamr@2
|
90 |
* @deprecated - use tags within text instead.
|
williamr@2
|
91 |
*
|
williamr@2
|
92 |
* Changes the first occurance of @c aLinkText to a link
|
williamr@2
|
93 |
* within the Message. If you have many links with the same name,
|
williamr@2
|
94 |
* the method will set the links in the order you call them.
|
williamr@2
|
95 |
* Before you set a new link you have to bind the
|
williamr@2
|
96 |
* previous one with a callback by calling @c SetLink() function.
|
williamr@2
|
97 |
*
|
williamr@2
|
98 |
* Note that you don't have to call this function if you have already
|
williamr@2
|
99 |
* marked your links between tags @c <AknMessageQuery Link> and
|
williamr@2
|
100 |
* @c </AknMessageQuery Link> in the Message. In that
|
williamr@2
|
101 |
* case only @c SetLink() method is used.
|
williamr@2
|
102 |
*
|
williamr@2
|
103 |
* @since S60 2.8
|
williamr@2
|
104 |
* @param aLinkText Link text inside message.
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
IMPORT_C void SetLinkTextL(const TDesC& aLinkText);
|
williamr@2
|
107 |
|
williamr@2
|
108 |
/**
|
williamr@2
|
109 |
* Binds a callback to your link so that the dialog knows
|
williamr@2
|
110 |
* which callback to call when a link is activated by the user.
|
williamr@2
|
111 |
*
|
williamr@2
|
112 |
* @since S60 2.8
|
williamr@2
|
113 |
* @param aCallBack Points to function which is executed when a link is
|
williamr@2
|
114 |
* activated by a user.
|
williamr@2
|
115 |
*/
|
williamr@2
|
116 |
IMPORT_C void SetLink(TCallBack& aCallBack);
|
williamr@2
|
117 |
|
williamr@2
|
118 |
public: // from CCoeControl
|
williamr@2
|
119 |
|
williamr@2
|
120 |
/**
|
williamr@2
|
121 |
* From @c CCoeControl.
|
williamr@2
|
122 |
*
|
williamr@2
|
123 |
* Handles key events.
|
williamr@2
|
124 |
*
|
williamr@2
|
125 |
* If a control wishes to process key events, it should implement this
|
williamr@2
|
126 |
* function. The implementation must ensure that the function returns
|
williamr@2
|
127 |
* @c EKeyWasNotConsumed if it does not do anything in response to a
|
williamr@2
|
128 |
* key event, otherwise, other controls or dialogs may be prevented
|
williamr@2
|
129 |
* from receiving the key event. If it is able to process the event it
|
williamr@2
|
130 |
* should return @c EKeyWasConsumed.
|
williamr@2
|
131 |
*
|
williamr@2
|
132 |
* @param aKeyEvent The key event.
|
williamr@2
|
133 |
* @param aType The type of key event: @c EEventKey, @c EEventKeyUp or
|
williamr@2
|
134 |
* @c EEventKeyDown.
|
williamr@2
|
135 |
* @return Indicates whether or not the key event was used
|
williamr@2
|
136 |
* by this control.
|
williamr@2
|
137 |
*/
|
williamr@2
|
138 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
|
williamr@2
|
139 |
TEventCode);
|
williamr@2
|
140 |
|
williamr@2
|
141 |
/**
|
williamr@2
|
142 |
* From @c CCoeControl.
|
williamr@2
|
143 |
*
|
williamr@2
|
144 |
* Handles pointer events
|
williamr@2
|
145 |
*
|
williamr@2
|
146 |
* @param aPointerEvent The pointer event.
|
williamr@2
|
147 |
*/
|
williamr@2
|
148 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
149 |
|
williamr@2
|
150 |
protected: // from CEikDialog
|
williamr@2
|
151 |
|
williamr@2
|
152 |
/**
|
williamr@2
|
153 |
* From @c CEikDialog.
|
williamr@2
|
154 |
*
|
williamr@2
|
155 |
* Should be derived to perform pre-layout dialog initialisation.
|
williamr@2
|
156 |
*
|
williamr@2
|
157 |
* This function is called by the dialog framework before the dialog
|
williamr@2
|
158 |
* is sized and laid out. It may be overloaded to initialise the control
|
williamr@2
|
159 |
* values that should influence sizing and layout, the default
|
williamr@2
|
160 |
* implementation is empty.
|
williamr@2
|
161 |
*/
|
williamr@2
|
162 |
IMPORT_C virtual void PreLayoutDynInitL();
|
williamr@2
|
163 |
|
williamr@2
|
164 |
/**
|
williamr@2
|
165 |
* From @c CEikDialog
|
williamr@2
|
166 |
*
|
williamr@2
|
167 |
* Sets the size and position of the dialog.
|
williamr@2
|
168 |
*
|
williamr@2
|
169 |
* Positions the dialog in the centre of the screen by default.
|
williamr@2
|
170 |
*
|
williamr@2
|
171 |
* @param aSize Not used.
|
williamr@2
|
172 |
*/
|
williamr@2
|
173 |
IMPORT_C virtual void SetSizeAndPosition(const TSize& aSize);
|
williamr@2
|
174 |
|
williamr@2
|
175 |
/**
|
williamr@2
|
176 |
* From @c CEikDialog
|
williamr@2
|
177 |
*
|
williamr@2
|
178 |
* Not implemented.
|
williamr@2
|
179 |
*/
|
williamr@2
|
180 |
IMPORT_C virtual void PostLayoutDynInitL();
|
williamr@2
|
181 |
|
williamr@2
|
182 |
private:
|
williamr@2
|
183 |
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
* If the dialog does not have an extension create one.
|
williamr@2
|
186 |
*
|
williamr@2
|
187 |
* @since S60 2.8
|
williamr@2
|
188 |
*/
|
williamr@2
|
189 |
void CreateExtensionL();
|
williamr@2
|
190 |
|
williamr@2
|
191 |
/**
|
williamr@2
|
192 |
* Register/Unregister an observer to extendedinputcapabilities.
|
williamr@2
|
193 |
* Registering is done so that we can receive pointer events from edwin.
|
williamr@2
|
194 |
*
|
williamr@2
|
195 |
* @param aRegister, if true then registering, in other case unregister
|
williamr@2
|
196 |
* @since S60 3.2
|
williamr@2
|
197 |
*/
|
williamr@2
|
198 |
void RegisterPointerEventObserver( TBool aRegister );
|
williamr@2
|
199 |
|
williamr@2
|
200 |
/**
|
williamr@2
|
201 |
* @since S60 3.0
|
williamr@2
|
202 |
* With multiple link support
|
williamr@2
|
203 |
*/
|
williamr@2
|
204 |
TInt CountLinks() const;
|
williamr@2
|
205 |
TBool SetNextLinkTextLocationL(const TDesC* aLinkText); // for the non-marked links
|
williamr@2
|
206 |
|
williamr@2
|
207 |
void ParseMessageTxtL();
|
williamr@2
|
208 |
TBool GetNextTagL(TMsgQueryTag& aTag);
|
williamr@2
|
209 |
void SetMsgFormattingL(TMsgQueryTag aTag);
|
williamr@2
|
210 |
TBool TaggedMessageL();
|
williamr@2
|
211 |
TInt LinksInArray();
|
williamr@2
|
212 |
TInt LastLinkInArray();
|
williamr@2
|
213 |
|
williamr@2
|
214 |
/**
|
williamr@2
|
215 |
* Execute the current link. The link is dehighlighted after the execution.
|
williamr@2
|
216 |
* @return ETrue if the link was executed successfully. EFalse if no link
|
williamr@2
|
217 |
* is selected or there is no control object.
|
williamr@2
|
218 |
*/
|
williamr@4
|
219 |
TBool ExecuteLinkL();
|
williamr@2
|
220 |
|
williamr@2
|
221 |
private:
|
williamr@2
|
222 |
/**
|
williamr@2
|
223 |
* From CAknControl
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
226 |
private:
|
williamr@2
|
227 |
IMPORT_C virtual void CEikDialog_Reserved_1();
|
williamr@2
|
228 |
IMPORT_C virtual void CEikDialog_Reserved_2();
|
williamr@2
|
229 |
private:
|
williamr@2
|
230 |
IMPORT_C virtual void CAknDialog_Reserved();
|
williamr@2
|
231 |
private:
|
williamr@2
|
232 |
IMPORT_C virtual void CAknQueryDialog_Reserved();
|
williamr@2
|
233 |
private:
|
williamr@2
|
234 |
TDesC* iMessage;
|
williamr@2
|
235 |
TDesC* iHeader;
|
williamr@2
|
236 |
CEikImage* iHeaderImage;
|
williamr@2
|
237 |
// Moved to iMsgQueryExtension
|
williamr@2
|
238 |
// TInt iAnimationId;
|
williamr@2
|
239 |
CAknMessageQueryDialogExtension * iMsgQueryExtension;
|
williamr@2
|
240 |
|
williamr@2
|
241 |
|
williamr@2
|
242 |
public:
|
williamr@2
|
243 |
|
williamr@2
|
244 |
/**
|
williamr@2
|
245 |
* From @c MEikCommandObserver.
|
williamr@2
|
246 |
*
|
williamr@2
|
247 |
* Acts on the menu selection if menu is showing - pass on to client if
|
williamr@2
|
248 |
* not processed here.
|
williamr@2
|
249 |
*
|
williamr@2
|
250 |
* Responds to @c EAknSoftkeyView and @c EAknSoftkeyEmpty commands.
|
williamr@2
|
251 |
*
|
williamr@2
|
252 |
* @since S60 3.0
|
williamr@2
|
253 |
*/
|
williamr@2
|
254 |
IMPORT_C virtual void ProcessCommandL( TInt aCommandId );
|
williamr@2
|
255 |
|
williamr@2
|
256 |
/**
|
williamr@2
|
257 |
* Checks if a link is tapped. If yes and the pointer event was of type
|
williamr@2
|
258 |
* TPointerEvent::EButton1Up, then calls the callback for the tapped link.
|
williamr@2
|
259 |
*
|
williamr@2
|
260 |
* @param aParams information on the position tapped and the pointer event
|
williamr@2
|
261 |
* @since S60 3.2
|
williamr@2
|
262 |
*/
|
williamr@2
|
263 |
void CheckLinkTappedL( TAny* aParams );
|
williamr@2
|
264 |
|
williamr@2
|
265 |
|
williamr@2
|
266 |
public:
|
williamr@2
|
267 |
|
williamr@2
|
268 |
/**
|
williamr@2
|
269 |
* C++ default constructor.
|
williamr@2
|
270 |
*
|
williamr@2
|
271 |
* @param aMessage Dialog box text.
|
williamr@2
|
272 |
* @param aHeader Header for the dialog.
|
williamr@2
|
273 |
* @deprecated
|
williamr@2
|
274 |
*/
|
williamr@2
|
275 |
IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, TDesC* aHeader);
|
williamr@2
|
276 |
|
williamr@2
|
277 |
/**
|
williamr@2
|
278 |
* C++ default constructor.
|
williamr@2
|
279 |
*
|
williamr@2
|
280 |
* @param aMessage Dialog box text.
|
williamr@2
|
281 |
* @param aHeader Header for the dialog.
|
williamr@2
|
282 |
* @param aHeaderImage Image to be inserted to the header.
|
williamr@2
|
283 |
* @deprecated
|
williamr@2
|
284 |
*/
|
williamr@2
|
285 |
IMPORT_C CAknMessageQueryDialog(TDesC* aMessage,
|
williamr@2
|
286 |
TDesC* aHeader,
|
williamr@2
|
287 |
CEikImage *aHeaderImage);
|
williamr@2
|
288 |
|
williamr@2
|
289 |
/**
|
williamr@2
|
290 |
* C++ default constructor.
|
williamr@2
|
291 |
*
|
williamr@2
|
292 |
* @param aMessage Dialog box text.
|
williamr@2
|
293 |
* @param aHeader Header for the dialog.
|
williamr@2
|
294 |
* @param aTone Tone for the dialog.
|
williamr@2
|
295 |
* @deprecated
|
williamr@2
|
296 |
*/
|
williamr@2
|
297 |
IMPORT_C CAknMessageQueryDialog(TDesC* aMessage,
|
williamr@2
|
298 |
TDesC* aHeader,
|
williamr@2
|
299 |
const TTone aTone);
|
williamr@2
|
300 |
|
williamr@2
|
301 |
/**
|
williamr@2
|
302 |
* C++ default constructor.
|
williamr@2
|
303 |
*
|
williamr@2
|
304 |
* @param aMessage Dialog box text.
|
williamr@2
|
305 |
* @param aHeader Header for the dialog.
|
williamr@2
|
306 |
* @param aHeaderImage Image to be used in the header.
|
williamr@2
|
307 |
* @param aTone Ton for the dialog.
|
williamr@2
|
308 |
* @deprecated
|
williamr@2
|
309 |
*/
|
williamr@2
|
310 |
IMPORT_C CAknMessageQueryDialog(TDesC* aMessage,
|
williamr@2
|
311 |
TDesC* aHeader,
|
williamr@2
|
312 |
CEikImage *aHeaderImage,
|
williamr@2
|
313 |
const TTone aTone);
|
williamr@2
|
314 |
|
williamr@2
|
315 |
/**
|
williamr@2
|
316 |
* Sets the dialogs texts.
|
williamr@2
|
317 |
*
|
williamr@2
|
318 |
* @param aMessage Text to be inserter into the dialog.
|
williamr@2
|
319 |
* @deprecated
|
williamr@2
|
320 |
*/
|
williamr@2
|
321 |
IMPORT_C void SetMessageText(TDesC* aMessage);
|
williamr@2
|
322 |
|
williamr@2
|
323 |
/**
|
williamr@2
|
324 |
* Sets the dialogs texts.
|
williamr@2
|
325 |
*
|
williamr@2
|
326 |
* @deprecated
|
williamr@2
|
327 |
* @param aMessage Text to be inserter into the dialog.
|
williamr@2
|
328 |
*/
|
williamr@2
|
329 |
IMPORT_C void SetMessageText(const TDesC& aMessage);
|
williamr@2
|
330 |
|
williamr@2
|
331 |
/**
|
williamr@2
|
332 |
* Sets the dialogs header texts.
|
williamr@2
|
333 |
*
|
williamr@2
|
334 |
* @param aHeader Text to be inserter into the dialogs header.
|
williamr@2
|
335 |
* @deprecated
|
williamr@2
|
336 |
*/
|
williamr@2
|
337 |
IMPORT_C void SetHeaderText(TDesC* aHeader);
|
williamr@2
|
338 |
|
williamr@2
|
339 |
/**
|
williamr@2
|
340 |
* Sets the dialogs header texts.
|
williamr@2
|
341 |
*
|
williamr@2
|
342 |
* @param aHeader Text to be inserter into the dialogs header.
|
williamr@2
|
343 |
* @deprecated
|
williamr@2
|
344 |
*/
|
williamr@2
|
345 |
IMPORT_C void SetHeaderText(const TDesC& aHeader);
|
williamr@2
|
346 |
|
williamr@2
|
347 |
/** Update softkey labels depending on whether any link is highlighted.
|
williamr@2
|
348 |
* If a link is highlighted, the labels change to "View - <Empty>".
|
williamr@2
|
349 |
* If no link i highlighted, the labels change to their previous values ( Ok - Cancel ).
|
williamr@2
|
350 |
*/
|
williamr@2
|
351 |
void UpdateSoftkeyLabels();
|
williamr@2
|
352 |
|
williamr@2
|
353 |
/**
|
williamr@2
|
354 |
* C++ default constructor.
|
williamr@2
|
355 |
*
|
williamr@2
|
356 |
* @deprecated
|
williamr@2
|
357 |
*/
|
williamr@2
|
358 |
IMPORT_C CAknMessageQueryDialog();
|
williamr@2
|
359 |
|
williamr@2
|
360 |
};
|
williamr@2
|
361 |
|
williamr@2
|
362 |
|
williamr@2
|
363 |
#endif // __AKNMESSAGEQUERYDIALOG_H__
|
williamr@2
|
364 |
|
williamr@2
|
365 |
// End of File
|