crichbio.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : CRichBio from CRichBio.h
00004 *  Part of  : RICHBIO
00005 *
00006 *  Description:
00007 *     A UI control used by Smart Messaging Viewers.
00008 *  Version:
00009 *
00010 *  Copyright (C) 2002 Nokia Corporation.
00011 *  This material, including documentation and any related
00012 *  computer programs, is protected by copyright controlled by
00013 *  Nokia Corporation. All rights are reserved. Copying,
00014 *  including reproducing, storing,  adapting or translating, any
00015 *  or all of this material requires the prior written consent of
00016 *  Nokia Corporation. This material also contains confidential
00017 *  information which may not be disclosed to others without the
00018 *  prior written consent of Nokia Corporation.
00019 *
00020 * ============================================================================
00021 */
00022 
00023 #ifndef _CRICHBIO_H_
00024 #define _CRICHBIO_H_
00025 
00026 // INCLUDES
00027 
00028 #include <coecntrl.h>           // CCoeControl
00029 #include <badesca.h>            // CDesC16ArrayFlat
00030 #include <txtfrmat.h>           // TCharFormat
00031 #include <MsgEditor.hrh>        // TMsgCursorLocation
00032 
00033 // DATA TYPES
00034 
00040 enum TRichBioMode
00041     {
00042     ERichBioModeEditorBase,
00043     ERichBioModeStandard
00044     };
00045 
00046 // FORWARD DECLARATIONS
00047 
00048 class CEikRichTextEditor;
00049 class CMsgExpandableControlEditor;
00050 
00056 class CRichBio : public CCoeControl
00057     {
00058     public: // construction
00059 
00070         IMPORT_C static CRichBio* NewL( const CCoeControl* aParent,
00071             TRichBioMode aMode );
00072 
00081         IMPORT_C CRichBio( TRichBioMode aMode );
00082 
00088         IMPORT_C void ConstructL( const CCoeControl* aParent );
00089 
00090     public: // destruction
00091 
00095         ~CRichBio();
00096 
00097     public: // own methods
00098 
00106         IMPORT_C void AddItemL(const TDesC& aLabel, const TDesC& aValue);
00107 
00112         IMPORT_C TRect CurrentLineRect();
00113 
00120         IMPORT_C CEikRichTextEditor& Editor();
00121 
00126         IMPORT_C TBool IsEditorBaseMode() const;
00127 
00131         IMPORT_C void Reset();
00132 
00137         IMPORT_C void SetAndGetSizeL( TSize& aSize );
00138 
00143         IMPORT_C TInt VirtualHeight();
00144 
00151         IMPORT_C TInt VirtualVisibleTop();
00152 
00159         IMPORT_C TBool IsCursorLocation(TMsgCursorLocation aLocation) const;
00160 
00171         IMPORT_C TInt ScrollL( TInt aPixelsToScroll, TMsgScrollDirection aDirection );
00172         
00179         IMPORT_C void NotifyViewEvent( TMsgViewEvent aEvent, TInt aParam );
00180 
00181     public: // from CCoeControl
00182 
00183         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00184 
00185     private: // Helper methods.
00186 
00192         void ApplyLabelFormat(TCharFormat& aFormat, TCharFormatMask& aMask);
00193 
00199         void ApplyValueFormat(TCharFormat& aFormat, TCharFormatMask& aMask);
00200 
00207         void ApplyFormat(TCharFormat& aFormat, TCharFormatMask& aMask, TBool aIsLabel);
00208 
00214         void AddItemToRichTextL(const TDesC& aLabel, const TDesC& aValue);
00215 
00222         void AppendTextL( const TDesC& aText,
00223             const TCharFormat& aFormat,
00224             const TCharFormatMask& aMask );
00225 
00230         TBool CacheExists();
00231 
00235         void LoadFromCacheL();
00236 
00242         void CacheItemL(const TDesC& aLabel, const TDesC& aValue);
00243 
00248         static void Panic( TInt aPanic );
00249 
00250 
00251 
00252     private:
00253 
00257         CRichBio();
00258 
00262         CRichBio(const CRichBio& aSource);
00263 
00267         const CRichBio& operator=(const CRichBio& aSource);
00268 
00269     private: // from CCoeControl
00270 
00271         void Draw(const TRect& aRect) const;
00272 
00273         TInt CountComponentControls() const;
00274 
00275         CCoeControl* ComponentControl(TInt aIndex) const;
00276 
00277         void SizeChanged();
00278 
00279     private:
00280 
00282         class CEdwinSizeObserver;
00283 
00285         friend class CEdwinSizeObserver;
00286 
00288         CEdwinSizeObserver* iEdwinSizeObserver;
00289 
00291         CMsgExpandableControlEditor* iEditor;
00292 
00294         TInt iVirtualHeight;
00295 
00296         // startup cache for data
00297         CDesC16ArrayFlat* iLabelCache;
00298 
00299         // startup cache for data
00300         CDesC16ArrayFlat* iValueCache;
00301 
00302         // Editor Base mode on or off.
00303         const TRichBioMode iMode;
00304 
00306         TBool iIsFirstItem;
00307 
00308     private:
00309         friend class T_RichBioTestSuite;
00310     };
00311 
00312 //_CRICHBIO_H_
00313 #endif
00314 
00315 // end of file

Copyright © Nokia Corporation 2001-2008
Back to top