epoc32/include/mw/aknmessagequerydialog.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/aknmessagequerydialog.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/aknmessagequerydialog.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,365 @@
     1.4 -aknmessagequerydialog.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 - 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +* 
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#if !defined(__AKNMESSAGEQUERYDIALOG_H__)
    1.25 +#define __AKNMESSAGEQUERYDIALOG_H__
    1.26 +
    1.27 +#include <aknquerydialog.h>
    1.28 +class CEikImage;
    1.29 +class CAknMessageQueryDialogExtension;
    1.30 +
    1.31 +_LIT( KOpeningLinkTag, "<AknMessageQuery Link>" );
    1.32 +_LIT( KClosingLinkTag, "</AknMessageQuery Link>" );
    1.33 +_LIT( KOpeningBoldTag, "<AknMessageQuery Bold>" );
    1.34 +_LIT( KClosingBoldTag, "</AknMessageQuery Bold>" );
    1.35 +
    1.36 +
    1.37 +/** 
    1.38 + * Message query dialog. 
    1.39 + *
    1.40 + * The dialog contains text that can be scrolled page by page.
    1.41 + * 
    1.42 + * If you want to use links and/or bold text among message you
    1.43 + * must use @c SetMessageTextL method. Formatting text does not
    1.44 + * work through resource file. If there are incorrect/misplaced
    1.45 + * tags or tags are within each other, dialog will leave.
    1.46 + */
    1.47 +class CAknMessageQueryDialog : public CAknQueryDialog
    1.48 +    {
    1.49 +
    1.50 +public:
    1.51 +
    1.52 +    /** 
    1.53 +     * Two-phased constructor.
    1.54 +     *
    1.55 +     * @param aMessage Text for the dialog.
    1.56 +     * @param aTone=ENoTone Tone played by the dialog.
    1.57 +     */
    1.58 +    IMPORT_C static CAknMessageQueryDialog* NewL(TDesC& aMessage, 
    1.59 +                                        const TTone& aTone = ENoTone);
    1.60 +
    1.61 +    /**
    1.62 +     * Destructor.
    1.63 +     */
    1.64 +    IMPORT_C ~CAknMessageQueryDialog();
    1.65 +
    1.66 +    /**
    1.67 +     * C++ default constructor.
    1.68 +     *
    1.69 +     * @param aTone Tone played with the dialog.
    1.70 +     */
    1.71 +    IMPORT_C CAknMessageQueryDialog(const TTone aTone);
    1.72 +
    1.73 +public:
    1.74 +
    1.75 +    /**
    1.76 +     * Sets message text. If you have links in your message you can mark 
    1.77 +     * link texts between tags @c <AknMessageQuery Link> and 
    1.78 +     * @c </AknMessageQuery Link> in the message text. For links see also @c SetLink.
    1.79 +     * Bold text can be achieved using tags @c <AknMessageQuery Bold> and @c </AknMessageQuery Bold>
    1.80 +     * 
    1.81 +     * @param aMessage Message text inside query. Insert '\\n' to get new line. 
    1.82 +     */
    1.83 +    IMPORT_C void SetMessageTextL(const TDesC& aMessage);
    1.84 +
    1.85 +    /**
    1.86 +     * Sets header text.
    1.87 +     *
    1.88 +     * @param aHeader Message query header text
    1.89 +     * @deprecated - use @c Heading() + @c CAknPopupHeadingPane API instead
    1.90 +     */
    1.91 +    IMPORT_C void SetHeaderTextL(const TDesC& aHeader);  
    1.92 +
    1.93 +    /**
    1.94 +     * @deprecated - use tags within text instead. 
    1.95 +     *
    1.96 +     * Changes the first occurance of @c aLinkText to a link
    1.97 +     * within the Message. If you have many links with the same name,
    1.98 +     * the method will set the links in the order you call them.
    1.99 +     * Before you set a new link you have to bind the 
   1.100 +     * previous one with a callback by calling @c SetLink() function. 
   1.101 +     *
   1.102 +     * Note that you don't have to call this function if you have already 
   1.103 +     * marked your links between tags @c <AknMessageQuery Link> and 
   1.104 +     * @c </AknMessageQuery Link> in the Message. In that
   1.105 +     * case only @c SetLink() method is used.
   1.106 +     *
   1.107 +     * @since S60 2.8
   1.108 +     * @param aLinkText Link text inside message.
   1.109 +     */
   1.110 +    IMPORT_C void SetLinkTextL(const TDesC& aLinkText);
   1.111 +
   1.112 +    /**
   1.113 +     * Binds a callback to your link so that the dialog knows 
   1.114 +     * which callback to call when a link is activated by the user.
   1.115 +     *
   1.116 +     * @since S60 2.8
   1.117 +     * @param aCallBack Points to function which is executed when a link is 
   1.118 +     *        activated by a user.
   1.119 +     */
   1.120 +    IMPORT_C void SetLink(TCallBack& aCallBack);
   1.121 +
   1.122 +public: // from CCoeControl
   1.123 +
   1.124 +    /** 
   1.125 +     * From @c CCoeControl.
   1.126 +     *
   1.127 +     * Handles key events.
   1.128 +     * 
   1.129 +     * If a control wishes to process key events, it should implement this
   1.130 +     * function. The implementation must ensure that the function returns 
   1.131 +     * @c EKeyWasNotConsumed if it does not do anything in response to a 
   1.132 +     * key event, otherwise, other controls or dialogs may be prevented 
   1.133 +     * from receiving the key event. If it is able to process the event it 
   1.134 +     * should return @c EKeyWasConsumed.
   1.135 +     * 
   1.136 +     * @param aKeyEvent The key event. 
   1.137 +     * @param aType The type of key event: @c EEventKey, @c EEventKeyUp or 
   1.138 +     *        @c EEventKeyDown. 
   1.139 +     * @return Indicates whether or not the key event was used
   1.140 +     *         by this control. 
   1.141 +     */
   1.142 +    IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
   1.143 +                                         TEventCode);
   1.144 +
   1.145 +    /**
   1.146 +     * From @c CCoeControl.
   1.147 +     *
   1.148 +     * Handles pointer events
   1.149 +     *
   1.150 +     * @param aPointerEvent The pointer event.
   1.151 +     */
   1.152 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 
   1.153 +
   1.154 +protected: // from CEikDialog
   1.155 +
   1.156 +    /** 
   1.157 +     * From @c CEikDialog.
   1.158 +     *
   1.159 +     * Should be derived to perform pre-layout dialog initialisation. 
   1.160 +     *
   1.161 +     * This function is called by the dialog framework before the dialog 
   1.162 +     * is sized and laid out. It may be overloaded to initialise the control
   1.163 +     * values that should influence sizing and layout, the default 
   1.164 +     * implementation is empty.
   1.165 +     */ 
   1.166 +    IMPORT_C virtual void PreLayoutDynInitL();
   1.167 +    
   1.168 +    /** 
   1.169 +     * From @c CEikDialog
   1.170 +     *
   1.171 +     * Sets the size and position of the dialog.
   1.172 +     *
   1.173 +     * Positions the dialog in the centre of the screen by default.
   1.174 +     *
   1.175 +     * @param aSize Not used.
   1.176 +     */ 
   1.177 +    IMPORT_C virtual void SetSizeAndPosition(const TSize& aSize);
   1.178 +    
   1.179 +    /** 
   1.180 +     * From @c CEikDialog
   1.181 +     * 
   1.182 +     * Not implemented.
   1.183 +     */ 
   1.184 +    IMPORT_C virtual void PostLayoutDynInitL();
   1.185 +
   1.186 +private:
   1.187 +
   1.188 +    /**
   1.189 +     * If the dialog does not have an extension create one.
   1.190 +     *
   1.191 +     * @since S60 2.8
   1.192 +     */
   1.193 +    void CreateExtensionL();
   1.194 +
   1.195 +    /**
   1.196 +     * Register/Unregister an observer to extendedinputcapabilities. 
   1.197 +     * Registering is done so that we can receive pointer events from edwin. 
   1.198 +     *
   1.199 +     * @param aRegister, if true then registering, in other case unregister
   1.200 +     * @since S60 3.2
   1.201 +     */
   1.202 +    void RegisterPointerEventObserver( TBool aRegister ); 
   1.203 +    
   1.204 +    /**
   1.205 +     * @since S60 3.0
   1.206 +     * With multiple link support 
   1.207 +     */
   1.208 +    TInt CountLinks() const;         
   1.209 +    TBool SetNextLinkTextLocationL(const TDesC* aLinkText);     // for the non-marked links
   1.210 +    
   1.211 +    void ParseMessageTxtL();
   1.212 +    TBool GetNextTagL(TMsgQueryTag& aTag);
   1.213 +    void SetMsgFormattingL(TMsgQueryTag aTag);
   1.214 +    TBool TaggedMessageL();
   1.215 +    TInt LinksInArray();
   1.216 +    TInt LastLinkInArray();
   1.217 +       
   1.218 +    /**
   1.219 +    * Execute the current link. The link is dehighlighted after the execution.
   1.220 +    * @return ETrue if the link was executed successfully. EFalse if no link
   1.221 +    * is selected or there is no control object.
   1.222 +    */
   1.223 +    TBool ExecuteLink();
   1.224 +      
   1.225 +private:
   1.226 +    /**
   1.227 +    * From CAknControl
   1.228 +    */
   1.229 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.230 +private: 
   1.231 +    IMPORT_C virtual void CEikDialog_Reserved_1();
   1.232 +    IMPORT_C virtual void CEikDialog_Reserved_2();  
   1.233 +private: 
   1.234 +    IMPORT_C virtual void CAknDialog_Reserved();
   1.235 +private:
   1.236 +    IMPORT_C virtual void CAknQueryDialog_Reserved();
   1.237 +private:
   1.238 +    TDesC* iMessage;
   1.239 +    TDesC* iHeader;
   1.240 +    CEikImage* iHeaderImage;
   1.241 +    // Moved to iMsgQueryExtension
   1.242 +    // TInt iAnimationId;
   1.243 +    CAknMessageQueryDialogExtension * iMsgQueryExtension;
   1.244 +    
   1.245 +
   1.246 +public:
   1.247 +
   1.248 +    /**
   1.249 +     * From @c MEikCommandObserver. 
   1.250 +     *
   1.251 +     * Acts on the menu selection if menu is showing - pass on to client if 
   1.252 +     * not processed here.
   1.253 +     *
   1.254 +     * Responds to @c EAknSoftkeyView and @c EAknSoftkeyEmpty commands. 
   1.255 +     *
   1.256 +     * @since S60 3.0 
   1.257 +     */
   1.258 +    IMPORT_C virtual void ProcessCommandL( TInt aCommandId );
   1.259 +    
   1.260 +    /**
   1.261 +     * Checks if a link is tapped. If yes and the pointer event was of type 
   1.262 +     * TPointerEvent::EButton1Up, then calls the callback for the tapped link. 
   1.263 +     * 
   1.264 +     * @param aParams information on the position tapped and the pointer event
   1.265 +     * @since S60 3.2
   1.266 +     */
   1.267 +    void CheckLinkTappedL( TAny* aParams ); 
   1.268 +
   1.269 +
   1.270 +public:
   1.271 +
   1.272 +    /**
   1.273 +     * C++ default constructor.
   1.274 +     *
   1.275 +     * @param aMessage Dialog box text.
   1.276 +     * @param aHeader Header for the dialog.
   1.277 +     * @deprecated 
   1.278 +     */ 
   1.279 +    IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, TDesC* aHeader); 
   1.280 +
   1.281 +    /**
   1.282 +     * C++ default constructor.
   1.283 +     *
   1.284 +     * @param aMessage Dialog box text.
   1.285 +     * @param aHeader Header for the dialog.
   1.286 +     * @param aHeaderImage Image to be inserted to the header.
   1.287 +     * @deprecated
   1.288 +     */ 
   1.289 +    IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, 
   1.290 +                                    TDesC* aHeader, 
   1.291 +                                    CEikImage *aHeaderImage); 
   1.292 +
   1.293 +    /**
   1.294 +     * C++ default constructor.
   1.295 +     *
   1.296 +     * @param aMessage Dialog box text.
   1.297 +     * @param aHeader Header for the dialog.
   1.298 +     * @param aTone Tone for the dialog. 
   1.299 +     * @deprecated
   1.300 +     */ 
   1.301 +    IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, 
   1.302 +                                    TDesC* aHeader, 
   1.303 +                                    const TTone aTone); 
   1.304 +
   1.305 +    /**
   1.306 +     * C++ default constructor.
   1.307 +     *
   1.308 +     * @param aMessage Dialog box text.
   1.309 +     * @param aHeader Header for the dialog.
   1.310 +     * @param aHeaderImage Image to be used in the header. 
   1.311 +     * @param aTone Ton for the dialog.
   1.312 +     * @deprecated
   1.313 +     */ 
   1.314 +    IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, 
   1.315 +                                    TDesC* aHeader, 
   1.316 +                                    CEikImage *aHeaderImage, 
   1.317 +                                    const TTone aTone); 
   1.318 +    
   1.319 +    /** 
   1.320 +     * Sets the dialogs texts. 
   1.321 +     *
   1.322 +     * @param aMessage Text to be inserter into the dialog. 
   1.323 +     * @deprecated
   1.324 +     */
   1.325 +    IMPORT_C void SetMessageText(TDesC* aMessage); 
   1.326 +    
   1.327 +    /** 
   1.328 +     * Sets the dialogs texts. 
   1.329 +     *
   1.330 +     * @deprecated
   1.331 +     * @param aMessage Text to be inserter into the dialog. 
   1.332 +     */
   1.333 +    IMPORT_C void SetMessageText(const TDesC& aMessage);
   1.334 +
   1.335 +    /** 
   1.336 +     * Sets the dialogs header texts. 
   1.337 +     *
   1.338 +     * @param aHeader Text to be inserter into the dialogs header. 
   1.339 +     * @deprecated
   1.340 +     */
   1.341 +    IMPORT_C void SetHeaderText(TDesC* aHeader);  
   1.342 +
   1.343 +    /** 
   1.344 +     * Sets the dialogs header texts. 
   1.345 +     *
   1.346 +     * @param aHeader Text to be inserter into the dialogs header. 
   1.347 +     * @deprecated
   1.348 +     */
   1.349 +    IMPORT_C void SetHeaderText(const TDesC& aHeader);  
   1.350 +    
   1.351 +    /** Update softkey labels depending on whether any link is highlighted.
   1.352 +     * If a link is highlighted, the labels change to "View - <Empty>".
   1.353 +     * If no link i highlighted, the labels change to their previous values ( Ok - Cancel ).
   1.354 +     */
   1.355 +    void UpdateSoftkeyLabels();
   1.356 +
   1.357 +    /** 
   1.358 +     * C++ default constructor.
   1.359 +     *
   1.360 +     * @deprecated
   1.361 +     */
   1.362 +    IMPORT_C CAknMessageQueryDialog();
   1.363 +        
   1.364 +    };
   1.365 +
   1.366 +
   1.367 +#endif // __AKNMESSAGEQUERYDIALOG_H__
   1.368 +
   1.369 +//  End of File