dosservices/tsrc/dsytesttool/dsytfstifadapter/inc/tfastiftestlog.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Declaration of CTFAStifTestLog class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __TFASTIFTESTLOG_H__
       
    20 #define __TFASTIFTESTLOG_H__
       
    21 
       
    22 #include "ctfatestlog.h"
       
    23 
       
    24 class CStifLogger;
       
    25 class TTFAOverflowHandler;
       
    26 const TInt KMaxLogLength = 254; // From STIF
       
    27 
       
    28 /**
       
    29 * Implements the abstract logger interface to delegate logging to STIF-TF logger.
       
    30 */
       
    31 NONSHARABLE_CLASS( CTFAStifTestLog ): public CTFATestLog
       
    32     {
       
    33     public:
       
    34         /**
       
    35         * Creates a new logger
       
    36         */
       
    37         static CTFAStifTestLog* NewLC( void );
       
    38 
       
    39         /**
       
    40         * Destructor
       
    41         */
       
    42         virtual ~CTFAStifTestLog( void );
       
    43     
       
    44     private:
       
    45         /**
       
    46         * Constructor
       
    47         */
       
    48         CTFAStifTestLog( void );
       
    49 
       
    50         /**
       
    51         * 2nd phase constructor
       
    52         */
       
    53         void ConstructL( void );
       
    54 
       
    55         /**
       
    56         * Copy constructor is hidden
       
    57         */
       
    58         CTFAStifTestLog( const CTFAStifTestLog& aLog );
       
    59 
       
    60         /**
       
    61         * Assignment operator is hidden
       
    62         */
       
    63         CTFAStifTestLog& operator=( const CTFAStifTestLog& aLog );
       
    64 
       
    65     public:
       
    66         /**
       
    67         * Writes data to log
       
    68         */
       
    69         void Write( const TDesC& aDes );
       
    70 
       
    71         /**
       
    72         * Writes data to log
       
    73         */
       
    74         void Write( const TDesC8& aDes );
       
    75 
       
    76         /**
       
    77         * Writes formatted to log
       
    78         */
       
    79         void Write( TRefByValue<const TDesC> aDes, ... );
       
    80 
       
    81         /**
       
    82         * Writes formatted to log
       
    83         */
       
    84         void Write( TRefByValue<const TDesC8> aDes, ... );
       
    85 
       
    86         /**
       
    87         * Writes a block of data to log. If logging HTML, this wraps the block into <pre><blockquote>
       
    88         */
       
    89         void WriteBlock( const TDesC& aDes );
       
    90 
       
    91         /**
       
    92         * Writes a block of data to log. If logging HTML, this wraps the block into <pre><blockquote>
       
    93         */
       
    94         void WriteBlock( const TDesC8& aDes );
       
    95 
       
    96         /**
       
    97         * Writes an end-of-line character to log
       
    98         */
       
    99         void EndLine( void );
       
   100 
       
   101         /**
       
   102         * Starts a new chapter
       
   103         */
       
   104         void StartChapter( void );
       
   105 
       
   106         /**
       
   107         * Starts a bulleted list
       
   108         */
       
   109         void StartList( void );
       
   110 
       
   111         /**
       
   112         * Writes formatted data into bulleted list at given depth
       
   113         */
       
   114         void WriteList( TInt aDepth, TRefByValue<const TDesC> aDes, ... );
       
   115 
       
   116         /**
       
   117         * Writes formatted data into bulleted list at given depth
       
   118         */
       
   119         void WriteList( TInt aDepth, TRefByValue<const TDesC8> aDes, ... );
       
   120 
       
   121         /**
       
   122         * Ends a bulleted list
       
   123         */
       
   124         void EndList( void );
       
   125 
       
   126         /**
       
   127         * Sets logging style
       
   128         */
       
   129         void SetStyle( TTFLogStyle aStyle );
       
   130 
       
   131         /**
       
   132         * Sets logging color
       
   133         */
       
   134         void SetColor( TUint32 aColor );
       
   135 
       
   136     private:
       
   137         /**
       
   138         * Writes start of list entry
       
   139         */
       
   140         void WriteListEntryStart( TInt aDepth );
       
   141     
       
   142     private:
       
   143         CStifLogger* iLogger;
       
   144         TBuf<KMaxLogLength> iLogBuffer;
       
   145         TBuf8<KMaxLogLength> iLogBuffer8;
       
   146         TTFAOverflowHandler* iOverflowHandler;
       
   147         TInt iCurrentDepth;
       
   148         TTFLogStyle iStyle;
       
   149         TInt iColor;
       
   150     };
       
   151 
       
   152 #endif