0
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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:
|
|
15 |
* CHTMLOutput
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef __CHTMLOutput_H__
|
|
22 |
#define __CHTMLOutput_H__
|
|
23 |
|
|
24 |
/********************************************************************************
|
|
25 |
*
|
|
26 |
* System Includes
|
|
27 |
*
|
|
28 |
********************************************************************************/
|
|
29 |
#include <stdio.h>
|
|
30 |
|
|
31 |
/********************************************************************************
|
|
32 |
*
|
|
33 |
* Local Includes
|
|
34 |
*
|
|
35 |
********************************************************************************/
|
|
36 |
#include "UCCS_Interfaces.h"
|
|
37 |
|
|
38 |
|
|
39 |
/********************************************************************************
|
|
40 |
*
|
|
41 |
* Defines
|
|
42 |
*
|
|
43 |
********************************************************************************/
|
|
44 |
#define MAXLOGFILENAMELEN 256
|
|
45 |
#define MAXLINELENGTH 1024
|
|
46 |
|
|
47 |
typedef enum {
|
|
48 |
RT_INVALID,
|
|
49 |
RT_COMMAND,
|
|
50 |
RT_COMMAND_REPLY,
|
|
51 |
RT_ENVIRONMENT,
|
|
52 |
RT_COUNT
|
|
53 |
} TRecordType;
|
|
54 |
|
|
55 |
|
|
56 |
/********************************************************************************
|
|
57 |
*
|
|
58 |
* CHTMLOutput
|
|
59 |
*
|
|
60 |
********************************************************************************/
|
|
61 |
class CHTMLOutput : public IOutput
|
|
62 |
{
|
|
63 |
public:
|
|
64 |
CHTMLOutput();
|
|
65 |
~CHTMLOutput();
|
|
66 |
|
|
67 |
int SetFilename( char *aFilename );
|
|
68 |
|
|
69 |
// from IOutput
|
|
70 |
void StartUsecase( int aID );
|
|
71 |
void EndUsecase( int aID, int aResult );
|
|
72 |
void Error( int aErrorCode, char *aErrorString );
|
|
73 |
void CompletedScript();
|
|
74 |
|
|
75 |
void ExecuteCommand( TUccsCommand aCommand, CDataRecord *aArgs );
|
|
76 |
void ExecuteCommandResult( int aUccsErrorcode );
|
|
77 |
void ExecuteCommandReply( CDataRecord *aReply );
|
|
78 |
|
|
79 |
void DisplayHelp();
|
|
80 |
void DisplayLastCommand( CDataRecord *aCommand );
|
|
81 |
void DisplayLastReply( CDataRecord *aResult );
|
|
82 |
void DisplayEnvironment( CDataRecord *aEnvironment );
|
|
83 |
|
|
84 |
void ExecuteString( char *aCommandLine );
|
|
85 |
void ExecuteStringResult( int aUccsErrorcode );
|
|
86 |
|
|
87 |
void StartServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused );
|
|
88 |
void StopServiceResult( int aServiceID, char *aServiceHost, int aStubReturnCode, int aErrorCode, int aUnused );
|
|
89 |
|
|
90 |
private:
|
|
91 |
// helper methods
|
|
92 |
void OutputLine( FILE *aFile, char *aLine );
|
|
93 |
void OutputBeginTags();
|
|
94 |
void OutputDataRecord( FILE* aFile, CDataRecord *aArgs, TRecordType aRecordType, TUccsCommand aCommand );
|
|
95 |
void OutputLineBreak( FILE* aFile );
|
|
96 |
int IsFailedResult( CDataField *aField );
|
|
97 |
|
|
98 |
// log files
|
|
99 |
FILE *iFile;
|
|
100 |
FILE *iFileDebug;
|
|
101 |
FILE *iFileNoRefresh;
|
|
102 |
char iLogName[MAXLOGFILENAMELEN];
|
|
103 |
char iDebugLogName[MAXLOGFILENAMELEN];
|
|
104 |
char iLogNameNoRefresh[MAXLOGFILENAMELEN];
|
|
105 |
|
|
106 |
// standard line buffer
|
|
107 |
char iLineBuffer[MAXLINELENGTH];
|
|
108 |
|
|
109 |
// state
|
|
110 |
bool iCompletedScriptCalled;
|
|
111 |
int iCounter;
|
|
112 |
|
|
113 |
// configurations - initialised in the constructor
|
|
114 |
char *iNonZeroResultColour;
|
|
115 |
char *iRecordTableTitle[RT_COUNT];
|
|
116 |
char *iRecordTableTitleBackgroundColour[RT_COUNT];
|
|
117 |
char *iRecordTableBorderColour[RT_COUNT];
|
|
118 |
char *iStandardRowColour[RT_COUNT];
|
|
119 |
int iStandardRowCount[RT_COUNT];
|
|
120 |
};
|
|
121 |
|
|
122 |
#endif //__CHTMLOutput_H__
|