testconns/statdesktop/desktop/source/lib/inc/statmember.h
changeset 4 b8d1455fddc0
equal deleted inserted replaced
2:73b88125830c 4:b8d1455fddc0
       
     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:     STAT member class header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef STATMEMBER30_H
       
    22 #define STATMEMBER30_H
       
    23 
       
    24 #include <creporter.h>
       
    25 #include <statengine.h>
       
    26 #include "ini.h"
       
    27 
       
    28 #define MAX_ID_PREFIX				256
       
    29 
       
    30 class STATDLLMember
       
    31 {
       
    32 public:
       
    33 	STATDLLMember(const STATCONNECTTYPE iConnectType, 
       
    34 				  const char *pszPlatformType,
       
    35 				  Reporter *theRep = NULL);
       
    36 	virtual ~STATDLLMember();
       
    37 	bool Prepare(int iMillisecondDelay, LPTSTR pszLogPath, bool bAppend, MessageReporter *const aMessageReporter, LPTSTR pszRefDir, const bool bRemoveOldImages, const int iFactor, bool bState);
       
    38 	int SetCommandDelay(int iMillisecondDelay);		// set the command delay
       
    39 	int SetLogging(LPTSTR pszLogPath, bool bAppend, MessageReporter *const aMessageReporter);// set logging of the back end operations
       
    40 	int SetImageVerification(LPTSTR pszRefDir, const bool bRemoveOldImages, const int iFactor);
       
    41 	void SetResponseTimeout(const unsigned long lMilliseconds) { pEngine->iMaxTimeLimit = lMilliseconds; }
       
    42 	void SetMultithreaded(bool bState = true) { pEngine->SetMultithreaded(bState); }	// set multithreaded check
       
    43 
       
    44 	int OpenScriptFile(LPCTSTR pszText, bool bIsFile);
       
    45 	int RunScript(ScriptProgressMonitor *const monitor);
       
    46 	int SendCommandFile(LPCTSTR pszFile, ScriptProgressMonitor *const monitor);			// execute a command file
       
    47 	int SendRawCommand(LPCTSTR pszText, ScriptProgressMonitor *const monitor);			// execute a command script
       
    48 	int StopProcessing(void);
       
    49 	int GetCommandCount(LPCTSTR pszFile, int* commandCount);
       
    50 	int GetCurrentCommandNumber( int* commandNumber);
       
    51 	const char * GetReceivedData(void);
       
    52 	const char * GetErrorText( int errorCode );
       
    53 
       
    54 	int GetSnapshot(TBitmapFileHeader **ppFile, TBitmapInfoHeader **ppBitmap, char **ppData, unsigned long *pSize);
       
    55 	const char * GetDeviceInfo() { return pEngine->pDeviceInfo; }
       
    56 	const char * GetTEFSharedData() { return pEngine->iTEFSharedData; }
       
    57 	const char * GetErrorText() {	return szErrorText; }	// returns complete error message
       
    58 	int GetErrorCode() { return iErrorCode; }		// return just the code
       
    59 
       
    60 	static LPTSTR ToUnicode(const char *string);	// convert ANSI to Unicode
       
    61 	static const char * ToAnsi(LPCTSTR string);			// convert Unicode to ANSI
       
    62 	static void ParseConnection(char *pConnection, STATCONNECTTYPE *pType, char **ppAddress);
       
    63 
       
    64 	STATCONNECTTYPE iConnectionType;				// type of connection
       
    65 	char *pszAddress;								// our selected address
       
    66 
       
    67 	STATDLLMember* lPrevConnection;					// previous connection in list
       
    68 	STATDLLMember* lNextConnection;					// next connection in list
       
    69 
       
    70 private:
       
    71 	void Message(const char * message, ...);
       
    72 	void ErrorMessage(const char * message, ...);
       
    73 
       
    74 	CSTATEngine *pEngine;							// pointer to back end
       
    75 	int iErrorCode;									// error code
       
    76 	char szErrorText[MAX_ERROR_MSG_LEN * 2];		// error message
       
    77 	char szPrefix[MAX_ID_PREFIX];					// id prefix
       
    78 	Reporter *pRep;									// pointer to logging
       
    79 	CStatIniFile statIniFile;							// ini file reader
       
    80 };
       
    81 
       
    82 #endif // STATMEMBER30_H