aknlayoutfont.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : CAknLayoutFont.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *   Interface for Series 60 font type, incorporating principles of series 60 layout
00008 *
00009 *  Version:
00010 *
00011 *  Copyright © 2004 Nokia Corporation.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia Corporation. All rights are reserved. Copying, 
00015 *  including reproducing, storing,  adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia Corporation. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia Corporation.
00020 * ============================================================================
00021 */
00022    
00023 #ifndef AKNLAYOUTFONT_H
00024 #define AKNLAYOUTFONT_H
00025 
00026 #include <gdi.h>
00027 #include <fbs.h>
00028 #include <AknFontSpecification.h>
00029 #include <AknTextDecorationMetrics.h>
00030 
00031 class CBitmapDevice;
00032 
00047 NONSHARABLE_CLASS(CAknLayoutFont) : public CFbsFont
00048     {
00049 
00050 public:
00054     virtual ~CAknLayoutFont();
00055 
00056 public: // New functions
00065     IMPORT_C void Update();
00066 
00073     IMPORT_C TInt MaxAscent() const;
00074 
00081     IMPORT_C TInt MaxDescent() const;
00082 
00083     /*
00084     * Position of the baseline measured down from the Series 60 layout text pane top
00085     *
00086     * @return distance from text pane top to baseline
00087     */
00088     IMPORT_C TInt TextPaneTopToBaseline() const;
00089     
00090     /*
00091     * Position of the text pane bottom measured down from the baseline
00092     *
00093     * @return distance from text pane top to baseline
00094     */
00095     IMPORT_C TInt BaselineToTextPaneBottom() const;
00096 
00097     /*
00098     * Series 60 text pane height. 
00099     * Always equal to TextPaneTopToBaseline() + BaselineToTextPaneBottom()
00100     *
00101     * @return text pane height
00102     */
00103     IMPORT_C TInt TextPaneHeight() const;
00104 
00109     TInt AscentForCharacter( TChar aCharacter ) const; 
00110 
00116     IMPORT_C static const CAknLayoutFont* AsCAknLayoutFontOrNull( const CFont* aFont );
00117 
00123     IMPORT_C TAknTextDecorationMetrics TextDecorationMetrics() const;
00124 
00131     IMPORT_C TAknFontCategory FontCategory() const;
00132 
00138     IMPORT_C TAknFontSpecification FontSpecification() const;
00139     
00140 public: // Functions from CFont
00141      
00142 public:// Functions from CFbsFont
00143 
00144     TFontSpec DoFontSpecInTwips() const;
00145 
00146 protected:
00150     CAknLayoutFont( CBitmapDevice& aScreenDevice );
00151     CBitmapDevice& BitmapDevice() const;
00152 
00153 protected: // Internal methods
00154 
00155     void SetExcessAscent( TInt aExcessAscent );
00156     void SetExcessDescent( TInt aExcessDescent );
00157     void SetBottomShortfall( TInt aBottomShortfall );
00158     void SetTextPaneHeight( TInt aTextPaneHeight );
00159 
00160 private: // New Framework methods
00161     virtual CFbsFont* SupplyFont() = 0;
00162     virtual TInt DoAscentForCharacter( TChar aCharacter ) const;
00163     virtual TAknTextDecorationMetrics DoTextDecorationMetrics() const = 0;
00164     virtual TAknFontSpecification DoFontSpecification() const = 0;
00165     virtual void CAknLayoutFont_Reserved_1();
00166 
00167 private:
00168     void Register();
00169     void Deregister();
00170 
00171 private:
00172 
00173     CFbsFont* iNonDynamicFont;
00174     CBitmapDevice& iScreenDevice;
00175     TInt iExcessAscent;
00176     TInt iExcessDescent;
00177     TInt iBottomShortfall;
00178     TInt iTextPaneHeight;
00179     TInt iSpare;
00180     };
00181 
00182 
00183 //AKNLAYOUTFONT_H
00184 #endif

Copyright © Nokia Corporation 2001-2008
Back to top