aknmessagequerycontrol.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : AknMessageQueryControl.h
00004 *  Part of     : UI Framework Core / AVKON
00005 *  Description : Implementation of the interface to control message queries,
00006 *                to be contained within CAknMessageQueryDialog
00007 *  Version     : %version: e003sa01#25 %
00008 *
00009 *  Copyright  2002-2007 Nokia.  All rights reserved.
00010 *  This material, including documentation and any related computer
00011 *  programs, is protected by copyright controlled by Nokia.  All
00012 *  rights are reserved.  Copying, including reproducing, storing,
00013 *  adapting or translating, any or all of this material requires the
00014 *  prior written consent of Nokia.  This material also contains
00015 *  confidential information which may not be disclosed to others
00016 *  without the prior written consent of Nokia.
00017 * ============================================================================
00018 */
00019 
00020 #ifndef AKNMESSAGEQUERYCONTROL_H
00021 #define AKNMESSAGEQUERYCONTROL_H
00022 
00023 // INCLUDES
00024 
00025 #include <akncontrol.h>
00026 #include <aknutils.h>
00027 
00028 // FORWARD DECLARATIONS
00029 
00030 class CEikEdwin;
00031 class CEikScrollBarFrame;
00032 class CEikRichTextEditor;
00033 class CRichText;
00034 
00035 enum TMsgQueryTag
00036     {
00037     EMsgQueryLink = 0,
00038     EMsgQueryBold
00039     };
00040 
00041 
00042 // CLASS DECLARATION
00043 
00050 NONSHARABLE_CLASS(CAknMessageQueryControl) : public CAknControl
00051     {
00052 public:
00053 
00057     CAknMessageQueryControl();
00058 
00062     ~CAknMessageQueryControl();
00063 
00069     IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
00070 
00075     IMPORT_C void SetMessageTextL( TDesC* aMessage );
00076 
00081     inline TInt Lines() const;
00082 
00088     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode );
00089 
00100     void SetMessageTextWithFormattingL(
00101         TDesC* aMessage,
00102         RArray<TDesC*>* aFormatTextArray,
00103         RArray<TInt>* aFormatTextLocationArray,
00104         RArray<TMsgQueryTag>* aFormatTypeArray );
00105 
00111     TInt CurrentLink() const;
00112 
00118     IMPORT_C TBool LinkHighLighted() const;
00119 
00124     void SetListQLayout( TBool aListQLayout );
00125 
00132     TBool LinkTappedL( TInt aPos );
00133 
00134 public:  // from CCoeControl
00135 
00140     TSize MinimumSize();
00141 
00147     TInt CountComponentControls() const;
00148 
00155     CCoeControl* ComponentControl( TInt anIndex ) const;
00156 
00161     void SizeChanged();
00162 
00167     virtual void ActivateL();
00168 
00173     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00174 
00175 private:
00176     void UpdateScrollIndicatorL();
00177 
00181     void SetHighlightOnL( TBool aOn );
00182 
00187     TBool CanScrollPage( TBool aMoveDown );
00188 
00189     TBool IsLinkVisible( TInt aIndex ) const;  
00190         
00199     void UpdatePageInfo();
00200 
00201     /*
00202     *  Initialisation functions
00203     */
00204     void CreateEditorL();
00205     void LayoutEditorL();
00206 
00207 private:
00208     /*
00209     * changed editor from CEikEdwin to CEikRichTextEditor
00210     * 
00211     */
00212     CEikRichTextEditor* iEdwin;
00213     TInt iNumberOfLines;    // Number of lines in the document
00214     TInt iTopLine;    // Index of the top visible line on the current page, zero-based
00215     TInt iLinesPerPage; // Number of lines in one page
00216 
00217     CEikScrollBarFrame* iSBFrame;
00218     TBool iListQLayout; // If ETrue, used by listqueryDialog
00219 
00220     //
00221     // with link extension introduced
00222     TBool iHighlightOn; // The current position is a link
00223     TCharFormatMask iCharFormatMask;
00224     TCharFormat iCharFormat;
00225 
00226     //
00227     // with multiple link support
00228     RArray<TInt> iLinkTextLocationArray;    // Link positions; sorted
00229     RArray<TDesC*> iLinkTextArray;  // Link texts; in sync with iLinkTextLocationArray w.r.t. item order
00230     TInt iLinksCount;   // Number of all links in the document
00231     TInt iVisibleLinksCount;    // Number of visibile links on the current page. Updated in UpdatePageInfo().
00232     TInt iFirstVisibleLink; // Index of the first visible link, zero-based. Updated in UpdatePageInfo().
00233     
00240     TInt iPositionsCount;   // Number of cursor positions on the current page. Updated in UpdatePageInfo().
00241     TInt iCurPos;   // Current cursor position on the current page, zero-based
00242 
00243 protected:
00249     IMPORT_C void Draw( const TRect& aRect ) const;
00250 
00251 
00252 protected:
00258     TRect LayoutRect() const;
00259     };
00260 
00261 inline TInt CAknMessageQueryControl::Lines() const
00262     {
00263     return iNumberOfLines;
00264     }
00265 
00266 // AKNMESSAGEQUERYCONTROL_H
00267 #endif
00268 
00269 // End of file

Copyright © Nokia Corporation 2001-2008
Back to top