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#30 %
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 class CAknMessageQueryControlExtension;
00035 
00036 enum TMsgQueryTag
00037     {
00038     EMsgQueryLink = 0,
00039     EMsgQueryBold
00040     };
00041 
00042 
00043 // CLASS DECLARATION
00044 
00051 NONSHARABLE_CLASS(CAknMessageQueryControl) : public CAknControl
00052     {
00053 public:
00054 
00058     CAknMessageQueryControl();
00059 
00063     ~CAknMessageQueryControl();
00064 
00070     IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
00071 
00076     IMPORT_C void SetMessageTextL( TDesC* aMessage );
00077 
00082     inline TInt Lines() const;
00083 
00089     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode );
00090 
00101     void SetMessageTextWithFormattingL(
00102         TDesC* aMessage,
00103         RArray<TDesC*>* aFormatTextArray,
00104         RArray<TInt>* aFormatTextLocationArray,
00105         RArray<TMsgQueryTag>* aFormatTypeArray );
00106 
00112     TInt CurrentLink() const;
00113 
00119     IMPORT_C TBool LinkHighLighted() const;
00120 
00125     void SetListQLayout( TBool aListQLayout );
00126 
00133     TBool LinkTappedL( TInt aPos );
00134     
00139     void DehighlightLink();
00140 
00145     TBool ScrollBarGrabbing();
00146 
00147 public:  // from CCoeControl
00148 
00153     TSize MinimumSize();
00154 
00160     TInt CountComponentControls() const;
00161 
00168     CCoeControl* ComponentControl( TInt anIndex ) const;
00169 
00174     void SizeChanged();
00175 
00180     virtual void ActivateL();
00181 
00186     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
00187     
00188 private:
00189     void UpdateScrollIndicatorL();
00190 
00194     void SetHighlightOnL( TBool aOn );
00195 
00200     TBool CanScrollPage( TBool aMoveDown );
00201 
00202     TBool IsLinkVisible( TInt aIndex ) const;  
00203         
00212     void UpdatePageInfo();
00213 
00214     /*
00215     *  Initialisation functions
00216     */
00217     void CreateEditorL();
00218     void LayoutEditorL();
00219     
00227     TBool SetCurPos( TInt aCurPos );
00228     
00236     void TruncateTextForListQLayout( TDes& aMessage );
00237 
00238 private:
00239     /*
00240     * changed editor from CEikEdwin to CEikRichTextEditor
00241     * @since 2.8
00242     */
00243     CEikRichTextEditor* iEdwin;
00244     TInt iNumberOfLines;    // Number of lines in the document
00245     TInt iTopLine;    // Index of the top visible line on the current page, zero-based
00246     TInt iLinesPerPage; // Number of lines in one page
00247 
00248     CEikScrollBarFrame* iSBFrame;
00249     TBool iListQLayout; // If ETrue, used by listqueryDialog
00250 
00251     //@since 2.8
00252     // with link extension introduced
00253     TBool iHighlightOn; // The current position is a link
00254     TCharFormatMask iCharFormatMask;
00255     TCharFormat iCharFormat;
00256 
00257     //@since 3.0
00258     // with multiple link support
00259     RArray<TInt> iLinkTextLocationArray;    // Link positions; sorted
00260     RArray<TDesC*> iLinkTextArray;  // Link texts; in sync with iLinkTextLocationArray w.r.t. item order
00261     TInt iLinksCount;   // Number of all links in the document
00262     TInt iVisibleLinksCount;    // Number of visibile links on the current page. Updated in UpdatePageInfo().
00263     TInt iFirstVisibleLink; // Index of the first visible link, zero-based. Updated in UpdatePageInfo().
00264     
00271     TInt iPositionsCount;   // Number of cursor positions on the current page. Updated in UpdatePageInfo().
00272     TInt iCurPos;   // Current cursor position on the current page, zero-based
00273     TDesC* iFullMessage;    // A copy of the full message used in the list query layout for truncation
00274     CAknMessageQueryControlExtension* iExtension;
00275 
00276 protected:
00282     IMPORT_C void Draw( const TRect& aRect ) const;
00283 
00284 
00285 protected:
00291     TRect LayoutRect() const;
00292     };
00293 
00294 inline TInt CAknMessageQueryControl::Lines() const
00295     {
00296     return iNumberOfLines;
00297     }
00298 
00299 #endif // AKNMESSAGEQUERYCONTROL_H
00300 
00301 // End of file

Copyright © Nokia Corporation 2001-2007
Back to top