eikclbd.h

Go to the documentation of this file.
00001 // EIKCLBD.H
00002 //
00003 // Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
00004 //
00005 #if !defined(__EIKCLBD_H__)
00006 #define __EIKCLBD_H__
00007 
00008 #include <e32base.h>
00009 #include <gdi.h>
00010 
00011 #include <eiklbd.h>
00012 #include <avkon.hrh>
00013 #include <babitflags.h>    // for TBitFlags32
00014 
00015 class CWindowGc;
00016 class CGulIcon;
00017 class CColumnListBoxDataExtension;
00018 class MAknsControlContext;
00019 class CCoeControl;
00020 class TAknsItemID;
00021 class CAknsEffectAnim;
00022 class CAknsListBoxBackgroundControlContext;
00023 class CAknLayoutData;
00024 class TAknWindowLineLayout;
00025 class TAknTextLineLayout;
00026 class TAknWindowComponentLayout;
00027 class TAknTextComponentLayout;
00028 class MAknsSkinInstance;
00029 
00038 class MColumnListBoxAnimBackgroundDrawer
00039     {
00040     public:
00041 
00050         virtual TBool DrawHighlightAnimBackground( CFbsBitGc& aGc ) const = 0;
00051     };
00052 
00067 class CColumnListBoxData : public CListBoxData
00068     {
00069     friend class CColumnListBoxDataExtension;
00070 public:
00071 
00078     class TColors
00079         {
00080     public:
00081 
00085         IMPORT_C TColors();
00086     public:
00087 
00091         TRgb iText;
00092 
00096         TRgb iBack;
00097 
00101         TRgb iHighlightedText;
00102 
00106         TRgb iHighlightedBack;
00107         };
00108 
00109 public:
00110 
00120     IMPORT_C static CColumnListBoxData* NewL();
00121     
00125     IMPORT_C ~CColumnListBoxData();
00126 
00127 public:
00128 
00135     IMPORT_C TInt LastColumn() const;
00136     
00144     IMPORT_C TInt ColumnWidthPixel(TInt aColumn) const;
00145 
00155     IMPORT_C void SetColumnWidthPixelL(TInt aColumn,TInt aWidth);
00156     
00160     IMPORT_C TInt ColumnHorizontalGap(TInt aColumn) const;
00161 
00165     IMPORT_C void SetColumnHorizontalGapL(TInt aColumn,TInt aGap);
00166 
00173     IMPORT_C TInt ColumnBaselinePos(TInt aColumn) const;
00174 
00181     IMPORT_C void SetColumnBaselinePosL(TInt aColumn,TInt aPos);
00182 
00189     IMPORT_C TMargins ColumnMargins(TInt aColumn) const;
00190     
00197     IMPORT_C void SetColumnMarginsL(TInt aColumn,TMargins aMargins);
00198     
00205     IMPORT_C const CFont* ColumnFont(TInt aColumn) const;
00206 
00213     IMPORT_C void SetColumnFontL(TInt aColumn,const CFont* aFont);
00214 
00223     IMPORT_C CGraphicsContext::TTextAlign ColumnAlignment(TInt aColumn) const;
00224     
00234     IMPORT_C void SetColumnAlignmentL(TInt aColumn,
00235                                       CGraphicsContext::TTextAlign aAlign);
00236 
00240     IMPORT_C CGraphicsContext::TPenStyle ColumnSeparatorStyle(
00241                                                         TInt aColumn) const;
00245     IMPORT_C void SetColumnSeparatorStyleL(TInt aColumn, 
00246                                            CGraphicsContext::TPenStyle aStyle);
00247 
00254     IMPORT_C TBool ColumnIsOptional(TInt aColumn) const;
00255     
00262     IMPORT_C void SetOptionalColumnL(TInt aColumn,TBool aIsOptional);
00263 
00270     IMPORT_C TBool ColumnIsGraphics(TInt aColumn) const;
00271 
00278     IMPORT_C void SetGraphicsColumnL(TInt aColumn,TBool aIsGraphics);
00279 
00286     IMPORT_C TBool ColumnIsNumber(TInt aColumn) const;
00287 
00294     IMPORT_C void SetNumberColumnL(TInt aColumn,TBool aIsNumber);
00295 
00303     IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
00304 
00310     IMPORT_C void SetIconArray(CArrayPtr<CGulIcon>* aArray);
00311 
00319     IMPORT_C TInt ColumnTextClipGap(TInt aSubCellIndex) const;
00320     
00327     IMPORT_C void SetColumnTextClipGapL(TInt aSubCellIndex, TInt aSize);
00328     
00338     IMPORT_C CFont* Font(const TListItemProperties& aItemProperties, 
00339                          TInt aColumn) const;
00340 
00350     IMPORT_C TBool MakeColumnRect( TInt aColumn, TRect& aRect );
00351 
00369     IMPORT_C virtual void Draw(const TListItemProperties& aItemProperties, 
00370                                CWindowGc& aGc,
00371                                const TDesC* aText,
00372                                const TRect& aRect,
00373                                TBool aHighlight,
00374                                const TColors& aColors) const;
00375                                
00379     void DrawSimple(const TListItemProperties& aItemProperties, CWindowGc& aGc,const TDesC* aText,const TRect& aRect,TBool aHighlight,const TColors& aColors) const;
00385     IMPORT_C void SetSeparatorLinePosition(
00386                                         TAknSeparatorLinePosition aPosition);
00387 
00393     IMPORT_C TAknSeparatorLinePosition SeparatorLinePosition() const;
00394 
00403     IMPORT_C CAknLayoutData *LayoutData() const;
00404     
00413     IMPORT_C TBool LayoutInit() const;
00414     
00423     IMPORT_C void SetLayoutInit(TBool aValue) const;
00424 
00435     IMPORT_C void SetColumnUnderlined( TBitFlags32 aUnderlinedColumns );
00436 
00437 private:
00438     struct SColumn
00439         {
00440         TInt iColumn; // Must be first entry
00441         TInt iWidth;
00442         TMargins iMargins;
00443         TInt iVerticalCap;
00444         const CFont* iBaseFont;
00445         TInt iActualFontIndex;
00446         TBool iGraphics;
00447     TBool iOptional;
00448     TInt iBaseline;
00449         CGraphicsContext::TTextAlign iAlign;
00450     CGraphicsContext::TPenStyle iSeparator;
00451     TInt iTextClipGap;
00452     TBool iNumberColumn;
00453     // the next are for storing x-coordinates of a column for the drawing algorithm.
00454     __MUTABLE TInt iX;
00455     __MUTABLE TInt iEndX;
00456         };
00457 protected:
00458 
00462     IMPORT_C CColumnListBoxData();
00463 
00470     IMPORT_C void ConstructLD();
00471 
00480     IMPORT_C void ConstructLD( const TAknsItemID& aAnimationIID );
00481 
00482 private:
00483     
00484     IMPORT_C TInt ColumnX(TInt aColumn) const;
00485     IMPORT_C void SetColumnXL(TInt aColumn,TInt aX) const; // note, const! (do not affect external state)
00486     //
00487     IMPORT_C TInt ColumnEndX(TInt aColumn) const;
00488     IMPORT_C void SetColumnEndXL(TInt aColumn,TInt aEndX) const; // note, Const!
00489 
00490     void AddColumnL(TInt aColumn);
00491     SColumn& At(TInt aArrayIndex);
00492     const SColumn& At(TInt aArrayIndex) const;
00493     TBool FindColumnIndex(TInt& aArrayIndex,TInt aColumn) const;
00494     void FindColumnIndexOrAddL(TInt& aArrayIndex,TInt aColumn);
00495     TInt AddActualFontL(const CFont* aBaseFont);
00496     void SetUnderlineStyle( TListItemProperties aProperties, CWindowGc& aGc, TInt aColumn ) const;
00497     void DoConstructL( const TAknsItemID& aAnimationIID );
00498 public:
00499 
00505     IMPORT_C CCoeControl *Control() const;
00506     
00513     IMPORT_C void SetControl(CCoeControl *aControl);
00514     
00520     IMPORT_C MAknsControlContext* SkinBackgroundContext() const;
00521     
00527     void SetSkinBackgroundContext(
00528                     CAknsListBoxBackgroundControlContext *aContext); 
00529                     // takes ownership
00530     
00537     IMPORT_C void SetSkinStyle(const TAknsItemID *aId, 
00538                                const TRect &aTileRect);
00539 
00546     IMPORT_C void SetListEndSkinStyle(const TAknsItemID *aId, 
00547                                       const TRect &aRect);
00548 
00555     IMPORT_C void SetSkinHighlightFrame(const TAknsItemID *aFrameId, 
00556                                         const TAknsItemID *aFrameCenterId);
00557 
00564     IMPORT_C void SetSkinEnabledL(TBool aEnabled);
00565     
00569     void CreatePictographInterfaceL();
00570 
00574     void CreateMarqueeControlL();
00575     
00579     void ResetMarquee();
00580     
00586     TInt CurrentMarqueeItemIndex();
00587     
00593     void SetCurrentMarqueeItemIndex(TInt aIndex);
00594     
00600     IMPORT_C void EnableMarqueeL(TBool aEnable); 
00601 
00609     IMPORT_C void SetColumnFontForRowL(TInt aRow, 
00610                                        TInt aColumn, 
00611                                        const CFont* aFont);
00612 
00620     IMPORT_C const CFont* RowAndColumnFont(TInt aRow,TInt aColumn) const;
00621 
00631     void SetCurrentItemIndex(TInt aIndex);
00632 
00640     IMPORT_C void SetSubCellIconSize(TInt aIndex, TSize aSize);
00641 
00648     TSize GetSubCellIconSize(TInt aIndex);
00649 
00659     IMPORT_C const CAknsEffectAnim* HighlightAnim() const;
00660     
00668     IMPORT_C void AboutToDrawHighlightAnim() const;
00669     
00678     IMPORT_C void SetHighlightAnimBackgroundDrawer( 
00679                                 MColumnListBoxAnimBackgroundDrawer* aDrawer );
00680 
00689     IMPORT_C void SetItemCellSize( const TSize& aSizeInPixels );
00690     
00696     IMPORT_C TBool HasHighlightAnim() const;
00721     IMPORT_C TBool DrawHighlightAnim( CBitmapContext& aGc, const TRect& aRect ) const;
00722 
00723     void FocusGained();
00724     
00729     void FocusLost();
00730     
00736     void HandleResourceChange( TInt aType );
00737     
00742     void SetupSkinContextL();
00743     
00749     void SetESSTextColor(TRgb aTextColor);
00750     
00756     void SetESSHighlightedTextColor(TRgb aHighlightedTextColor);
00757 
00758     IMPORT_C void SetGraphicSubCellL(TInt aSubCell,const TAknWindowLineLayout &aGraphicLayout);
00759     IMPORT_C void SetTextSubCellL(TInt aSubCell,const TAknTextLineLayout &aTextLayout);
00760     IMPORT_C void SetConditionalSubCellL(TInt aSubCell, const TAknTextLineLayout &aTextLayout,TInt aAffectedSubCell);
00761     IMPORT_C void SubCellsMightIntersect( const TBool aMightIntersect );
00762 
00763     IMPORT_C void SetStretchableGraphicSubCellL(TInt aSubCell, 
00764         const TAknWindowComponentLayout& aNormalLayout, 
00765         const TAknWindowComponentLayout& aStretchedLayout);
00766     IMPORT_C void SetStretchableTextSubCellL(TInt aSubCell,                                      
00767         const TAknTextComponentLayout& aNormalLayout, 
00768         const TAknTextComponentLayout& aStretchedLayout);
00769     IMPORT_C void SetStretchableConditionalSubCellL(TInt aSubCell,
00770         const TAknTextComponentLayout& aNormalLayout,
00771         const TAknTextComponentLayout& aStretchedLayout,
00772         TInt aNormalSubCell,
00773         TInt aStretchedSubCell );
00774     IMPORT_C void ResetSLSubCellArray();                                           
00775     TBool UsesScalableLayoutData() const;
00776     void EnableStretching(const TBool aEnabled);
00777     IMPORT_C TBool StretchingEnabled() const;
00778 protected:
00779     
00798     IMPORT_C void DrawText(CWindowGc& aGc, 
00799                            const TRect& aTextRect, 
00800                            const TDesC& aText, 
00801                            const TDesC& aClippedText, 
00802                            const TInt aBaselineOffset,
00803                            const CGraphicsContext::TTextAlign aAlign, 
00804                            const CFont& aFont,
00805                            const TBool aHighlight, 
00806                            const TBool aIsTextClipped) const;
00807 
00808 public:
00821     IMPORT_C void SetMarqueeParams(const TInt aLoops, 
00822                                    const TInt aScrollAmount, 
00823                                    const TInt aScrollDelay);
00824 
00834     IMPORT_C void SetMarqueeParams(const TInt aLoops, 
00835                                    const TInt aScrollAmount, 
00836                                    const TInt aScrollDelay, 
00837                                    const TInt aInterval);                        
00843     IMPORT_C TUint32 CurrentItemTextWasClipped() const;
00844         
00845 private:
00846     void DrawHighLight( CWindowGc& aGc, const TRect& aRect,
00847                         TBool aHighlight,
00848                         MAknsSkinInstance* aSkin ) const;
00849         
00850     void CheckIfSubCellsIntersect( TAknTextLineLayout* aLayouts,
00851                                    TBool* aResults, const TDesC& aText,
00852                                    const TRect& aItemRect ) const;
00856     void BitBltColored( CWindowGc&      aGc,
00857                         TBool           aHighlight,
00858                         const CGulIcon* aIcon,
00859                         TInt            aSubcell,
00860                         TBool           aColorIcon,
00861                         const TRect&    aGraphicRect ) const;
00862 
00863 
00864         
00865 private:
00866     CArrayFix<SColumn>* iColumnArray;
00867     CColumnListBoxDataExtension *iExtension;
00868     };
00869 
00870 // __EIKCLBD_H__
00871 #endif
00872 
00873 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top