williamr@2: /* williamr@2: * Copyright (c) 2002 - 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #if !defined(__AKNMESSAGEQUERYDIALOG_H__) williamr@2: #define __AKNMESSAGEQUERYDIALOG_H__ williamr@2: williamr@2: #include williamr@2: class CEikImage; williamr@2: class CAknMessageQueryDialogExtension; williamr@2: williamr@2: _LIT( KOpeningLinkTag, "" ); williamr@2: _LIT( KClosingLinkTag, "" ); williamr@2: _LIT( KOpeningBoldTag, "" ); williamr@2: _LIT( KClosingBoldTag, "" ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Message query dialog. williamr@2: * williamr@2: * The dialog contains text that can be scrolled page by page. williamr@2: * williamr@2: * If you want to use links and/or bold text among message you williamr@2: * must use @c SetMessageTextL method. Formatting text does not williamr@2: * work through resource file. If there are incorrect/misplaced williamr@2: * tags or tags are within each other, dialog will leave. williamr@2: */ williamr@2: class CAknMessageQueryDialog : public CAknQueryDialog williamr@2: { williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. williamr@2: * williamr@2: * @param aMessage Text for the dialog. williamr@2: * @param aTone=ENoTone Tone played by the dialog. williamr@2: */ williamr@2: IMPORT_C static CAknMessageQueryDialog* NewL(TDesC& aMessage, williamr@2: const TTone& aTone = ENoTone); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CAknMessageQueryDialog(); williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @param aTone Tone played with the dialog. williamr@2: */ williamr@2: IMPORT_C CAknMessageQueryDialog(const TTone aTone); williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Sets message text. If you have links in your message you can mark williamr@2: * link texts between tags @c and williamr@2: * @c in the message text. For links see also @c SetLink. williamr@2: * Bold text can be achieved using tags @c and @c williamr@2: * williamr@2: * @param aMessage Message text inside query. Insert '\\n' to get new line. williamr@2: */ williamr@2: IMPORT_C void SetMessageTextL(const TDesC& aMessage); williamr@2: williamr@2: /** williamr@2: * Sets header text. williamr@2: * williamr@2: * @param aHeader Message query header text williamr@2: * @deprecated - use @c Heading() + @c CAknPopupHeadingPane API instead williamr@2: */ williamr@2: IMPORT_C void SetHeaderTextL(const TDesC& aHeader); williamr@2: williamr@2: /** williamr@2: * @deprecated - use tags within text instead. williamr@2: * williamr@2: * Changes the first occurance of @c aLinkText to a link williamr@2: * within the Message. If you have many links with the same name, williamr@2: * the method will set the links in the order you call them. williamr@2: * Before you set a new link you have to bind the williamr@2: * previous one with a callback by calling @c SetLink() function. williamr@2: * williamr@2: * Note that you don't have to call this function if you have already williamr@2: * marked your links between tags @c and williamr@2: * @c in the Message. In that williamr@2: * case only @c SetLink() method is used. williamr@2: * williamr@2: * @since S60 2.8 williamr@2: * @param aLinkText Link text inside message. williamr@2: */ williamr@2: IMPORT_C void SetLinkTextL(const TDesC& aLinkText); williamr@2: williamr@2: /** williamr@2: * Binds a callback to your link so that the dialog knows williamr@2: * which callback to call when a link is activated by the user. williamr@2: * williamr@2: * @since S60 2.8 williamr@2: * @param aCallBack Points to function which is executed when a link is williamr@2: * activated by a user. williamr@2: */ williamr@2: IMPORT_C void SetLink(TCallBack& aCallBack); williamr@2: williamr@2: public: // from CCoeControl williamr@2: williamr@2: /** williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * Handles key events. williamr@2: * williamr@2: * If a control wishes to process key events, it should implement this williamr@2: * function. The implementation must ensure that the function returns williamr@2: * @c EKeyWasNotConsumed if it does not do anything in response to a williamr@2: * key event, otherwise, other controls or dialogs may be prevented williamr@2: * from receiving the key event. If it is able to process the event it williamr@2: * should return @c EKeyWasConsumed. williamr@2: * williamr@2: * @param aKeyEvent The key event. williamr@2: * @param aType The type of key event: @c EEventKey, @c EEventKeyUp or williamr@2: * @c EEventKeyDown. williamr@2: * @return Indicates whether or not the key event was used williamr@2: * by this control. williamr@2: */ williamr@2: IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, williamr@2: TEventCode); williamr@2: williamr@2: /** williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * Handles pointer events williamr@2: * williamr@2: * @param aPointerEvent The pointer event. williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: // from CEikDialog williamr@2: williamr@2: /** williamr@2: * From @c CEikDialog. williamr@2: * williamr@2: * Should be derived to perform pre-layout dialog initialisation. williamr@2: * williamr@2: * This function is called by the dialog framework before the dialog williamr@2: * is sized and laid out. It may be overloaded to initialise the control williamr@2: * values that should influence sizing and layout, the default williamr@2: * implementation is empty. williamr@2: */ williamr@2: IMPORT_C virtual void PreLayoutDynInitL(); williamr@2: williamr@2: /** williamr@2: * From @c CEikDialog williamr@2: * williamr@2: * Sets the size and position of the dialog. williamr@2: * williamr@2: * Positions the dialog in the centre of the screen by default. williamr@2: * williamr@2: * @param aSize Not used. williamr@2: */ williamr@2: IMPORT_C virtual void SetSizeAndPosition(const TSize& aSize); williamr@2: williamr@2: /** williamr@2: * From @c CEikDialog williamr@2: * williamr@2: * Not implemented. williamr@2: */ williamr@2: IMPORT_C virtual void PostLayoutDynInitL(); williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * If the dialog does not have an extension create one. williamr@2: * williamr@2: * @since S60 2.8 williamr@2: */ williamr@2: void CreateExtensionL(); williamr@2: williamr@2: /** williamr@2: * Register/Unregister an observer to extendedinputcapabilities. williamr@2: * Registering is done so that we can receive pointer events from edwin. williamr@2: * williamr@2: * @param aRegister, if true then registering, in other case unregister williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: void RegisterPointerEventObserver( TBool aRegister ); williamr@2: williamr@2: /** williamr@2: * @since S60 3.0 williamr@2: * With multiple link support williamr@2: */ williamr@2: TInt CountLinks() const; williamr@2: TBool SetNextLinkTextLocationL(const TDesC* aLinkText); // for the non-marked links williamr@2: williamr@2: void ParseMessageTxtL(); williamr@2: TBool GetNextTagL(TMsgQueryTag& aTag); williamr@2: void SetMsgFormattingL(TMsgQueryTag aTag); williamr@2: TBool TaggedMessageL(); williamr@2: TInt LinksInArray(); williamr@2: TInt LastLinkInArray(); williamr@2: williamr@2: /** williamr@2: * Execute the current link. The link is dehighlighted after the execution. williamr@2: * @return ETrue if the link was executed successfully. EFalse if no link williamr@2: * is selected or there is no control object. williamr@2: */ williamr@2: TBool ExecuteLink(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: private: williamr@2: IMPORT_C virtual void CEikDialog_Reserved_1(); williamr@2: IMPORT_C virtual void CEikDialog_Reserved_2(); williamr@2: private: williamr@2: IMPORT_C virtual void CAknDialog_Reserved(); williamr@2: private: williamr@2: IMPORT_C virtual void CAknQueryDialog_Reserved(); williamr@2: private: williamr@2: TDesC* iMessage; williamr@2: TDesC* iHeader; williamr@2: CEikImage* iHeaderImage; williamr@2: // Moved to iMsgQueryExtension williamr@2: // TInt iAnimationId; williamr@2: CAknMessageQueryDialogExtension * iMsgQueryExtension; williamr@2: williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * From @c MEikCommandObserver. williamr@2: * williamr@2: * Acts on the menu selection if menu is showing - pass on to client if williamr@2: * not processed here. williamr@2: * williamr@2: * Responds to @c EAknSoftkeyView and @c EAknSoftkeyEmpty commands. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: IMPORT_C virtual void ProcessCommandL( TInt aCommandId ); williamr@2: williamr@2: /** williamr@2: * Checks if a link is tapped. If yes and the pointer event was of type williamr@2: * TPointerEvent::EButton1Up, then calls the callback for the tapped link. williamr@2: * williamr@2: * @param aParams information on the position tapped and the pointer event williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: void CheckLinkTappedL( TAny* aParams ); williamr@2: williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @param aMessage Dialog box text. williamr@2: * @param aHeader Header for the dialog. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, TDesC* aHeader); williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @param aMessage Dialog box text. williamr@2: * @param aHeader Header for the dialog. williamr@2: * @param aHeaderImage Image to be inserted to the header. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, williamr@2: TDesC* aHeader, williamr@2: CEikImage *aHeaderImage); williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @param aMessage Dialog box text. williamr@2: * @param aHeader Header for the dialog. williamr@2: * @param aTone Tone for the dialog. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, williamr@2: TDesC* aHeader, williamr@2: const TTone aTone); williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @param aMessage Dialog box text. williamr@2: * @param aHeader Header for the dialog. williamr@2: * @param aHeaderImage Image to be used in the header. williamr@2: * @param aTone Ton for the dialog. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CAknMessageQueryDialog(TDesC* aMessage, williamr@2: TDesC* aHeader, williamr@2: CEikImage *aHeaderImage, williamr@2: const TTone aTone); williamr@2: williamr@2: /** williamr@2: * Sets the dialogs texts. williamr@2: * williamr@2: * @param aMessage Text to be inserter into the dialog. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetMessageText(TDesC* aMessage); williamr@2: williamr@2: /** williamr@2: * Sets the dialogs texts. williamr@2: * williamr@2: * @deprecated williamr@2: * @param aMessage Text to be inserter into the dialog. williamr@2: */ williamr@2: IMPORT_C void SetMessageText(const TDesC& aMessage); williamr@2: williamr@2: /** williamr@2: * Sets the dialogs header texts. williamr@2: * williamr@2: * @param aHeader Text to be inserter into the dialogs header. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetHeaderText(TDesC* aHeader); williamr@2: williamr@2: /** williamr@2: * Sets the dialogs header texts. williamr@2: * williamr@2: * @param aHeader Text to be inserter into the dialogs header. williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetHeaderText(const TDesC& aHeader); williamr@2: williamr@2: /** Update softkey labels depending on whether any link is highlighted. williamr@2: * If a link is highlighted, the labels change to "View - ". williamr@2: * If no link i highlighted, the labels change to their previous values ( Ok - Cancel ). williamr@2: */ williamr@2: void UpdateSoftkeyLabels(); williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CAknMessageQueryDialog(); williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // __AKNMESSAGEQUERYDIALOG_H__ williamr@2: williamr@2: // End of File