00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined(__EIKFRLBD_H__)
00025 #define __EIKFRLBD_H__
00026
00027 #include <e32base.h>
00028 #include <gdi.h>
00029
00030 #include <eiklbd.h>
00031 #include <eikfrlb.h>
00032 #include <avkon.hrh>
00033 #include <aknsdrawutils.h>
00034 #include <babitflags.h>
00035
00036 class CWindowGc;
00037 class CGulIcon;
00038 class CFormattedCellListBoxDataExtension;
00039 class MAknsControlContext;
00040 class TAknsItemID;
00041 class CAknLayoutData;
00042 class CAknsEffectAnim;
00043 class TAknTextLineLayout;
00044 class TAknWindowLineLayout;
00045 class TAknTextComponentLayout;
00046 class TAknWindowComponentLayout;
00047
00056 class MListBoxAnimBackgroundDrawer
00057 {
00058 public:
00063 virtual TBool DrawHighlightAnimBackground( CFbsBitGc& aGc ) const = 0;
00064 };
00065
00090 class CFormattedCellListBoxData : public CListBoxData
00091 {
00092 friend class CFormattedCellListBoxDataExtension;
00093
00094 public:
00095
00096
00097
00098
00099
00100
00101 class TColors
00102 {
00103
00104 public:
00105
00109 IMPORT_C TColors();
00110
00111 public:
00112
00116 TRgb iText;
00117
00121 TRgb iBack;
00122
00126 TRgb iHighlightedText;
00127
00131 TRgb iHighlightedBack;
00132
00139 TRgb iRightSeparatorColor;
00140 };
00141
00142 public:
00143
00149 IMPORT_C static CFormattedCellListBoxData* NewL();
00150
00154 IMPORT_C ~CFormattedCellListBoxData();
00155
00156 public:
00157
00164 IMPORT_C const TColors& SubCellColors(TInt aSubCellIndex) const;
00165
00172 IMPORT_C void SetSubCellColorsL(TInt aSubCellIndex, const TColors &aColors);
00173
00180 IMPORT_C TInt SubCellBaselinePos(TInt aSubCellIndex) const;
00181
00188 IMPORT_C void SetSubCellBaselinePosL(TInt aSubCellIndex, TInt aPos);
00189
00196 IMPORT_C TSize SubCellSize(TInt aSubCellIndex) const;
00197
00204 IMPORT_C void SetSubCellSizeL(TInt aSubCellIndex, TSize aSize);
00205
00212 IMPORT_C TPoint SubCellPosition(TInt aSubCellIndex) const;
00213
00220 IMPORT_C void SetSubCellPositionL(TInt aSubCellIndex, TPoint aPosition);
00221
00229 IMPORT_C TBool SubCellIsTransparent(TInt aSubCellIndex) const;
00230
00237 IMPORT_C void SetTransparentSubCellL(TInt aSubCellIndex,
00238 TBool aIsTransparent);
00239
00248 IMPORT_C TBool SubCellIsNotAlwaysDrawn(TInt aSubCellIndex) const;
00249
00256 IMPORT_C void SetNotAlwaysDrawnSubCellL(TInt aSubCellIndex,
00257 TBool aIsNotAlwaysDrawn);
00258
00265 IMPORT_C TMargins SubCellMargins(TInt aSubCellIndex) const;
00266
00273 IMPORT_C void SetSubCellMarginsL(TInt aSubCellIndex, TMargins aMargins);
00274
00281 IMPORT_C const CFont* SubCellFont(TInt aSubCellIndex) const;
00282
00289 IMPORT_C void SetSubCellFontL(TInt aSubCellIndex, const CFont* aFont);
00290
00297 IMPORT_C CGraphicsContext::TTextAlign SubCellAlignment(TInt aSubCellIndex)
00298 const;
00299
00306 IMPORT_C void SetSubCellAlignmentL(TInt aSubCellIndex,
00307 CGraphicsContext::TTextAlign aAlign);
00308
00317 IMPORT_C TBool SubCellIsGraphics(TInt aSubCellIndex) const;
00318
00327 IMPORT_C void SetGraphicsSubCellL(TInt aSubCellIndex, TBool aIsGraphics);
00328
00335 IMPORT_C CGraphicsContext::TPenStyle
00336 SubCellRightSeparatorStyle(TInt aColumn) const;
00337
00345 IMPORT_C void SetSubCellRightSeparatorStyleL(TInt aSubCell,
00346 CGraphicsContext::TPenStyle aStyle);
00347
00359 IMPORT_C TInt SubCellTextClipGap(TInt aSubCellIndex) const;
00360
00368 IMPORT_C void SetSubCellTextClipGapL(TInt aSubCellIndex, TInt aGap);
00369
00376 IMPORT_C TBool SkinEnabled() const;
00377
00386 IMPORT_C void SetSkinEnabledL(TBool aEnabled);
00387
00395 IMPORT_C TBool SubCellIsNumberCell(TInt aSubCellIndex) const;
00396
00404 IMPORT_C void SetNumberCellL(TInt aSubCellIndex, TBool aIsNumberCell);
00405
00409 IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
00410
00423 IMPORT_C void SetIconArrayL(CArrayPtr<CGulIcon>* aArray);
00424
00437 IMPORT_C void SetIconArray(CArrayPtr<CGulIcon>* aArray);
00438
00446 IMPORT_C CFont* Font(const TListItemProperties& aItemProperties,
00447 TInt aSubCellIndex) const;
00448
00464 IMPORT_C virtual void Draw(TListItemProperties aProperties,
00465 CWindowGc& aGc,
00466 const TDesC* aText,
00467 const TRect& aRect,
00468 TBool aHighlight,
00469 const TColors& aColors) const;
00470
00478 IMPORT_C TBool UseSubCellColors(TInt aSubCell) const;
00479
00487 IMPORT_C CCoeControl* Control() const;
00488
00497 IMPORT_C void SetControl(CCoeControl* aControlOrNull);
00498
00505 IMPORT_C MAknsControlContext* SkinBackgroundContext() const;
00513 IMPORT_C void SetBackgroundSkinStyle(const TAknsItemID *aId,
00514 const TRect &aRect);
00515
00523 IMPORT_C void SetSkinStyle(const TAknsItemID* aId, const TRect& aTileRect);
00524
00531 IMPORT_C void SetSkinParentPos(const TPoint& aPos);
00532
00540 IMPORT_C void SetListEndSkinStyle(const TAknsItemID *listEndId,
00541 const TRect &aRect);
00542
00549 IMPORT_C TBool RespectFocus() const;
00550
00557 IMPORT_C void SetRespectFocus(TBool aBool);
00558
00566 IMPORT_C void SetSkinHighlightFrame(const TAknsItemID* aFrameId,
00567 const TAknsItemID* aFrameCenterId);
00575 IMPORT_C void SetSkinPopupFrame(const TAknsItemID* aFrameId,
00576 const TAknsItemID* aFrameCenterId);
00577
00585 IMPORT_C void SetSkinPopupFramePosition(const TRect& aOuterRect,
00586 const TRect& aInnerRect);
00587
00602 IMPORT_C void UseLogicalToVisualConversion( TBool aUseConversion );
00603
00609 IMPORT_C void EnableMarqueeL(TBool aEnable);
00610
00616 #ifdef __WINS__
00617 IMPORT_C const TBool IsMarqueeOn();
00618 #else
00619 IMPORT_C TBool IsMarqueeOn();
00620 #endif // __WINS__
00621
00626 void FocusGained();
00627
00633 void FocusLost();
00634
00640 void HandleResourceChange( TInt aType );
00641
00650 IMPORT_C const CAknsEffectAnim* HighlightAnim() const;
00651
00657 IMPORT_C void AboutToDrawHighlightAnim() const;
00658
00666 IMPORT_C void SetHighlightAnimBackgroundDrawer(
00667 MListBoxAnimBackgroundDrawer* aDrawer );
00668
00676 IMPORT_C void SetItemCellSize( const TSize& aSize );
00677
00683 IMPORT_C TBool HasHighlightAnim() const;
00708 IMPORT_C TBool DrawHighlightAnim( CBitmapContext& aGc, const TRect& aRect ) const;
00714 void CreatePictographInterfaceL();
00715
00720 void CreateMarqueeControlL();
00721
00725 void ResetMarquee();
00726
00732 TInt CurrentMarqueeItemIndex();
00733
00739 void SetCurrentMarqueeItemIndex(TInt aIndex);
00740
00749 void SetCurrentItemIndex(TInt aIndex);
00750
00751
00752
00753 void SetCurrentlyDrawnItemIndex( TInt aIndex );
00754
00762 IMPORT_C void SetSubCellFontForRowL(TInt aRowIndex,
00763 TInt aSubCellIndex,
00764 const CFont* aFont);
00765
00773 IMPORT_C const CFont* RowAndSubCellFont(TInt aRow,
00774 TInt aSubCellIndex) const;
00775
00782 IMPORT_C void SetDrawBackground(const TBool aDrawBackground);
00783
00790 TBool IsBackgroundDrawingEnabled() const;
00791
00798 void SetDrawScrollbarBackground(const TBool aDrawBackground);
00799
00806 TBool IsScrollbarBackgroundDrawingEnabled() const;
00807
00813 IMPORT_C void SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition);
00814
00820 IMPORT_C TAknSeparatorLinePosition SeparatorLinePosition() const;
00821
00830 IMPORT_C CAknLayoutData* LayoutData() const;
00831
00841 IMPORT_C TBool LayoutInit() const;
00842
00852 IMPORT_C void SetLayoutInit(TBool aValue);
00853
00863 IMPORT_C void SetSubcellUnderlined( TBitFlags32 aUnderlinedCells );
00864
00876 void UseHighlightIconSwapping( TBool aUse );
00877 TBool UseHighlightIconSwapping() const;
00878
00879
00880
00881 TSize SubCellRealSize(TInt aSubCellIndex) const;
00882 void SetSubCellRealSize(TInt aSubCellIndex, TSize aRealSize) const;
00883
00884 TSize SubCellRealTextSize(TInt aSubCellIndex) const;
00885 void SetSubCellRealTextSize(TInt aSubCellIndex, TSize aRealSize) const;
00886
00887
00888 struct SSubCell
00889 {
00890 SSubCell() { }
00891 TInt iSubCell;
00892
00893 TInt iWidth;
00894 TMargins iMargin;
00895 const CFont* iBaseFont;
00896 TInt iActualFontIndex;
00897 TBool iGraphics;
00898 TBool iTransparent;
00899 TBool iNotAlwaysDrawn;
00900 CGraphicsContext::TTextAlign iAlign;
00901 CGraphicsContext::TPenStyle iRightSeparatorStyle;
00902
00903 TPoint iPosition;
00904 TInt iBaseline;
00905 TSize iSize;
00906
00907 TBool iUseSubCellColors;
00908 TColors iColors;
00909 TInt iTextClipGap;
00910
00911 TBool iNumberCell;
00912
00913 __MUTABLE TSize iRealSize;
00914 __MUTABLE TSize iRealTextSize;
00915 };
00916
00917 protected:
00918
00922 IMPORT_C CFormattedCellListBoxData();
00923
00928 IMPORT_C void ConstructLD();
00929
00937 IMPORT_C void ConstructLD(const TAknsItemID& aAnimationIID);
00938
00954 IMPORT_C void DrawFormatted(TListItemProperties aProperties,
00955 CWindowGc& aGc,
00956 const TDesC* aText,
00957 const TRect& aRect,
00958 TBool aHighlight,
00959 const TColors& aColors) const;
00960
00972 void DrawFormattedSimple( TListItemProperties& aProperties,
00973 CWindowGc& aGc,
00974 const TDesC* aText,
00975 const TRect& aRect,
00976 TBool aHighlight,
00977 const TColors& aColors ) const;
00978 private:
00982 void DrawFormattedOld( TListItemProperties& aProperties,
00983 CWindowGc& aGc,
00984 const TDesC* aText,
00985 const TRect& aItemRect,
00986 TBool aHighlight,
00987 const TColors& aColors ) const;
00988
00992 void BitBltColored( CWindowGc& aGc,
00993 TBool aHighlight,
00994 const CGulIcon* aIcon,
00995 TInt aSubcell,
00996 TBool aColorIcon,
00997 const TRect& aGraphicRect ) const;
00998
00999
01000 public:
01014 IMPORT_C void SetMarqueeParams(const TInt aLoops,
01015 const TInt aScrollAmount,
01016 const TInt aScrollDelay,
01017 const TInt aInterval);
01018
01019
01023 void SetClippedByWrap( TUint32 aClippedCells, TBool aUseClippedByWrap );
01024
01030 IMPORT_C TUint32 CurrentItemTextWasClipped() const;
01031
01032 protected:
01033
01040 CFormattedCellListBoxDataExtension* Extension();
01041
01048 CFormattedCellListBoxDataExtension* Extension() const;
01049
01050 public:
01059 void DrawDefaultHighlight(CWindowGc &aGc,
01060 const TRect &aItemRect,
01061 TBool aHighlight) const;
01062
01071 void DrawSettingHighlight(CWindowGc &aGc,
01072 const TRect &aItemRect,
01073 TBool aHighlight) const;
01074
01083 void DrawPopupHighlight(CWindowGc &aGc,
01084 const TRect &aItemRect,
01085 TBool aHighlight) const;
01086
01092 void DrawPopupFrame(CWindowGc &aGc) const;
01093
01100 void SetWordWrappedSubcellIndices( TInt aFirstIndex, TInt aSecondIndex );
01101
01109 IMPORT_C void SetSubCellIconSize(TInt aIndex, TSize aSize);
01110
01118 TSize GetSubCellIconSize(TInt aIndex);
01119
01126 void SetupSkinContextL();
01127
01135 void SetESSTextColor( TAknsQsnTextColorsIndex aIndex );
01136
01144 void SetESSHighlightedTextColor( TAknsQsnTextColorsIndex aIndex );
01145
01153 void SetGraphicSubCellL(TInt aSubCell, const TAknWindowLineLayout& aGraphicLayout);
01154
01164 void SetTextSubCellL(TInt aSubCell,const TAknTextLineLayout& aTextLayout);
01165
01166
01178 void SetConditionalSubCellL(TInt aSubCell,
01179 const TAknTextLineLayout& aTextLayout,
01180 TInt aAffectedSubCell);
01181
01187 TBool UsesScalableLayoutData() const;
01191 void UseScalableLayoutData( TBool aUse );
01192
01196 void SetStretchableGraphicSubCellL(TInt aSubCell,
01197 const TAknWindowComponentLayout& aNormalLayout,
01198 const TAknWindowComponentLayout& aStretchedLayout);
01202 void SetStretchableTextSubCellL(TInt aSubCell,
01203 const TAknTextComponentLayout& aNormalLayout,
01204 const TAknTextComponentLayout& aStretchedLayout);
01208 void SetStretchableConditionalSubCellL(TInt aSubCell,
01209 const TAknTextComponentLayout& aNormalLayout,
01210 const TAknTextComponentLayout& aStretchedLayout,
01211 TInt aNormalSubCell,
01212 TInt aStretchedSubCell );
01216 void ResetSLSubCellArray();
01217
01221 void EnableStretching(const TBool aEnabled);
01225 TBool StretchingEnabled() const;
01229 void HideSecondRow(const TBool aHide);
01233 TBool SecondRowHidden() const;
01237 void SubCellsMightIntersect( const TBool aMightIntersect );
01238
01239
01240
01241
01245 void ToggleDropShadows( const TBool aEnable );
01246
01247
01248
01249
01253 void SetFeedbackForAllItems( TBool aFeedbackForAllItems );
01254
01255
01256
01260 TBool FeedbackForAllItems();
01261
01262 private:
01263 void DoConstructL( const TAknsItemID& aAnimationIID );
01264
01265 const TColors &Colors(TInt aItemIndex, TInt aSubCell) const;
01266 TInt LastSubCell() const;
01267 void AddSubCellL(TInt aSubCell);
01268 SSubCell& At(TInt aArrayIndex);
01269 const SSubCell& At(TInt aArrayIndex) const;
01270 TInt FindSubCellIndex(TInt& aArrayIndex,TInt aSubCell) const;
01271 void FindSubCellIndexOrAddL(TInt& aArrayIndex,TInt aSubCell);
01272 TInt AddActualFontL(const CFont* aBaseFont);
01273 void SetUnderlineStyle( TListItemProperties aProperties, CWindowGc& aGc, TInt aSubCell ) const;
01274 void CheckIfSubCellsIntersect( TAknTextLineLayout* aLayouts, TBool* aResults, const TDesC& aText, const TRect& aItemRect ) const;
01275
01276 private:
01277 CArrayFix<SSubCell>* iSubCellArray;
01278 CArrayPtr<CGulIcon>* iIconArray;
01279 friend class CFormattedCellListBoxItemDrawer;
01280 TColors defaultcolors;
01281 CFormattedCellListBoxDataExtension *iExtension;
01282 };
01283
01284
01292 class CSettingItemEditingListBoxData : public CFormattedCellListBoxData
01293 {
01294 public:
01295 IMPORT_C static CSettingItemEditingListBoxData* NewL();
01296 IMPORT_C virtual void Draw(TListItemProperties aProperties,
01297 CWindowGc& aGc,
01298 const TDesC* aText,
01299 const TRect& aRect,
01300 TBool aHighlight,
01301 const TColors& aColors) const;
01302 };
01303
01304
01312 class CFormGraphicListBoxData : public CFormattedCellListBoxData
01313 {
01314 public:
01315 IMPORT_C static CFormGraphicListBoxData* NewL();
01316 IMPORT_C virtual void Draw(TListItemProperties aProperties,
01317 CWindowGc& aGc,
01318 const TDesC* aText,
01319 const TRect& aRect,
01320 TBool aHighlight,
01321 const TColors& aColors) const;
01322 };
01323
01324
01325
01333 class CPopupFormattedListBoxData : public CFormattedCellListBoxData
01334 {
01335 public:
01336 IMPORT_C static CPopupFormattedListBoxData* NewL();
01337 IMPORT_C virtual void Draw(TListItemProperties aProperties,
01338 CWindowGc& aGc,
01339 const TDesC* aText,
01340 const TRect& aRect,
01341 TBool aHighlight,
01342 const TColors& aColors) const;
01343 };
01344
01351 class CFormattedCellGridData : public CFormattedCellListBoxData
01352 {
01353
01354 public:
01355
01359 IMPORT_C static CFormattedCellGridData* NewL();
01360
01374 IMPORT_C virtual void Draw(TListItemProperties aProperties,
01375 CWindowGc& aGc,
01376 const TDesC* aText,
01377 const TRect& aRect,
01378 TBool aHighlight,
01379 const TColors& aColors) const;
01380 };
01381
01382 #endif // __EIKFRLBD_H__
01383