eiklbd.h

Go to the documentation of this file.
00001 // EIKLBD.H
00002 //
00003 // Copyright (c) 1998-1999 Symbian Ltd.  All rights reserved.
00004 //
00005 
00006 
00007 #if !defined(__EIKLBD_H__)
00008 #define __EIKLBD_H__
00009 
00010 #include <e32base.h>
00011 #include <gdi.h>
00012 #include <w32std.h>
00013 #include <eiklbx.h>
00014 
00015 class TListItemProperties;
00016 class CListBoxDataExtension;
00017 class MAknsControlContext;
00018 
00025 class TListFontBoundValues
00026     {
00027 public:  // Constructors and destructor
00028 
00032         IMPORT_C TListFontBoundValues();
00033 
00034 public:     // Data
00035 
00039         TInt iMaxNormalCharWidthInPixels;
00040 
00044         TInt iHeightInPixels;
00045     };
00046 
00053 class CListBoxData : public CBase
00054     {
00055 
00056     // friend classes
00057     friend class CListItemDrawer;
00058 
00059 public:  // Constructors and destructor
00060 
00064     IMPORT_C CListBoxData();
00065     
00069     IMPORT_C ~CListBoxData();
00070 
00071 public: // New functions
00072 
00079     IMPORT_C void ConstructL(const CFont* aBaseFont);
00080     
00087      IMPORT_C virtual CFont* 
00088             Font(const TListItemProperties& aItemProperties) const;
00089 
00097     IMPORT_C void SetupGc(const TListItemProperties& aItemProperties,
00098                           CWindowGc& aGc) const;
00099 
00105     IMPORT_C const TListFontBoundValues& FontBoundValues() const;
00106 
00113      IMPORT_C TInt SetFontHeight(TInt aFontHeightInTwips);
00114 
00120     IMPORT_C void SetSearchStringL(const TDesC* aSearchString);
00121 
00128     IMPORT_C TBool IsSearchString() const;
00129     
00141     IMPORT_C void DrawItem(CWindowGc& aGc,
00142                            const TRect& aItemTextRect,
00143                            const TDesC& aItemText,
00144                            const CFont& aItemFont,
00145                            const TInt aBaseLineOffset,
00146                            const CGraphicsContext::TTextAlign aAlign = 
00147                                  CGraphicsContext::ELeft) const;
00148 
00154     inline void SetAlignmentL(CGraphicsContext::TTextAlign aAlign);
00155 
00161     inline CGraphicsContext::TTextAlign Alignment() const;
00162 
00169     IMPORT_C MAknsControlContext* SkinBackgroundControlContext() const;
00170 
00171     protected:
00172 
00180     IMPORT_C void 
00181         SetSkinBackgroundControlContextL(MAknsControlContext* aContext);
00182     
00188         IMPORT_C void SetSkinEnabledL(TBool aEnabled);
00189 
00190 protected:
00191 
00192     NONSHARABLE_CLASS(CFontsWithStyle) : public CBase
00193         {
00194 
00195     public:  // Constructors and destructor
00196         
00200         CFontsWithStyle();
00201         
00205         ~CFontsWithStyle();
00206 
00207         public: // new functions
00208 
00212                 IMPORT_C void ReleaseFonts();
00213 
00219                 IMPORT_C TFontStyle FontStyle();
00220 
00226                 IMPORT_C void SetFontStyle(TFontStyle aFontStyle);
00227 
00228     public: // data 
00229 
00235         CArrayPtrFlat<CFont>* iFonts;
00236 
00237     private: // data
00238 
00242         TFontStyle iFontStyle;
00243         };
00244 
00253     IMPORT_C void ConstructFontL(const CFont* aBaseFont, 
00254                                  TFontStyle aFontStyle, 
00255                                  CFontsWithStyle& aFonts);
00256 
00262     IMPORT_C void UpdateFontBoundValues(const CFont& aFont);
00263     
00271     IMPORT_C TInt RegenerateFonts(CFontsWithStyle& aFonts,
00272                                   TInt aFontHeightInTwips);
00273 
00274 protected:
00275 
00279     CFontsWithStyle iNormalFont;
00280     
00284     CFontsWithStyle iBoldFont;
00285     
00289     CFontsWithStyle iItalicFont;
00290     
00294     CFontsWithStyle iBoldItalicFont;
00295     
00299     HBufC* iSearchString;
00300 
00301 private:
00302 
00303     IMPORT_C virtual void Reserved_1();
00304         IMPORT_C virtual void Reserved_2();
00305 
00306 private:
00307 
00308     TListFontBoundValues iFontBoundValues;
00309         CGraphicsContext::TTextAlign iAlign;
00310 
00311 private:
00312 
00313     CListBoxDataExtension* iLBDExtension;
00314     };
00315 
00316 // Inline functions 
00317 inline void CListBoxData::SetAlignmentL(CGraphicsContext::TTextAlign aAlign)
00318         {iAlign=aAlign;}
00319 
00320 inline CGraphicsContext::TTextAlign CListBoxData::Alignment() const
00321         {return iAlign;}
00322 
00323 #endif
00324 
00325 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top