uifw/AvKon/inc/AknFontRegistry.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Records AknLayoutFont registrations. List of pointers to CAknLayoutFont is
       
    15 *  maintained by AknEnv.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef AKNFONTREGISTRY_H
       
    22 #define AKNFONTREGISTRY_H
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CFont;
       
    28 class CAknLayoutFont;
       
    29 
       
    30 /**
       
    31 * CAknLayoutFont registration.  This is implemented with an RArray of pointers.  They can be searched
       
    32 * to give a type check for the client to see if their CFont pointers are actually CAknLayoutFont pointers.
       
    33 *
       
    34 */
       
    35 NONSHARABLE_CLASS(CAknFontRegistry) : public CBase
       
    36     {
       
    37 public:
       
    38 	
       
    39     /**
       
    40     * Two-phased constructor.
       
    41     *
       
    42     * @return Fully constructed object if there was no Leave
       
    43     */
       
    44     static CAknFontRegistry* NewL();
       
    45    
       
    46     /** 
       
    47     * Called to put the CAknLayoutFont object's pointer in the list
       
    48     * @param    aFont   Pointer to a valid CAknLayoutFont-conformant object
       
    49     */
       
    50     void RegisterFont( const CAknLayoutFont* aFont );
       
    51 
       
    52     /** 
       
    53     * Called to remove the CAknLayoutFont object's pointer from the list. This will not
       
    54     * panic under OOM or if the pointer is not registered.
       
    55     * 
       
    56     * @param    aFont   Pointer to a valid CAknLayoutFont-conformant object
       
    57     */
       
    58     void DeRegisterFont( const CAknLayoutFont* aFont );
       
    59 
       
    60     /** 
       
    61     * Used to find out if a CFont is amoung the registered CAknLayoutFonts
       
    62     * @param    aFont   Pointer to a valid CFont-conformant object
       
    63     * @return   EFalse  iff the pointer is not in the registed CAknLayoutFont pointers
       
    64     */
       
    65     TBool IsRegistered( const CFont* aFont ) const;
       
    66 
       
    67     /** 
       
    68     * Destructor
       
    69     *
       
    70     */
       
    71     virtual ~CAknFontRegistry();
       
    72 
       
    73 private: 
       
    74     /** 
       
    75     * Default constructor
       
    76     */
       
    77     CAknFontRegistry();
       
    78 
       
    79     /**
       
    80     * @return index of the found font, or KErrNotFound
       
    81     */
       
    82     TInt FindFont( const CFont* aFont ) const;
       
    83 
       
    84 private:    // Data
       
    85     RPointerArray<CFont> iArray;
       
    86     };
       
    87 
       
    88 #endif // AKNFONTREGISTRY_H