svgtopt/SVG/SVGImpl/inc/SVGGlyphElementImpl.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 _INC_CSVGGLYPHELEMENTIMPL_
       
    20 #define _INC_CSVGGLYPHELEMENTIMPL_
       
    21 
       
    22 #include "SVGElementImpl.h"
       
    23 #include "GfxFloatFixPt.h"
       
    24 
       
    25 #include "GfxGeneralPath.h"
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #ifdef SVG_FONTS_INCLUDE
       
    31 
       
    32 class   CSvgDocumentImpl;
       
    33 
       
    34 
       
    35 /**
       
    36  * Class description goes here.
       
    37  *
       
    38  *  @lib SVGEngine.lib
       
    39  *  @since 1.0
       
    40  */
       
    41 class CSvgGlyphElementImpl : public CSvgElementImpl
       
    42     {
       
    43     public:
       
    44 
       
    45         // Constructor/deconstructor
       
    46 
       
    47 		/**
       
    48          * Need method description
       
    49          *
       
    50          * @since 1.0
       
    51          * @param
       
    52          * @return
       
    53          */
       
    54         static CSvgGlyphElementImpl*NewL(  const TUint8 aElemID,
       
    55                                       CSvgDocumentImpl* aDoc );
       
    56 
       
    57 		/**
       
    58          * Need method description
       
    59          *
       
    60          * @since 1.0
       
    61          * @param
       
    62          * @return
       
    63          */
       
    64         static CSvgGlyphElementImpl*NewLC(  const TUint8 aElemID,
       
    65                                        CSvgDocumentImpl* aDoc );
       
    66 
       
    67 	private:
       
    68 		/**
       
    69          * Need method description
       
    70          *
       
    71          * @since 1.0
       
    72          * @param
       
    73          * @return
       
    74          */
       
    75         void                            ConstructL(  const TUint8 aElemID  );
       
    76 
       
    77 
       
    78 
       
    79 	public:
       
    80 
       
    81 
       
    82         /**
       
    83          * Need method description
       
    84          *
       
    85          * @since 1.0
       
    86          * @param
       
    87          * @return
       
    88          */
       
    89         virtual                     ~CSvgGlyphElementImpl();
       
    90 
       
    91         // From SVG DOM
       
    92 
       
    93         /**
       
    94          * Need method description
       
    95          *
       
    96          * @since 1.0
       
    97          * @param
       
    98          * @return
       
    99          */
       
   100         void                        GetUnicode( TDes& aUnicode );
       
   101 
       
   102 
       
   103         /**
       
   104          * Need method description
       
   105          *
       
   106          * @since 1.0
       
   107          * @param
       
   108          * @return
       
   109          */
       
   110         TFloatFixPt                      GetHorzAdvX();
       
   111 
       
   112         // SVG Implementation
       
   113 
       
   114 
       
   115         /**
       
   116          * Need method description
       
   117          *
       
   118          * @since 1.0
       
   119          * @param
       
   120          * @return
       
   121          */
       
   122         void                        SetUnicodeL( const TDesC& aUnicode );
       
   123 
       
   124 
       
   125         /**
       
   126          * Need method description
       
   127          *
       
   128          * @since 1.0
       
   129          * @param
       
   130          * @return
       
   131          */
       
   132         void                        SetGlyphNameL( const TDesC& aGlyphName );
       
   133 
       
   134 
       
   135         /**
       
   136          * Need method description
       
   137          *
       
   138          * @since 1.0
       
   139          * @param
       
   140          * @return
       
   141          */
       
   142         void                        SetLangCodeL( const TDesC& aLangCode );
       
   143 
       
   144 
       
   145         /**
       
   146          * Need method description
       
   147          *
       
   148          * @since 1.0
       
   149          * @param
       
   150          * @return
       
   151          */
       
   152         void                        SetPath( const TDesC& aPath );
       
   153 
       
   154 
       
   155 		 /**
       
   156          * Need method description
       
   157          *
       
   158          * @since 1.0
       
   159          * @param
       
   160          * @return
       
   161          */
       
   162         TInt						SetAttributeFloatL(	const TInt aNameId,
       
   163 														const TFloatFixPt aValue );
       
   164 
       
   165 		/**
       
   166          * Need method description
       
   167          *
       
   168          * @since 1.0
       
   169          * @param
       
   170          * @return
       
   171          */
       
   172 		TInt						SetAttributeDesL( const TInt aNameId, const TDesC& aValue );
       
   173 
       
   174 
       
   175         // From MXmlElementOpt API
       
   176 
       
   177 
       
   178         /**
       
   179          * Need method description
       
   180          *
       
   181          * @since 1.0
       
   182          * @param
       
   183          * @return
       
   184          */
       
   185         TInt                        GetAttributeFloat( const TInt aNameId,
       
   186                                                         TFloatFixPt& aValue );
       
   187 
       
   188         /**
       
   189          * Need method description
       
   190          *
       
   191          * @since 1.0
       
   192          * @param
       
   193          * @return
       
   194          */
       
   195         TInt                        GetAttributePath( const TInt aNameId,
       
   196                                                       CGfxGeneralPath*& aValue );
       
   197 
       
   198         /**
       
   199          * Need method description
       
   200          *
       
   201          * @since 1.0
       
   202          * @param
       
   203          * @return
       
   204          */
       
   205         TInt                        SetAttributePathL( const TInt aNameId,
       
   206                                                        CGfxGeneralPath* aValue );
       
   207 
       
   208 		TInt                        SetAttributePathRef( const TInt aNameId,
       
   209                                                        CGfxGeneralPath*& aValue );
       
   210 
       
   211 
       
   212         /**
       
   213          * Need method description
       
   214          *
       
   215          * @since 1.0
       
   216          * @param
       
   217          * @return
       
   218          */
       
   219         TInt                        GetAttributeDes( const TInt aNameId,
       
   220                                                      TPtrC16& aValue );
       
   221 
       
   222         // From MXmlElement API
       
   223 
       
   224 
       
   225         /**
       
   226          * Need method description
       
   227          *
       
   228          * @since 1.0
       
   229          * @param
       
   230          * @return
       
   231          */
       
   232         TInt                        SetAttributeL( const TDesC& aName,
       
   233                                                    const TDesC& aValue );
       
   234         // From CSvgElementImpl
       
   235 
       
   236 
       
   237         /**
       
   238          * Need method description
       
   239          *
       
   240          * @since 1.0
       
   241          * @param
       
   242          * @return
       
   243          */
       
   244         MXmlElement*                CloneL(MXmlElement* aParentElement);
       
   245 
       
   246 
       
   247         /**
       
   248          * Need method description
       
   249          *
       
   250          * @since 1.0
       
   251          * @param
       
   252          * @return
       
   253          */
       
   254         TBool                       DrawL( CGfx2dGc* aGc,
       
   255                                            CSvgElementImpl* aElement );
       
   256 
       
   257 
       
   258         /**
       
   259          * Need method description
       
   260          *
       
   261          * @since 1.0
       
   262          * @param
       
   263          * @return
       
   264          */
       
   265         void                        GetBBox( TGfxRectangle2D& aBbox );
       
   266 
       
   267         /**
       
   268          * Need method description
       
   269          *
       
   270          * @since 1.0
       
   271          * @param
       
   272          * @return
       
   273          */
       
   274         virtual void GetUnscaledBBox( TGfxRectangle2D& /*aBbox*/ );
       
   275 
       
   276         CGfxGeneralPath* GetPathAttribute(TInt aAttributeId);
       
   277         void SetPathAttribute(TInt aAttributeId, CGfxGeneralPath* aPathHandle);
       
   278 
       
   279 		void Print( TBool aIsEncodeOn );
       
   280 		
       
   281     private:
       
   282 
       
   283         HBufC*                      iUnicode;
       
   284 
       
   285         HBufC*                      iGlyphName;
       
   286 
       
   287         TFloatFixPt                      iHorzAdvX;
       
   288 
       
   289         HBufC*                      iLangCode;
       
   290 
       
   291         //    TInt16 iPathLength;
       
   292 
       
   293         CGfxGeneralPath*            iShape;
       
   294 
       
   295 		TBool	iOwnedPath;
       
   296 
       
   297 
       
   298         /**
       
   299          * Need method description
       
   300          *
       
   301          * @since 1.0
       
   302          * @param
       
   303          * @return
       
   304          */
       
   305                                     CSvgGlyphElementImpl( CSvgDocumentImpl* aDoc );
       
   306     };
       
   307 
       
   308 #endif /* SVG_FONTS_INCLUDE */
       
   309 
       
   310 #endif /* _INC_CSVGGLYPHELEMENTIMPL_ */