00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _CRICHBIO_H_
00024 #define _CRICHBIO_H_
00025
00026
00027
00028 #include <coecntrl.h>
00029 #include <badesca.h>
00030 #include <txtfrmat.h>
00031 #include <MsgEditor.hrh>
00032
00033
00034
00040 enum TRichBioMode
00041 {
00042 ERichBioModeEditorBase,
00043 ERichBioModeStandard
00044 };
00045
00046
00047
00048 class CEikRichTextEditor;
00049 class CMsgExpandableControlEditor;
00050
00056 class CRichBio : public CCoeControl
00057 {
00058 public:
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:
00091
00095 ~CRichBio();
00096
00097 public:
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:
00182
00183 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00184
00185 private:
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:
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
00297 CDesC16ArrayFlat* iLabelCache;
00298
00299
00300 CDesC16ArrayFlat* iValueCache;
00301
00302
00303 const TRichBioMode iMode;
00304
00306 TBool iIsFirstItem;
00307
00308 private:
00309 friend class T_RichBioTestSuite;
00310 };
00311
00312
00313 #endif
00314
00315