homescreenpluginsrv/hspstools/inc/hspsodtdump.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Header for ChspsOdtDump.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HSPS_ODTDUMP_H
       
    20 #define HSPS_ODTDUMP_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class ChspsDomNode;
       
    28 class ChspsODT;
       
    29 class ChspsLogBus;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  * Static helper class for dumping DOM model to a textual logging bus.
       
    35  * 
       
    36  * @lib hspsTools.lib
       
    37  * @since S60 5.0
       
    38  * @ingroup group_homescreenpluginservice_tools
       
    39  */
       
    40 class ChspsOdtDump : public CBase
       
    41     {
       
    42 public: // Methods for public usage.
       
    43     /**
       
    44      * Dumps DOM document and resources contained in given ODT.
       
    45      * 
       
    46      * @since S60 5.0 
       
    47      * @param aOdt          ODT object that contains DOM document and resources.
       
    48      * @param aLogBus       Target logging channel to be used as output. 
       
    49     */
       
    50     IMPORT_C static void Dump( ChspsODT& aOdt, ChspsLogBus& aLogBus );
       
    51     
       
    52 private: // Internal.
       
    53     /**
       
    54      * Dumps DOM document and resources contained in given ODT.
       
    55      * 
       
    56      * @param aDomDocument  Document to be dumped.
       
    57      * @param aLogBus       Target logging channel to be used as output. 
       
    58     */
       
    59     static void DumpL( ChspsODT& aOdt, ChspsLogBus& aLogBus );
       
    60     
       
    61     /**
       
    62      * Get depth of node.
       
    63      * 
       
    64      * @param   aNode       Source node.
       
    65      * @return  TInt        Depth of node.
       
    66     */
       
    67     static TInt GetNodeDepth( ChspsDomNode *aNode );
       
    68 
       
    69     /**
       
    70      * String helper method.
       
    71      * 
       
    72      * @param   aText           Source text.
       
    73      * @param   aDepth          Depth.
       
    74      * @param   aDelim          Delimiter.
       
    75      * @param   aShowHighlight  Show highlight.
       
    76      * @return  HBufC8*         Resulted text.       
       
    77     */
       
    78     static HBufC8* GetFixedTextLC( const TDesC8& aText,
       
    79                                    const TInt aDepth,
       
    80                                    const TDesC8& aDelim,
       
    81                                    TBool aShowHighlight );    
       
    82     };
       
    83 
       
    84 #endif // HSPS_DOMDUMP_H