os/persistentdata/traceservices/tracefw/ulogger/src/uloggerserver/uloggerserver.h
Update contrib.
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 
     2 // All rights reserved.
 
     3 // This component and the accompanying materials are made available
 
     4 // under the terms of "Eclipse Public License v1.0"
 
     5 // which accompanies this distribution, and is available
 
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    14 // ULogger Server header file
 
    24 #ifndef ULOGGERSERVER_H
 
    25 #define ULOGGERSERVER_H
 
    27 #include "outputframework.h" // COutputFramework
 
    28 #include "uloggerconfigmanager.h" // CConfig, CConfigSettingsIter, MConfigObserver
 
    29 #include "uloggershared.h"
 
    30 #include "uloggerwatcher.h"
 
    31 #include "pluginallocator.h"
 
    32 #include "inputframework.h"
 
    33 #include <d32btrace.h> // RBTrace
 
    45 enum TULoggerSrvPanics
 
    51 /** CULoggerServer server class.
 
    52 This class is responsible for maintaining the server state.
 
    54 class CULoggerServer : public CServer2, 
 
    55 					   public MDataWatcherObserver, 
 
    56 					   public MInputFrameworkObserver
 
    60 	static CULoggerServer* NewLC(TInt aPriority);
 
    64 	static TInt StartServer();
 
    65 	void IncrementSessions();
 
    66 	void DecrementSessions();
 
    69 	TInt RunError(TInt aError);
 
    71 	//from MInputFrameworkObserver
 
    72 	ControlData* ProcessCommandL(TCommand aOpCode, RArray<TPtrC8>& aArguments);
 
    73 	void DoPostProcessing(TCommand aCmd);
 
    76 	void DataNotification();
 
    82 	void RunAsService(TBool aRunAsService); // Not implemented yet
 
    83 	TInt Start(); //this is actually only called from inside the server, or by the test framework.
 
    85 	TInt RestartOutputting();
 
    86 	void ReadBufferL(); //this is actually only called from inside the server, or by the test framework.
 
    90 	TInt GetActiveFilters(RArray<TUint32>& aListBuffer,TInt aFilterType);
 
    91 	TInt SetActiveFilterL(RArray<TUint32> aCategory, TInt aFilterType);
 
    92 	TInt RemoveActiveFilter(RArray<TUint32>& aValue, const TInt aFilterType);
 
    93 	TInt SetSecondaryFiltering(const TDesC8& aEnabled);
 
    94 	TInt GetSecondaryFiltering(TBool& aEnabled);
 
    97 	TInt SetPluginSettings(const TDesC8& aPluginname, RArray<TPtrC8>& aListBuffer);
 
    98 	TInt RemovePluginSettingsL(const TDesC8& aPluginName);
 
    99 	TInt GetActiveOutputPlugin(RArray<TPtrC8>& aListBuffer);
 
   100 	TInt SetActiveOutputPlugin(const TDesC8& aPluginname);
 
   101 	TInt GetInstalledOutputPlugins(RArray<TPtrC8>& aListBuffer);
 
   102 	TInt DeActivateInputPlugin(const TDesC8& aPluginname);
 
   103 	TInt GetActiveInputPlugin(RArray<TPtrC8>& aListBuffer);
 
   104 	TInt SetActiveInputPlugin(const TDesC8& aPluginname);
 
   105 	TInt GetInstalledInputPluginsL(RArray<TPtrC8>& aListBuffer);
 
   108 	TInt GetOptionsSettingsL(const TDesC8& aMedianame, RArray<TPtrC8>& aListBuffer);
 
   109 	TInt GetBufandDataNotifyValuesL(const TDesC8& aSetting,TInt& value);
 
   110 	TInt SetBufferMode(const TDesC8& aValue);
 
   111 	TInt SetBufferSizeL(TInt aSize);
 
   112 	TInt SetDataNotificationSizeL(TInt aSize);
 
   115 	//server related stuff
 
   116 	CULoggerServer(TInt aPriority);
 
   118 	static TInt StartServerL();
 
   119 	static void PanicServer(TULoggerSrvPanics aPanic);
 
   120 	static void PanicClient(const RMessage2& aMessage, TULoggerSrvPanics aPanic);
 
   121 	void ShutDownServer();
 
   122 	void RequestCancel();
 
   124 	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
 
   127 	TInt TraceSettingsOnBootL();
 
   128 	TInt ResetBtracePrimaryFilters(RBTrace& aBTrace);
 
   130 	//action related things
 
   133 	void GetOptionsSettingsL(RArray<TPtrC8>& aListBuffer,const TDesC8& aSetting);
 
   134 	TInt SetTraceSettings(const TDesC8&  aValue, const TDesC8& aSetting);
 
   137 	void InitializeFrameworksL();
 
   138 	void PrepareControlDataPayloadL(RBuf8& aPayloadBuf, const RArray<TPtrC8>& aArray);
 
   139 	void PrepareControlDataPayloadL(RBuf8& aPayloadBuf, const RArray<TUint32>& aArray);
 
   142 //	CConfig* CreateConfig(TFileName aFilePath);
 
   143 //	void InitializeConfigFileL();
 
   144 //	TInt CheckConfigFile(const TDesC& aFileName,const TDesC& aDirPath,TFileName& aFilePath);
 
   145 //	void CopyFileToSystemDrive(TFileName& aFilePath);
 
   148 	TInt DeActivateOutputPlugin(const TDesC8& aPluginname);
 
   149 	void FilterPlugins(TPluginFilter aFilter, RArray<TPtrC8>& aPluginList);
 
   150 	TBool CheckPluginExists(TPtrC8& aPluginName, TPluginFilter aPluginFilter);
 
   151 	void GetPluginAndSettingsL(TDes8& aPluginName, RPointerArray<TPluginConfiguration>* aSettings, TPluginFilter aPluginFilter);
 
   152 	void AsynchDataRequest();
 
   154 	//filter related stuff
 
   155 	ControlData* SetPrimaryFilters(RArray<TPtrC8> &aArguments);
 
   156 	TInt GetValuesL(const TDesC8& aSectionName, RArray<TPtrC8>& aListBuffer);
 
   159 	static void CleanupTPluginConfigArray(TAny* aPtr);
 
   164 	TInt iSessionCounter;
 
   168 	CConfigFileManager* iConfigManager;
 
   169     /** Output Framework */
 
   170 	COutputFramework* iOutputFramework;
 
   171 	/** Input Framework main object. */
 
   172 	CInputFramework* iInputFramework;
 
   174 	CULoggerWatcher* iDataWatcher;
 
   175 	/** Plugin Allocator */
 
   176 	CPluginAllocator* iPluginAllocator;
 
   178 	RImplInfoPtrArray iPluginArray;
 
   184 	TInt      iDataNotification;
 
   185 	TFileName iUserFilePath;
 
   186 	TFileName iConfigFilePath;
 
   194 #endif // ULOGGERSERVER_H