uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifontmanager.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Font manager allows creation, enumeration and management of
       
    15 *                platform fonts in Hitchcock UI Toolkit usage.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef HUIFONTMANAGER_H
       
    22 #define HUIFONTMANAGER_H
       
    23 
       
    24 #include <e32std.h>
       
    25 
       
    26 #include <uiacceltk/huifontspecification.h>
       
    27 
       
    28 /**
       
    29  * THuiFontManager allows user to enumerate all fonts supported by the platform
       
    30  * that can be used in Hitchcock UI Toolkit user interfaces. THuiFontManager also
       
    31  * allows creation of platform supported fonts and manages the lifetime of these
       
    32  * font objects. Fonts are referred to by Hithcock UI Toolkit session specific 
       
    33  * unique IDs.
       
    34  */
       
    35 NONSHARABLE_CLASS(THuiFontManager)
       
    36 {
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Default constructor. Creates the THuiFontManager object.
       
    41      * This is called by CHuiEnv to create the system font manager instance.
       
    42      */
       
    43     IMPORT_C THuiFontManager();
       
    44     
       
    45     /**
       
    46      * Default destructor.
       
    47      */    
       
    48     IMPORT_C virtual ~THuiFontManager();
       
    49     
       
    50     /** @beginAPI */
       
    51     
       
    52     /**
       
    53      * Retrieves the CHuiFontSpecification array that describes all fonts
       
    54      * supported by this platform. Any of these specifications can be used to create
       
    55      * new font instances. The user has to pass in an array that will be filled by this
       
    56      * method with the system font specifications.
       
    57      * @see CreateFontL()
       
    58      *
       
    59      * @param aArray Reference to an array that is going to include all platform supported
       
    60      * fonst specifications after this call has exited.
       
    61      */
       
    62     IMPORT_C void EnumerateFontsL(RArray<THuiFontSpecification>& aArray) const;
       
    63     
       
    64     /**
       
    65      * Creates a new font object based on the font specification passed into this method.
       
    66      * If no matching font specification is found from the system the method leaves with 
       
    67      * KErrNotSupported leave code. User can make sure that the font is supported by using
       
    68      * the EnumerateFontsL - method and using the font specification array generated by
       
    69      * the method. A unique ID is constructed based on this font. This font can be accessed 
       
    70      * anytime through the FontL - method based on this unique ID.
       
    71      * @see FontL()
       
    72      * @see EnumerateFontsL()
       
    73      * 
       
    74      * @param aSpecification A font specification object according to which the font object is created.
       
    75      * @return Unique ID describing the newly created font object. If similar font already exists then
       
    76      * the ID of the already created font is returned.
       
    77      */
       
    78     IMPORT_C TInt CreateFontL(const THuiFontSpecification& aSpecification);
       
    79     
       
    80     /** @endAPI */
       
    81     
       
    82 private:
       
    83 
       
    84     /** Registry of all fonts within this manager. These fonts are accessed by font id. */
       
    85     RArray<THuiFontSpecification> iFonts;
       
    86 
       
    87 };
       
    88 
       
    89 #endif // HUIFONTMANAGER_H