pushmtm/plugins/PushContentHandler/PushContentHandlerUtils.h
branchRCL_3
changeset 69 4455192101e4
equal deleted inserted replaced
65:8e6fa1719340 69:4455192101e4
       
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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:  Utilities
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PUSHCONTENTHANDLERUTILS_H
       
    21 #define PUSHCONTENTHANDLERUTILS_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 
       
    25 #include <e32def.h>
       
    26 #include <e32base.h>
       
    27 #include <nwx_status.h>
       
    28 #include <nw_wbxml_dictionary.h>
       
    29 #include <nw_encoder_stringtable.h>
       
    30 #include <nw_string_string.h>
       
    31 
       
    32 /**
       
    33 * Convert cXML status code to Symbian OS error code.
       
    34 * @param aNwxErrorCode cXML status.
       
    35 * @return Symbian OS error code.
       
    36 */
       
    37 TInt NwxStatusToErrCode( NW_Status_t aNwxErrorCode );
       
    38 
       
    39 /*
       
    40 *   The following tiny classes have been introduced to help putting C-style 
       
    41 *   Browser Engine structures to the Cleanup Stack, so that we can implement 
       
    42 *   a LEAVE-safe code.
       
    43 */
       
    44 
       
    45 /**
       
    46 * Encapsulate WBXML dictionary initialization.
       
    47 */
       
    48 class RWbxmlDictionary
       
    49     {
       
    50     public:
       
    51         void InitializeL( NW_Int32 aCount, NW_WBXML_Dictionary_t* aDictArray[] );
       
    52         void Close();
       
    53     };
       
    54 
       
    55 /**
       
    56 * Encapsulate a WBXML document tree.
       
    57 */
       
    58 class CDocumentTreeOwner : public CBase
       
    59     {
       
    60     public:
       
    61         CDocumentTreeOwner();
       
    62         CDocumentTreeOwner( NW_DOM_DocumentNode_t* aDocTree );
       
    63         ~CDocumentTreeOwner();
       
    64     public:
       
    65         void SetDocTree( NW_DOM_DocumentNode_t* aDocTree );
       
    66     private:
       
    67         NW_DOM_DocumentNode_t* iDocTree; ///< Owned.
       
    68     };
       
    69 
       
    70 /**
       
    71 * Encapsulate an NW_String_t.
       
    72 */
       
    73 class CStringOwner : public CBase
       
    74     {
       
    75     public:
       
    76         CStringOwner();
       
    77         CStringOwner( NW_String_t* aString );
       
    78         ~CStringOwner();
       
    79     public:
       
    80         void SetString( NW_String_t* aString );
       
    81     private:
       
    82         NW_String_t* iString; ///< Owned.
       
    83     };
       
    84 
       
    85 #endif // PUSHCONTENTHANDLERUTILS_H
       
    86