00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef AKNMESSAGEQUERYCONTROL_H
00021 #define AKNMESSAGEQUERYCONTROL_H
00022 
00023 
00024 
00025 #include <akncontrol.h>
00026 #include <aknutils.h>
00027 
00028 
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 
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:  
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 
00203 
00204     void CreateEditorL();
00205     void LayoutEditorL();
00206 
00207 private:
00208     
00209 
00210 
00211 
00212     CEikRichTextEditor* iEdwin;
00213     TInt iNumberOfLines;    
00214     TInt iTopLine;    
00215     TInt iLinesPerPage; 
00216 
00217     CEikScrollBarFrame* iSBFrame;
00218     TBool iListQLayout; 
00219 
00220     
00221     
00222     TBool iHighlightOn; 
00223     TCharFormatMask iCharFormatMask;
00224     TCharFormat iCharFormat;
00225 
00226     
00227     
00228     RArray<TInt> iLinkTextLocationArray;    
00229     RArray<TDesC*> iLinkTextArray;  
00230     TInt iLinksCount;   
00231     TInt iVisibleLinksCount;    
00232     TInt iFirstVisibleLink; 
00233     
00240     TInt iPositionsCount;   
00241     TInt iCurPos;   
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 
00267 #endif
00268 
00269