simpleengine/xmlutils/src/simplewinfo.cpp
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2006 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:    Simple Engine
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <s32strm.h>
       
    25 #include <SenBaseElement.h>
       
    26 #include <SenBaseAttribute.h>
       
    27 #include <SenXmlUtils.h>
       
    28 #include <SenXmlReader.h>
       
    29 #include <SenDomFragment.h>
       
    30 
       
    31 // own simple
       
    32 #include "simplecommon.h"
       
    33 #include "simpleelement.h"
       
    34 #include "simplenamespace.h"
       
    35 #include "simpleattribute.h"
       
    36 #include "simplebasedocument.h"
       
    37 #include "simpleutils.h"
       
    38 #include "simplewinfo.h"
       
    39 
       
    40 
       
    41 // ================= MEMBER FUNCTIONS =======================
       
    42 //
       
    43 
       
    44 // ----------------------------------------------------------
       
    45 // CSimpleWinfo::CSimpleWinfo
       
    46 // ----------------------------------------------------------
       
    47 //
       
    48 CSimpleWinfo::CSimpleWinfo( )
       
    49 : CSimpleBaseDocument()
       
    50     {
       
    51     }
       
    52 
       
    53 // ----------------------------------------------------------
       
    54 // CSimpleWinfo::~CSimpleWinfo
       
    55 // ----------------------------------------------------------
       
    56 //
       
    57 CSimpleWinfo::~CSimpleWinfo()
       
    58     {
       
    59     }
       
    60 
       
    61 // ----------------------------------------------------------
       
    62 // CSimpleWinfo::ConstructL
       
    63 // ----------------------------------------------------------
       
    64 //
       
    65 void CSimpleWinfo::ConstructL(
       
    66     const TDesC8& aNsUri,
       
    67   const TDesC8& aLocalName )
       
    68     {
       
    69     BaseConstructL(aNsUri, aLocalName);
       
    70     }
       
    71 
       
    72 // ----------------------------------------------------------
       
    73 // CSimpleWinfo::ConstructL
       
    74 // ----------------------------------------------------------
       
    75 //
       
    76 void CSimpleWinfo::ConstructL(
       
    77   const TDesC8& aXml )
       
    78     {
       
    79     BaseConstructL( aXml );
       
    80     }
       
    81 
       
    82 // ----------------------------------------------------------
       
    83 // CSimpleWinfo::NewL
       
    84 // ----------------------------------------------------------
       
    85 //
       
    86 CSimpleWinfo* CSimpleWinfo::NewL( )
       
    87     {
       
    88     CSimpleWinfo* self = new (ELeave) CSimpleWinfo( );
       
    89     CleanupStack::PushL( self );
       
    90     self->ConstructL( KSimpleNsWinfo, KWinfoLocalName );
       
    91     CleanupStack::Pop( self );
       
    92     return self;
       
    93     }
       
    94 
       
    95 // ----------------------------------------------------------
       
    96 // CSimpleWinfo::NewL
       
    97 // ----------------------------------------------------------
       
    98 //
       
    99 CSimpleWinfo* CSimpleWinfo::NewL( const TDesC8& aXml )
       
   100     {
       
   101     CSimpleWinfo* self = new (ELeave) CSimpleWinfo( );
       
   102     CleanupStack::PushL( self );
       
   103     self->ConstructL( aXml );
       
   104     CleanupStack::Pop( self );
       
   105     return self;
       
   106     }
       
   107 
       
   108 // ----------------------------------------------------------
       
   109 // CSimpleWinfo::ValidateXmlL
       
   110 // ----------------------------------------------------------
       
   111 //
       
   112 void CSimpleWinfo::ValidateXmlL( const TDesC8& aName )
       
   113     {
       
   114     if ( aName.CompareF( KWinfoLocalName ) )
       
   115         {
       
   116         User::Leave( KErrCorrupt );
       
   117         }
       
   118     }
       
   119 
       
   120 // ----------------------------------------------------------
       
   121 // CSimpleWinfo::DefaultNamespace
       
   122 // ----------------------------------------------------------
       
   123 //
       
   124 TPtrC8 CSimpleWinfo::DefaultNamespace()
       
   125     {
       
   126     return CSimpleBaseDocument::DefaultNamespace();
       
   127     }
       
   128 
       
   129 
       
   130 // ----------------------------------------------------------
       
   131 // CSimpleWinfo::AddNamespaceL
       
   132 // ----------------------------------------------------------
       
   133 //
       
   134 void CSimpleWinfo::AddNamespaceL(
       
   135     const TDesC8& aPrefix,
       
   136     const TDesC8& aUri )
       
   137     {
       
   138     CSimpleBaseDocument::AddNamespaceL( aPrefix, aUri );
       
   139     }
       
   140 
       
   141 // ----------------------------------------------------------
       
   142 // CSimpleWinfo::NamespacesL
       
   143 // ----------------------------------------------------------
       
   144 //
       
   145 RPointerArray<MSimpleNamespace>& CSimpleWinfo::NamespacesL()
       
   146     {
       
   147     return CSimpleBaseDocument::NamespacesL();
       
   148     }
       
   149 
       
   150 // ----------------------------------------------------------
       
   151 // CSimpleWinfo::ExternalizeL
       
   152 // ----------------------------------------------------------
       
   153 //
       
   154 void CSimpleWinfo::ExternalizeL( RWriteStream& aStream )
       
   155     {
       
   156     CSimpleBaseDocument::ExternalizeL( aStream );
       
   157     }
       
   158 
       
   159 // ----------------------------------------------------------
       
   160 // CSimpleWinfo::Close
       
   161 // ----------------------------------------------------------
       
   162 //
       
   163 void CSimpleWinfo::Close()
       
   164     {
       
   165     CSimpleBaseDocument::Close();
       
   166     }
       
   167 
       
   168 // ----------------------------------------------------------
       
   169 // CSimpleWinfo::LocalName
       
   170 // ----------------------------------------------------------
       
   171 //
       
   172 const TDesC8& CSimpleWinfo::LocalName()
       
   173     {
       
   174     return CSimpleBaseDocument::LocalName();
       
   175     }
       
   176 
       
   177 // ----------------------------------------------------------
       
   178 // CSimpleWinfo::DefNamespaceL
       
   179 // ----------------------------------------------------------
       
   180 //
       
   181 MSimpleNamespace* CSimpleWinfo::DefNamespaceL()
       
   182     {
       
   183     return CSimpleBaseDocument::DefNamespaceL();
       
   184     }
       
   185 
       
   186 // ----------------------------------------------------------
       
   187 // CSimpleWinfo::HasContent
       
   188 // ----------------------------------------------------------
       
   189 //
       
   190 TBool CSimpleWinfo::HasContent()
       
   191     {
       
   192     return CSimpleBaseDocument::HasContent();
       
   193     }
       
   194 
       
   195 // ----------------------------------------------------------
       
   196 // CSimpleWinfo::ContentUnicodeL
       
   197 // ----------------------------------------------------------
       
   198 //
       
   199 HBufC* CSimpleWinfo::ContentUnicodeL()
       
   200     {
       
   201     return CSimpleBaseDocument::ContentUnicodeL();
       
   202     }
       
   203 
       
   204 // ----------------------------------------------------------
       
   205 // CSimpleWinfo::SetContentUnicodeL
       
   206 // ----------------------------------------------------------
       
   207 //
       
   208 void CSimpleWinfo::SetContentUnicodeL( const TDesC& aContent )
       
   209     {
       
   210     CSimpleBaseDocument::SetContentUnicodeL( aContent );
       
   211     }
       
   212 
       
   213 // ----------------------------------------------------------
       
   214 // CSimpleWinfo::SimpleElementsL
       
   215 // ----------------------------------------------------------
       
   216 //
       
   217 TInt CSimpleWinfo::SimpleElementsL( RPointerArray<MSimpleElement>& aElementArray )
       
   218     {
       
   219     return CSimpleBaseDocument::SimpleElementsL( aElementArray );
       
   220     }
       
   221 
       
   222 // ----------------------------------------------------------
       
   223 // CSimpleWinfo::AttrValueLC
       
   224 // ----------------------------------------------------------
       
   225 //
       
   226 HBufC* CSimpleWinfo::AttrValueLC( const TDesC8& aName )
       
   227     {
       
   228     return CSimpleBaseDocument::AttrValueLC( aName );
       
   229     }
       
   230 
       
   231 // ----------------------------------------------------------
       
   232 // CSimpleWinfo::AttrValue
       
   233 // ----------------------------------------------------------
       
   234 //
       
   235 const TDesC8* CSimpleWinfo::AttrValue( const TDesC8& aName )
       
   236     {
       
   237   return CSimpleBaseDocument::AttrValue( aName );
       
   238     }
       
   239 
       
   240 // ----------------------------------------------------------
       
   241 // CSimpleWinfo::AddAttrL
       
   242 // ----------------------------------------------------------
       
   243 //
       
   244 void CSimpleWinfo::AddAttrL( const TDesC8& aName, const TDesC& aValue )
       
   245     {
       
   246     CSimpleBaseDocument::AddAttrL( aName, aValue );
       
   247     }
       
   248 
       
   249 // ----------------------------------------------------------
       
   250 // CSimpleWinfo::SimpleAttributesL
       
   251 // ----------------------------------------------------------
       
   252 //
       
   253 TInt CSimpleWinfo::SimpleAttributesL( RPointerArray<MSimpleAttribute>& aArray )
       
   254     {
       
   255     return CSimpleBaseDocument::SimpleAttributesL( aArray );
       
   256     }
       
   257 
       
   258 // ----------------------------------------------------------
       
   259 // CSimpleWinfo::SimpleParentL
       
   260 // ----------------------------------------------------------
       
   261 //
       
   262 MSimpleElement* CSimpleWinfo::SimpleParentL()
       
   263     {
       
   264     return CSimpleBaseDocument::SimpleParentL( );
       
   265     }
       
   266 
       
   267 // ----------------------------------------------------------
       
   268 // CSimpleWinfo::DetachSimpleL
       
   269 // ----------------------------------------------------------
       
   270 //
       
   271 void CSimpleWinfo::DetachSimpleL()
       
   272     {
       
   273     User::Leave( KErrNotFound );
       
   274     }
       
   275 
       
   276 
       
   277 // ----------------------------------------------------------
       
   278 // CSimpleWinfo::AddSimpleElementL
       
   279 // ----------------------------------------------------------
       
   280 //
       
   281 MSimpleElement* CSimpleWinfo::AddSimpleElementL(
       
   282     const TDesC8& aNsUri,
       
   283     const TDesC8& aLocalName )
       
   284     {
       
   285     return CSimpleBaseDocument::AddSimpleElementL( aNsUri, aLocalName );
       
   286     }
       
   287 
       
   288 // ----------------------------------------------------------
       
   289 // CSimpleWinfo::AddSimpleElementL
       
   290 // ----------------------------------------------------------
       
   291 //
       
   292 MSimpleElement* CSimpleWinfo::AddSimpleElementL(
       
   293     const TDesC8& aLocalName )
       
   294     {
       
   295     return CSimpleBaseDocument::AddSimpleElementL( aLocalName );
       
   296     }
       
   297 
       
   298 
       
   299 // ----------------------------------------------------------
       
   300 // CSimpleWinfo::RemoveSimpleElement
       
   301 // ----------------------------------------------------------
       
   302 //
       
   303 void CSimpleWinfo::RemoveSimpleElement(
       
   304     const TDesC8& aNsUri,
       
   305     const TDesC8& aLocalName )
       
   306     {
       
   307     CSimpleBaseDocument::RemoveSimpleElement( aNsUri, aLocalName );
       
   308     }
       
   309 
       
   310 
       
   311 
       
   312