svgtopt/SVG/SVGImpl/inc/SVGUseElementImpl.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 _INC_CSVGUSEELEMENTIMPL_
       
    20 #define _INC_CSVGUSEELEMENTIMPL_
       
    21 
       
    22 //#include "SVGStructuralElementImpl.h"
       
    23 #include "SVGElementImpl.h"
       
    24 #include "GfxFloatFixPt.h"
       
    25 #include "SVGSchemaData.h"
       
    26 
       
    27 
       
    28 class   CSvgDocumentImpl;
       
    29 
       
    30 
       
    31 /**
       
    32  * Class description goes here.
       
    33  *
       
    34  *  @lib SVGEngine.lib
       
    35  *  @since 1.0
       
    36  */
       
    37 class CSvgUseElementImpl : public CSvgElementImpl
       
    38     {
       
    39     public:
       
    40 
       
    41         // Constructor/deconstructor
       
    42 
       
    43 		/**
       
    44          * Need method description
       
    45          *
       
    46          * @since 1.0
       
    47          * @param
       
    48          * @return
       
    49          */
       
    50         static CSvgUseElementImpl*NewL(  const TUint8 aElemID,
       
    51                                       CSvgDocumentImpl* aDoc );
       
    52 
       
    53 		/**
       
    54          * Need method description
       
    55          *
       
    56          * @since 1.0
       
    57          * @param
       
    58          * @return
       
    59          */
       
    60         static CSvgUseElementImpl*NewLC(  const TUint8 aElemID,
       
    61                                        CSvgDocumentImpl* aDoc );
       
    62 
       
    63 	private:
       
    64 		/**
       
    65          * Need method description
       
    66          *
       
    67          * @since 1.0
       
    68          * @param
       
    69          * @return
       
    70          */
       
    71         void                            ConstructL(  const TUint8 aElemID  );
       
    72 
       
    73 
       
    74 
       
    75 	public:
       
    76 
       
    77 
       
    78         /**
       
    79          * Need method description
       
    80          *
       
    81          * @since 1.0
       
    82          * @param
       
    83          * @return
       
    84          */
       
    85         virtual                     ~CSvgUseElementImpl();
       
    86 
       
    87         // From SVG DOM: Empty
       
    88 
       
    89 
       
    90         /**
       
    91          * Need method description
       
    92          *
       
    93          * @since 1.0
       
    94          * @param
       
    95          * @return
       
    96          */
       
    97         TFloatFixPt                      X();
       
    98 
       
    99 
       
   100         /**
       
   101          * Need method description
       
   102          *
       
   103          * @since 1.0
       
   104          * @param
       
   105          * @return
       
   106          */
       
   107         TFloatFixPt                      Y();
       
   108 
       
   109 
       
   110         /**
       
   111          * Need method description
       
   112          *
       
   113          * @since 1.0
       
   114          * @param
       
   115          * @return
       
   116          */
       
   117         TFloatFixPt                      Width();
       
   118 
       
   119 
       
   120         /**
       
   121          * Need method description
       
   122          *
       
   123          * @since 1.0
       
   124          * @param
       
   125          * @return
       
   126          */
       
   127         TFloatFixPt                      Height();
       
   128 
       
   129         // SVG Implementation: Empty
       
   130 
       
   131 
       
   132         // From MXmlElement API
       
   133 		/**
       
   134          * Need method description
       
   135          *
       
   136          * @since 1.0
       
   137          * @param
       
   138          * @return
       
   139          */
       
   140 		void						GetBBox( TGfxRectangle2D& aBbox );
       
   141 		void                        GetBoundingBox(TGfxRectangle2D& aBbox);
       
   142 		void						GetUnscaledBBox( TGfxRectangle2D& aBbox );
       
   143 		
       
   144 		TInt						SetAttributeFloatL( const TInt aNameId,
       
   145 											          const TFloatFixPt aValue );
       
   146 		TInt GetAttributeFloat( const TInt aNameId,
       
   147                                              TFloatFixPt& aValue );
       
   148         /**
       
   149          * Need method description
       
   150          *
       
   151          * @since 1.0
       
   152          * @param
       
   153          * @return
       
   154          */
       
   155         TInt                        SetAttributeL( const TDesC& aName,
       
   156                                                    const TDesC& aValue );
       
   157         // From CSvgElementImpl
       
   158 
       
   159 		TInt 						SetAttributeDesL( const TInt aNameId,
       
   160                                         const TDesC& aValue );
       
   161                                         
       
   162         TInt 						GetAttributeDes( const TInt aNameId, TPtrC16& aValue );
       
   163                                         
       
   164         /**
       
   165          * Need method description
       
   166          *
       
   167          * @since 1.0
       
   168          * @param
       
   169          * @return
       
   170          */
       
   171         MXmlElement*        CloneL(MXmlElement* aParentElement);
       
   172 
       
   173 
       
   174         /**
       
   175          * Need method description
       
   176          *
       
   177          * @since 1.0
       
   178          * @param
       
   179          * @return
       
   180          */
       
   181         TBool                       DrawL( CGfx2dGc* aGc,
       
   182                                            CSvgElementImpl* aElement );
       
   183 		/**
       
   184          * Need method description
       
   185          *
       
   186          * @since 1.0
       
   187          * @param
       
   188          * @return
       
   189 		*/	
       
   190 		void CopyL( CSvgUseElementImpl* aDestElement );
       
   191 
       
   192 		void Print( TBool aIsEncodeOn );
       
   193 		
       
   194 		/**
       
   195          * Return wether an svg element is displayable, such as <rect>, <circle>, or
       
   196          * an abstract element, such as <g>, <animate>.
       
   197          *
       
   198          * @since 1.0
       
   199          * @param None
       
   200          * @return ETrue if element is viewable.
       
   201          */
       
   202         TBool               IsViewable();
       
   203         
       
   204         CSvgElementImpl*    GetReferenceElementL();
       
   205     private:
       
   206 
       
   207         TFloatFixPt                      iX;
       
   208         //TBool                       iXSet;
       
   209 
       
   210         TFloatFixPt                      iY;
       
   211         //TBool                       iYSet;
       
   212 
       
   213         TFloatFixPt                      iWidth;
       
   214 
       
   215         TFloatFixPt                      iHeight;
       
   216 
       
   217         CSvgElementImpl*            ireferenceEl;
       
   218 
       
   219 
       
   220         /**
       
   221          * Need method description
       
   222          *
       
   223          * @since 1.0
       
   224          * @param
       
   225          * @return
       
   226          */
       
   227                                     CSvgUseElementImpl( CSvgDocumentImpl* aDoc );
       
   228 
       
   229 
       
   230         /**
       
   231          * Need method description
       
   232          *
       
   233          * @since 1.0
       
   234          * @param
       
   235          * @return
       
   236          */
       
   237 //        void                        DeepClone( MXmlElement* );
       
   238 
       
   239 
       
   240 	public:
       
   241         /**
       
   242          * Need method description
       
   243          *
       
   244          * @since 1.0
       
   245          * @param
       
   246          * @return
       
   247          */
       
   248         void                        SetReferenceElementL(  );
       
   249 
       
   250 		TInt						SetRefElemById(const TDesC& aName);
       
   251 		
       
   252 		CSvgUseElementImpl*			iUseElementThatUsesThisUse;
       
   253 		
       
   254 		HBufC* iUseHRef;
       
   255     };
       
   256 
       
   257 #endif