svgtopt/SVG/SVGImpl/inc/SVGMemoryManager.h
changeset 46 88edb906c587
equal deleted inserted replaced
-1:000000000000 46:88edb906c587
       
     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 __MEMORYMANAGER_H__
       
    20 #define __MEMORYMANAGER_H__
       
    21 
       
    22 #if !defined(__E32BASE_H__)
       
    23 #include <e32base.h>
       
    24 #endif
       
    25 
       
    26 #include "GfxFloatFixPt.h"
       
    27 
       
    28 //forward declerations
       
    29 class CCssValue;
       
    30 
       
    31 class CPaintCssValueImpl;
       
    32 class CFloatCssValueImpl;
       
    33 class CIntCssValueImpl;
       
    34 class CStrCssValueImpl;
       
    35 class CVectorCssValueImpl;
       
    36 class CClrCssValueImpl;
       
    37 
       
    38 class CSvgElementImpl;
       
    39 
       
    40 class CSvgMemoryManager : public CBase
       
    41     {
       
    42     public:
       
    43 
       
    44    static CSvgMemoryManager* NewL();
       
    45 
       
    46    static CSvgMemoryManager* NewLC();
       
    47 
       
    48    CSvgMemoryManager();
       
    49 
       
    50    ~CSvgMemoryManager();
       
    51 
       
    52     void    ConstructL();
       
    53 
       
    54     void    Print();
       
    55 
       
    56     //this really shouldnt require the CSvgElementImpl to be passed to it
       
    57         //but our paint class is so messed up
       
    58         CCssValue* CloneCssValueL(CCssValue* aValue);
       
    59 
       
    60 //----------------------------------------------------------
       
    61 //              CPaintCssValueImpl
       
    62 //----------------------------------------------------------
       
    63     public:
       
    64         CPaintCssValueImpl* GetCssPaintObjectL( CSvgElementImpl* aElementImpl = NULL );
       
    65         CPaintCssValueImpl* GetCssPaintObjectL( const TDesC& aValue, CSvgElementImpl* aElementImpl );
       
    66 
       
    67     private:
       
    68         void    AllocateCssPaintBlockL( );
       
    69 
       
    70         //each of the pointers in this contains a block of #granularity Paints
       
    71         RPointerArray<CPaintCssValueImpl> iCPaintCssValueImplArrays;
       
    72 
       
    73         CPaintCssValueImpl* iCPaintCssValueImplArray;
       
    74         TInt iCurrentPaintObjectIndex;
       
    75         static const TUint KCssPaintBlockSize;
       
    76 
       
    77 //----------------------------------------------------------
       
    78 //              CFloatCssValueImpl
       
    79 //----------------------------------------------------------
       
    80     public:
       
    81         CFloatCssValueImpl* GetCssFloatObjectL( float aFloat = 0.0 );
       
    82         CFloatCssValueImpl* GetCssFloatObjectL( CFloatCssValueImpl* aFloatValue );
       
    83         CFloatCssValueImpl* GetCssFloatObjectL( const TDesC& aValueString );
       
    84 
       
    85     private:
       
    86         void    AllocateCssFloatBlockL( );
       
    87 
       
    88         //each of the pointers in this contains a block of #granularity Floats
       
    89         RPointerArray<CFloatCssValueImpl> iCFloatCssValueImplArrays;
       
    90 
       
    91         CFloatCssValueImpl* iCFloatCssValueImplArray;
       
    92         TInt iCurrentFloatObjectIndex;
       
    93         static const TUint KCssFloatBlockSize;
       
    94 
       
    95 //----------------------------------------------------------
       
    96 //              CClrCssValueImpl
       
    97 //----------------------------------------------------------
       
    98     public:
       
    99     CClrCssValueImpl* GetCssClrObjectL(  );
       
   100     CClrCssValueImpl* GetCssClrObjectL( const TDesC& aValueString );
       
   101 
       
   102     private:
       
   103     void    AllocateCssClrBlockL( );
       
   104 
       
   105     //each of the pointers in this contains a block of #granularity Clrs
       
   106     RPointerArray<CClrCssValueImpl> iCClrCssValueImplArrays;
       
   107 
       
   108         CClrCssValueImpl* iCClrCssValueImplArray;
       
   109         TInt iCurrentClrObjectIndex;
       
   110         static const TUint KCssClrBlockSize;
       
   111 
       
   112 //----------------------------------------------------------
       
   113 //              CIntCssValueImpl
       
   114 //----------------------------------------------------------
       
   115     public:
       
   116     CIntCssValueImpl* GetCssIntObjectL( TInt aInitValue = 0 );
       
   117     CIntCssValueImpl* GetCssIntObjectL( const TDesC& aValueString );
       
   118     CIntCssValueImpl* GetCssIntObjectL( CIntCssValueImpl* aIntValue );
       
   119 
       
   120     private:
       
   121     void    AllocateCssIntBlockL( );
       
   122 
       
   123         //each of the pointers in this contains a block of #granularity Ints
       
   124         RPointerArray<CIntCssValueImpl> iCIntCssValueImplArrays;
       
   125 
       
   126         CIntCssValueImpl* iCIntCssValueImplArray;
       
   127         TInt iCurrentIntObjectIndex;
       
   128         static const TUint KCssIntBlockSize;
       
   129 
       
   130 //----------------------------------------------------------
       
   131 //              CStrCssValueImpl
       
   132 //----------------------------------------------------------
       
   133     public:
       
   134     CStrCssValueImpl* GetCssStrObjectL( const TDesC& aValueString );
       
   135 
       
   136     private:
       
   137     void    AllocateCssStrBlockL( );
       
   138 
       
   139     //each of the pointers in this contains a block of #granularity Strs
       
   140     RPointerArray<CStrCssValueImpl> iCStrCssValueImplArrays;
       
   141 
       
   142     CStrCssValueImpl* iCStrCssValueImplArray;
       
   143         TInt iCurrentStrObjectIndex;
       
   144         static const TUint KCssStrBlockSize;
       
   145 
       
   146 //----------------------------------------------------------
       
   147 //              CVectorCssValueImpl
       
   148 //----------------------------------------------------------
       
   149     public:
       
   150     CVectorCssValueImpl* GetCssVectorObjectL( const TDesC& aValueString );
       
   151     CVectorCssValueImpl* GetCssVectorObjectL( CArrayFix<TFloatFixPt>* aValue );
       
   152 
       
   153     private:
       
   154         void    AllocateCssVectorBlockL( );
       
   155 
       
   156         //each of the pointers in this contains a block of #granularity Vector
       
   157         RPointerArray<CVectorCssValueImpl> iCVectorCssValueImplArrays;
       
   158 
       
   159         CVectorCssValueImpl* iCVectorCssValueImplArray;
       
   160         TInt iCurrentVectorObjectIndex;
       
   161         static const TUint KCssVectorBlockSize;
       
   162 
       
   163 
       
   164 };
       
   165 
       
   166 #endif