svgtopt/SVG/SVGImpl/inc/SVGFontHashMap.h
changeset 0 d46562c3d99d
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     1 /*
       
     2 * Copyright (c) 2003 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:  SVG Implementation header file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FONTHASHMAP_H__
       
    20 #define __FONTHASHMAP_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include "SVGFontElementImpl.h"
       
    24     
       
    25 	class CSvgFontMapItem: public CBase
       
    26     	{
       
    27     	public:
       
    28 
       
    29 		enum TSvgFontType
       
    30     	{
       
    31     	ESvgSystemFont,
       
    32     	ESvgSvgFont,
       
    33     	ESvgExternalDocumentFont
       
    34     	};
       
    35     
       
    36 		static CSvgFontMapItem* NewL();
       
    37 
       
    38         static CSvgFontMapItem* NewLC();
       
    39         
       
    40         CSvgFontMapItem();
       
    41         
       
    42         ~CSvgFontMapItem();
       
    43 	
       
    44 		void                    ConstructL();
       
    45 
       
    46         /**
       
    47          * Need method description
       
    48          *
       
    49          * @since 1.0
       
    50          * @param 
       
    51          * @return
       
    52          */
       
    53         CSvgFontElementImpl*    GetFontPtr();
       
    54 
       
    55         /**
       
    56          * Need method description
       
    57          *
       
    58          * @since 1.0
       
    59          * @param 
       
    60          * @return
       
    61          */
       
    62         const TDesC&    GetFontFamilyName();
       
    63 
       
    64 
       
    65         /**
       
    66          * Need method description
       
    67          *
       
    68          * @since 1.0
       
    69          * @param 
       
    70          * @return
       
    71          */
       
    72         void            SetFontPtr( CSvgFontElementImpl* aFontPtr );
       
    73 
       
    74         /**
       
    75          * Need method description
       
    76          *
       
    77          * @since 1.0
       
    78          * @param 
       
    79          * @return
       
    80          */
       
    81         void            CopyFontFamilyName( const TDesC& aFontFamilyName );
       
    82 
       
    83 		TInt			IncrementReferenceCount( );
       
    84 		
       
    85 		TInt			DecrementReferenceCount( );
       
    86 		
       
    87 		void			Print();
       
    88 		
       
    89     public:
       
    90         CSvgFontElementImpl*    iFontPtr;
       
    91         CSvgDocumentImpl*		iFontDocumentPtr;
       
    92         HBufC*          		iFontFamilyName;
       
    93         TInt					iFontReferenceCount;
       
    94         TSvgFontType			iFontType;
       
    95     };   
       
    96     
       
    97 class CSvgFontHashMap : public CBase
       
    98     {
       
    99     public:
       
   100    
       
   101    static CSvgFontHashMap* NewL();
       
   102 
       
   103    static CSvgFontHashMap* NewLC();
       
   104         
       
   105    CSvgFontHashMap();
       
   106         
       
   107    ~CSvgFontHashMap();
       
   108 	
       
   109 	void    ConstructL();
       
   110 				
       
   111 	//IMAGE MAPPING METHODS
       
   112     TBool   AddReferenceToFontL( const TDesC& aFontFamilyName );
       
   113 	
       
   114 	TBool	AddFontL ( CSvgFontElementImpl* aImage, const TDesC& aFontFamilyName );
       
   115 	
       
   116     TBool	RemoveReferenceFromFontL( const TDesC& aFontFamilyName );
       
   117 
       
   118 	CSvgFontElementImpl*     GetFontPtr( const TDesC& aFontFamilyName );
       
   119 	
       
   120     TBool            HasFontFamilyName( const TDesC& aFontFamilyName );
       
   121     
       
   122     //FONT MAPPING METHODS
       
   123 
       
   124     TBool AddFontDocument(CSvgDocumentImpl* newFontDocument, const TDesC& aFontFamily);
       
   125 
       
   126     void DeleteFontDocument(const TDesC& aFontFamily);
       
   127 
       
   128     TBool HasFontDocument(CSvgDocumentImpl* aDoc);
       
   129         
       
   130     void			PrintFontHashMap();
       
   131         
       
   132     private:
       
   133     
       
   134     CSvgFontMapItem* GetFontMapItem( const TDesC& aFontFamilyName );
       
   135     
       
   136     RPointerArray<CSvgFontMapItem>		iSvgFontMapItems;
       
   137     
       
   138     RPointerArray<CSvgDocumentImpl> iFontDocumentPointers;
       
   139     
       
   140     //data item used in the FontHashMap
       
   141 		
       
   142 };
       
   143 
       
   144 #endif