svgt_plat/svgt_api/inc/SVGErrorImpl.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 Engine header file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SVGERROR_H
       
    20 #define SVGERROR_H
       
    21 
       
    22 #if !defined(__E32BASE_H__)
       
    23 #include <e32base.h>
       
    24 #endif
       
    25 
       
    26 #include "SVGEngineInterfaceImpl.h"
       
    27 
       
    28 /**
       
    29  * This class implements the interface for a MSvgError object, which contains
       
    30  * an error code and a description of the error if one exists.
       
    31  *
       
    32  *  @lib SVGEngine.lib
       
    33  *  @since 1.0
       
    34  */
       
    35 class CSvgErrorImpl : public CBase, public MSvgError
       
    36     {
       
    37     public:
       
    38 
       
    39         /**
       
    40          * Two-phase constructor.  The default error code is ESvgNoError and description is
       
    41          * "No Error"
       
    42          *
       
    43          * @since 1.0
       
    44          * @return : CSvgErrorImpl object
       
    45          */
       
    46         static CSvgErrorImpl* NewL();
       
    47 
       
    48         /**
       
    49          * Two-phase constructor.  The default error code is ESvgNoError and description is
       
    50          * "No Error"
       
    51          *
       
    52          * @since 1.0
       
    53          * @return : CSvgErrorImpl object
       
    54          */
       
    55         static CSvgErrorImpl* NewLC();
       
    56 
       
    57         /**
       
    58          * Destructor
       
    59          */
       
    60          virtual ~CSvgErrorImpl();
       
    61 
       
    62         /**
       
    63          * Determine wether an error is indicated by this object.
       
    64          *
       
    65          * @since 1.0
       
    66          * @return : ETrue, if ErrorCode() != ESvgNoError
       
    67          */
       
    68         TBool HasError();
       
    69 
       
    70         /**
       
    71          * Determine wether an error is only a warning.
       
    72          * This should be a state when the svg may be display, despite
       
    73          * a conflict.
       
    74          *
       
    75          * @since 1.0
       
    76          * @return ETrue if HasError() is only a warning.
       
    77          */
       
    78         TBool IsWarning();
       
    79 
       
    80         /**
       
    81          * Set the flag to indicate the error indicated by this object
       
    82          * is only a warning.
       
    83          *
       
    84          * @since 1.0
       
    85          * @return ETrue if HasError() is only a warning.
       
    86          */
       
    87 
       
    88         void SetIsWarning( TBool aBool );
       
    89 
       
    90         /**
       
    91          * Get the error code contained by this object.
       
    92          *
       
    93          * @since 1.0
       
    94          * @return : the TSvgErrorCode value
       
    95          */
       
    96         TSvgErrorCode ErrorCode();
       
    97 
       
    98         /**
       
    99          * Get the error code contained by this object.
       
   100          *
       
   101          * @since 1.0
       
   102          * @return : the TSvgErrorCode value
       
   103          */
       
   104         TInt SystemErrorCode();
       
   105 
       
   106         /**
       
   107          * Get the error description string for this object.
       
   108          *
       
   109          * @since 1.0
       
   110          * @return : error description string.
       
   111          */
       
   112         TDesC& Description();
       
   113 
       
   114         /**
       
   115          * Set the error code.
       
   116          *
       
   117          * @since 1.0
       
   118          * @param aError : error code
       
   119          * @return
       
   120          */
       
   121         void SetErrorCode( TSvgErrorCode aError );
       
   122 
       
   123         /**
       
   124          * Set the error code.
       
   125          *
       
   126          * @since 1.0
       
   127          * @param aError : error code
       
   128          * @return
       
   129          */
       
   130         void SetSystemErrorCode( TInt aError );
       
   131 
       
   132         /**
       
   133          * Set the error description.
       
   134          *
       
   135          * @since 1.0
       
   136          * @param aDescription : error description string
       
   137          * @return
       
   138          */
       
   139         void SetDescription( const TDesC& aDescription );
       
   140 
       
   141         /**
       
   142          * Set the error description.
       
   143          *
       
   144          * @since 1.0
       
   145          * @param aText1 : error description string 1
       
   146          * @param aText2 : error description string 2
       
   147          * @return
       
   148          */
       
   149         void SetDescription( const TDesC& aText1, const TDesC& aText2 );
       
   150 
       
   151         /**
       
   152          * Append the given text to the existing description .
       
   153          *
       
   154          * @since 1.0
       
   155          * @param aDescription : error description string
       
   156          * @param aText2 : error description string 2
       
   157          * @return
       
   158          */
       
   159         void AppendDescription( const TDesC& aDescription );
       
   160 
       
   161 
       
   162     protected:
       
   163         /**
       
   164          * Second phase of constructor
       
   165          *
       
   166          * @since 1.0
       
   167          */
       
   168         void ConstructL();
       
   169 
       
   170     private:
       
   171 
       
   172         /**
       
   173          * Constructor.  The default error code is ESvgNoError and description is
       
   174          * "No Error"
       
   175          *
       
   176          * @since 1.0
       
   177          */
       
   178         CSvgErrorImpl();
       
   179 
       
   180     private:
       
   181         TSvgErrorCode iErrorCode;
       
   182         HBufC*        iDescription;
       
   183         TBool         iIsWarning;
       
   184         TInt          iSystemErrorCode;
       
   185     };
       
   186 
       
   187 #endif
       
   188