eikfrlbd.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : Eikfrlbd.h
00004 *  Part of     : Avkon
00005 *  Description : 
00006 *  Version     : 
00007 *
00008 *  Copyright © 2002-2006 Nokia.  All rights reserved.
00009 *  This material, including documentation and any related computer
00010 *  programs, is protected by copyright controlled by Nokia.  All
00011 *  rights are reserved.  Copying, including reproducing, storing,
00012 *  adapting or translating, any or all of this material requires the
00013 *  prior written consent of Nokia.  This material also contains
00014 *  confidential information which may not be disclosed to others
00015 *  without the prior written consent of Nokia.
00016 * ============================================================================
00017 */
00018 
00019 //
00020 // EIKFRLBD.H
00021 //
00022 // Copyright (c) 2001 Symbian Ltd.  All rights reserved.
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> // for TAknsQsnTextColorsIndex
00034 #include <babitflags.h>    // for TBitFlags32
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     //INNER CLASS DECLARATION
00097     /*
00098      * A container class for storage of colour values.                           
00099      * Used by @c CFormattedCellListBoxData.
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 // __WINS__
00621 #endif
00622 
00627     void FocusGained();
00628 
00634     void FocusLost();
00635     
00641     void HandleResourceChange( TInt aType );
00642     
00651     IMPORT_C const CAknsEffectAnim* HighlightAnim() const;
00652 
00658     IMPORT_C void AboutToDrawHighlightAnim() const;
00659 
00667     IMPORT_C void SetHighlightAnimBackgroundDrawer( 
00668                                        MListBoxAnimBackgroundDrawer* aDrawer );
00669 
00677     IMPORT_C void SetItemCellSize( const TSize& aSize );
00678 
00684     IMPORT_C TBool HasHighlightAnim() const;
00709     IMPORT_C TBool DrawHighlightAnim( CBitmapContext& aGc, const TRect& aRect ) const;
00715     void CreatePictographInterfaceL();
00716 
00721     void CreateMarqueeControlL();
00722 
00726     void ResetMarquee();
00727 
00733     TInt CurrentMarqueeItemIndex();
00734     
00740     void SetCurrentMarqueeItemIndex(TInt aIndex);
00741 
00750     void SetCurrentItemIndex(TInt aIndex);
00751 
00752     // previous method was used both as current item index AND as currently
00753     // drawn item index. Not really good idea.
00754     void SetCurrentlyDrawnItemIndex( TInt aIndex );
00755 
00763     IMPORT_C void SetSubCellFontForRowL(TInt aRowIndex, 
00764                                         TInt aSubCellIndex, 
00765                                         const CFont* aFont);
00766 
00774     IMPORT_C const CFont* RowAndSubCellFont(TInt aRow, 
00775                                             TInt aSubCellIndex) const;
00776 
00783     IMPORT_C void SetDrawBackground(const TBool aDrawBackground);
00784 
00791     TBool IsBackgroundDrawingEnabled() const;
00792 
00799     void SetDrawScrollbarBackground(const TBool aDrawBackground);
00800 
00807     TBool IsScrollbarBackgroundDrawingEnabled() const;
00808 
00814     IMPORT_C void SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition);
00815 
00821     IMPORT_C TAknSeparatorLinePosition SeparatorLinePosition() const;
00822 
00831     IMPORT_C CAknLayoutData* LayoutData() const;
00832 
00842     IMPORT_C TBool LayoutInit() const;
00843     
00853     IMPORT_C void SetLayoutInit(TBool aValue);
00854 
00864     IMPORT_C void SetSubcellUnderlined( TBitFlags32 aUnderlinedCells );
00865 
00877     void UseHighlightIconSwapping( TBool aUse );
00878     TBool UseHighlightIconSwapping() const;
00879 
00880     // next methods are only used inside the drawing algorithm.
00881     // The set methods are also const because they do not change observable behavior of the system.
00882     TSize SubCellRealSize(TInt aSubCellIndex) const;
00883     void SetSubCellRealSize(TInt aSubCellIndex, TSize aRealSize) const;
00884     //
00885     TSize SubCellRealTextSize(TInt aSubCellIndex) const;
00886     void SetSubCellRealTextSize(TInt aSubCellIndex, TSize aRealSize) const;
00887     
00888 
00889     struct SSubCell
00890         {
00891         SSubCell() { }
00892         TInt iSubCell; // Must be first entry
00893         
00894         TInt iWidth;
00895         TMargins iMargin;
00896         const CFont* iBaseFont;
00897         TInt iActualFontIndex;
00898         TBool iGraphics;
00899         TBool iTransparent;
00900         TBool iNotAlwaysDrawn;
00901         CGraphicsContext::TTextAlign iAlign;
00902         CGraphicsContext::TPenStyle iRightSeparatorStyle;
00903         
00904         TPoint iPosition;
00905         TInt iBaseline;
00906         TSize iSize;
00907 
00908         TBool iUseSubCellColors; // this is set if someone calls SetSubCellColorsL()
00909         TColors iColors;
00910         TInt iTextClipGap;
00911 
00912         TBool iNumberCell;
00913         // the next ones change during drawing algorithm
00914         __MUTABLE TSize iRealSize;
00915         __MUTABLE TSize iRealTextSize;
00916         };
00917 
00918 protected:
00919 
00923     IMPORT_C CFormattedCellListBoxData();
00924 
00929     IMPORT_C void ConstructLD();
00930 
00938     IMPORT_C void ConstructLD(const TAknsItemID& aAnimationIID);
00939 
00955     IMPORT_C void DrawFormatted(TListItemProperties aProperties,
00956                                 CWindowGc& aGc,
00957                                 const TDesC* aText,
00958                                 const TRect& aRect,
00959                                 TBool aHighlight,
00960                                 const TColors& aColors) const;
00961 
00973     void DrawFormattedSimple( TListItemProperties& aProperties,
00974                               CWindowGc& aGc,
00975                               const TDesC* aText,
00976                               const TRect& aRect,
00977                               TBool aHighlight,
00978                               const TColors& aColors ) const;
00979 private:
00983     void DrawFormattedOld( TListItemProperties& aProperties,
00984                            CWindowGc& aGc,
00985                            const TDesC* aText,
00986                            const TRect& aItemRect,
00987                            TBool aHighlight,
00988                            const TColors& aColors ) const;
00989 
00993     void BitBltColored( CWindowGc&      aGc,
00994                         TBool           aHighlight,
00995                         const CGulIcon* aIcon,
00996                         TInt            aSubcell,
00997                         TBool           aColorIcon,
00998                         const TRect&    aGraphicRect ) const;
00999 
01000 
01001 public:
01015     IMPORT_C void SetMarqueeParams(const TInt aLoops,
01016                                    const TInt aScrollAmount, 
01017                                    const TInt aScrollDelay, 
01018                                    const TInt aInterval);
01019 
01020 
01024     void SetClippedByWrap( TUint32 aClippedCells, TBool aUseClippedByWrap );
01025             
01031     IMPORT_C TUint32 CurrentItemTextWasClipped() const;
01032 
01033 protected: // non-exported!
01034 
01041     CFormattedCellListBoxDataExtension* Extension();
01042 
01049     CFormattedCellListBoxDataExtension* Extension() const;
01050 
01051 public:
01060     void DrawDefaultHighlight(CWindowGc &aGc,
01061                               const TRect &aItemRect,
01062                               TBool aHighlight) const;
01063 
01072     void DrawSettingHighlight(CWindowGc &aGc,
01073                               const TRect &aItemRect,
01074                               TBool aHighlight) const;
01075 
01084     void DrawPopupHighlight(CWindowGc &aGc,
01085                             const TRect &aItemRect,
01086                             TBool aHighlight) const;
01087 
01093     void DrawPopupFrame(CWindowGc &aGc) const;
01094 
01101     void SetWordWrappedSubcellIndices( TInt aFirstIndex, TInt aSecondIndex );
01102 
01110     IMPORT_C void SetSubCellIconSize(TInt aIndex, TSize aSize);
01111 
01119     TSize GetSubCellIconSize(TInt aIndex);
01120 
01127     void SetupSkinContextL();
01128 
01136     void SetESSTextColor( TAknsQsnTextColorsIndex aIndex );
01137 
01145     void SetESSHighlightedTextColor( TAknsQsnTextColorsIndex aIndex );
01146 
01154     void SetGraphicSubCellL(TInt aSubCell, const TAknWindowLineLayout& aGraphicLayout);
01155     
01165     void SetTextSubCellL(TInt aSubCell,const TAknTextLineLayout& aTextLayout);
01166 
01167 
01179     void SetConditionalSubCellL(TInt aSubCell,
01180                                 const TAknTextLineLayout& aTextLayout,
01181                                 TInt aAffectedSubCell);
01182 
01188     TBool UsesScalableLayoutData() const;
01192     void  UseScalableLayoutData( TBool aUse );
01193         
01197     void SetStretchableGraphicSubCellL(TInt aSubCell, 
01198                                        const TAknWindowComponentLayout& aNormalLayout, 
01199                                        const TAknWindowComponentLayout& aStretchedLayout);
01203     void SetStretchableTextSubCellL(TInt aSubCell,                                      
01204                                        const TAknTextComponentLayout& aNormalLayout, 
01205                                        const TAknTextComponentLayout& aStretchedLayout);
01209     void SetStretchableConditionalSubCellL(TInt aSubCell,
01210                                            const TAknTextComponentLayout& aNormalLayout,
01211                                            const TAknTextComponentLayout& aStretchedLayout,
01212                                            TInt aNormalSubCell,
01213                                            TInt aStretchedSubCell );
01217     void ResetSLSubCellArray();                                           
01218 
01222     void EnableStretching(const TBool aEnabled);
01226     TBool StretchingEnabled() const;
01230     void HideSecondRow(const TBool aHide);
01234     TBool SecondRowHidden() const;
01238     void SubCellsMightIntersect( const TBool aMightIntersect );
01239 
01240     // Drop shadows can be toggled on/off in
01241     // "transparent" lists (eg. transparent camera setting page).
01242     // ETrue = on, EFalse = off
01246     void ToggleDropShadows( const TBool aEnable );
01247 
01248 private:
01249     void DoConstructL( const TAknsItemID& aAnimationIID );
01250 
01251     const TColors &Colors(TInt aItemIndex, TInt aSubCell) const;
01252     TInt LastSubCell() const;
01253     void AddSubCellL(TInt aSubCell);
01254     SSubCell& At(TInt aArrayIndex);
01255     const SSubCell& At(TInt aArrayIndex) const;
01256     TInt FindSubCellIndex(TInt& aArrayIndex,TInt aSubCell) const;
01257     void FindSubCellIndexOrAddL(TInt& aArrayIndex,TInt aSubCell);
01258     TInt AddActualFontL(const CFont* aBaseFont);
01259     void SetUnderlineStyle( TListItemProperties aProperties, CWindowGc& aGc, TInt aSubCell ) const;
01260     void CheckIfSubCellsIntersect( TAknTextLineLayout* aLayouts, TBool* aResults, const TDesC& aText, const TRect& aItemRect ) const;
01261 
01262 private:
01263     CArrayFix<SSubCell>* iSubCellArray;
01264     CArrayPtr<CGulIcon>* iIconArray;
01265     friend class CFormattedCellListBoxItemDrawer; // this is for "lastsubcell" -access.
01266     TColors defaultcolors;
01267     CFormattedCellListBoxDataExtension *iExtension; 
01268     };
01269 
01270 // CLASS DECLARATION
01278 class CSettingItemEditingListBoxData : public CFormattedCellListBoxData
01279     {
01280 public:
01281     IMPORT_C static CSettingItemEditingListBoxData* NewL();
01282     IMPORT_C virtual void Draw(TListItemProperties aProperties,
01283                    CWindowGc& aGc,
01284                    const TDesC* aText,
01285                    const TRect& aRect,
01286                    TBool aHighlight,
01287                    const TColors& aColors) const;
01288     };
01289 
01290 // CLASS DECLARATION
01298 class CFormGraphicListBoxData : public CFormattedCellListBoxData
01299     {
01300 public:
01301     IMPORT_C static CFormGraphicListBoxData* NewL();
01302     IMPORT_C virtual void Draw(TListItemProperties aProperties,
01303                    CWindowGc& aGc,
01304                    const TDesC* aText,
01305                    const TRect& aRect,
01306                    TBool aHighlight,
01307                    const TColors& aColors) const;
01308     };
01309 
01310 
01311 // CLASS DECLARATION
01319 class CPopupFormattedListBoxData : public CFormattedCellListBoxData
01320     {
01321 public:
01322     IMPORT_C static CPopupFormattedListBoxData* NewL();
01323     IMPORT_C virtual void Draw(TListItemProperties aProperties,
01324                    CWindowGc& aGc,
01325                    const TDesC* aText,
01326                    const TRect& aRect,
01327                    TBool aHighlight,
01328                    const TColors& aColors) const;
01329     };
01330 
01337 class CFormattedCellGridData : public CFormattedCellListBoxData
01338     {
01339 
01340 public:
01341 
01345     IMPORT_C static CFormattedCellGridData* NewL();
01346  
01360     IMPORT_C virtual void Draw(TListItemProperties aProperties,
01361                                CWindowGc& aGc,
01362                                const TDesC* aText,
01363                                const TRect& aRect,
01364                                TBool aHighlight,
01365                                const TColors& aColors) const;
01366     };
01367 
01368 // __EIKFRLBD_H__
01369 #endif
01370 

Copyright © Nokia Corporation 2001-2008
Back to top