loggingservices/eventlogger/LogCli/inc/logclientop.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2002-2009 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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __LOGCLIENTOP_H__
       
    17 #define __LOGCLIENTOP_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "logpackage.h"
       
    21 #include <logcli.h>
       
    22 #include "logservcli.h"
       
    23 #include "LogServShared.h"
       
    24 
       
    25 /**
       
    26 @internalComponent
       
    27 */
       
    28 NONSHARABLE_CLASS(CLogClientOp) : public CActive
       
    29 	{
       
    30 public:
       
    31 	void Start(TRequestStatus& aObserver);
       
    32 	TInt Start();
       
    33 
       
    34 protected:
       
    35 	CLogClientOp(RLogSession& aSession, CLogPackage& aPackage, TLogOperationType aType, TInt aPriority);
       
    36 	~CLogClientOp();
       
    37 	void FetchResultFromServerL(TInt aResult);
       
    38 	void SetDataSlot1(TInt aValue);
       
    39 
       
    40 private:
       
    41 	void RunL();
       
    42 	void DoCancel();
       
    43 	TInt RunError(TInt aError);
       
    44 	TInt DoStartL();
       
    45 	virtual void InitiateRequestToServerL()=0;
       
    46 	virtual void CompleteL(TInt& aResult);
       
    47 
       
    48 protected:
       
    49 	CLogPackage& iPackage;
       
    50 	RLogSession& iSession;
       
    51 	TPckgBuf<TLogClientServerData> iData;
       
    52 
       
    53 private:
       
    54 	/**
       
    55 	 * The observer's request status
       
    56 	 */
       
    57 	TRequestStatus* iObserver;
       
    58 	};
       
    59 
       
    60 /**
       
    61 Add an event to the database
       
    62 @internalComponent
       
    63 */
       
    64 NONSHARABLE_CLASS(CLogAddEventClientOp) : public CLogClientOp
       
    65 	{
       
    66 public:
       
    67 	CLogAddEventClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
    68 	void Start(CLogEvent& aEvent, TRequestStatus& aObserver);
       
    69 	//
       
    70 private:
       
    71 	void InitiateRequestToServerL();
       
    72 	void CompleteL(TInt& aResult);
       
    73 	//
       
    74 private:
       
    75 	CLogEvent* iEvent;
       
    76 	};
       
    77 
       
    78 /**
       
    79 Change an event in the database
       
    80 @internalComponent
       
    81 */
       
    82 NONSHARABLE_CLASS(CLogChangeEventClientOp) : public CLogClientOp
       
    83 	{
       
    84 public:
       
    85 	CLogChangeEventClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
    86 	void Start(const CLogEvent& aEvent, TRequestStatus& aObserver);
       
    87 	//
       
    88 private:
       
    89 	void InitiateRequestToServerL();
       
    90 	//
       
    91 private:
       
    92 	const CLogEvent* iEvent;
       
    93 	};
       
    94 
       
    95 /**
       
    96 Get an event from the database
       
    97 @internalComponent
       
    98 */
       
    99 NONSHARABLE_CLASS(CLogGetEventClientOp) : public CLogClientOp
       
   100 	{
       
   101 public:
       
   102 	CLogGetEventClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   103 	void Start(CLogEvent& aEvent, TRequestStatus& aObserver);
       
   104 	//
       
   105 private:
       
   106 	void InitiateRequestToServerL();
       
   107 	void CompleteL(TInt& aResult);
       
   108 	//
       
   109 private:
       
   110 	CLogEvent* iEvent;
       
   111 	};
       
   112 
       
   113 /**
       
   114 Delete an event from the database
       
   115 @internalComponent
       
   116 */
       
   117 NONSHARABLE_CLASS(CLogDeleteEventClientOp) : public CLogClientOp
       
   118 	{
       
   119 public:
       
   120 	CLogDeleteEventClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   121 	void Start(TLogId aId, TRequestStatus& aObserver);
       
   122 	//
       
   123 private:
       
   124 	void InitiateRequestToServerL();
       
   125 	//
       
   126 private:
       
   127 	TLogId iId;
       
   128 	};
       
   129 
       
   130 /**
       
   131 Add an event type to the database
       
   132 @internalComponent
       
   133 */
       
   134 NONSHARABLE_CLASS(CLogAddTypeClientOp) : public CLogClientOp
       
   135 	{
       
   136 public:
       
   137 	CLogAddTypeClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   138 	void Start(const CLogEventType& aEventType, TRequestStatus& aObserver);
       
   139 	//
       
   140 private:
       
   141 	void InitiateRequestToServerL();
       
   142 	//
       
   143 private:
       
   144 	const CLogEventType* iEventType;
       
   145 	};
       
   146 
       
   147 /**
       
   148 Change an event type in the database
       
   149 @internalComponent
       
   150 */
       
   151 NONSHARABLE_CLASS(CLogChangeTypeClientOp) : public CLogClientOp
       
   152 	{
       
   153 public:
       
   154 	CLogChangeTypeClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   155 	void Start(const CLogEventType& aEventType, TRequestStatus& aObserver);
       
   156 	//
       
   157 private:
       
   158 	void InitiateRequestToServerL();
       
   159 	//
       
   160 private:
       
   161 	const CLogEventType* iEventType;
       
   162 	};
       
   163 
       
   164 /**
       
   165 Get event type details
       
   166 @internalComponent
       
   167 */
       
   168 NONSHARABLE_CLASS(CLogGetTypeClientOp) : public CLogClientOp
       
   169 	{
       
   170 public:
       
   171 	CLogGetTypeClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   172 	void Start(CLogEventType& aEventType, TRequestStatus& aObserver);
       
   173 	//
       
   174 private:
       
   175 	void InitiateRequestToServerL();
       
   176 	void CompleteL(TInt& aResult);
       
   177 	//
       
   178 private:
       
   179 	CLogEventType* iEventType;
       
   180 	};
       
   181 
       
   182 /**
       
   183 Delete an event type
       
   184 @internalComponent
       
   185 */
       
   186 NONSHARABLE_CLASS(CLogDeleteTypeClientOp) : public CLogClientOp
       
   187 	{
       
   188 public:
       
   189 	CLogDeleteTypeClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   190 	void Start(TUid aUid, TRequestStatus& aObserver);
       
   191 	//
       
   192 private:
       
   193 	void InitiateRequestToServerL();
       
   194 	//
       
   195 private:
       
   196 	TUid iUid;
       
   197 	};
       
   198 
       
   199 /**
       
   200 Get engine configuration
       
   201 @internalComponent
       
   202 */
       
   203 NONSHARABLE_CLASS(CLogGetConfigClientOp) : public CLogClientOp
       
   204 	{
       
   205 public:
       
   206 	CLogGetConfigClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   207 	void Start(TLogConfig& aConfig, TRequestStatus& aObserver);
       
   208 	//
       
   209 private:
       
   210 	void InitiateRequestToServerL();
       
   211 	void CompleteL(TInt& aResult);
       
   212 	//
       
   213 private:
       
   214 	TLogConfig* iConfig;
       
   215 	};
       
   216 
       
   217 /**
       
   218 Change the configuration
       
   219 @internalComponent
       
   220 */
       
   221 NONSHARABLE_CLASS(CLogChangeConfigClientOp) : public CLogClientOp
       
   222 	{
       
   223 public:
       
   224 	CLogChangeConfigClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   225 	void Start(const TLogConfig& aConfig, TRequestStatus& aObserver);
       
   226 	//
       
   227 private:
       
   228 	void InitiateRequestToServerL();
       
   229 	//
       
   230 private:
       
   231 	const TLogConfig* iConfig;
       
   232 	};
       
   233 
       
   234 /**
       
   235 Clear the main event log
       
   236 @internalComponent
       
   237 */
       
   238 NONSHARABLE_CLASS(CLogClearLogClientOp) : public CLogClientOp
       
   239 	{
       
   240 public:
       
   241 	CLogClearLogClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   242 	void Start(const TTime& aDate, TRequestStatus& aObserver
       
   243 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
       
   244 			, TSimId aSimId = KLogNullSimId
       
   245 #endif			
       
   246 			);
       
   247 	//
       
   248 private:
       
   249 	void InitiateRequestToServerL();
       
   250 	//
       
   251 private:
       
   252 	TTime iDate; // UTC
       
   253 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
       
   254 	TSimId iSimId;
       
   255 #endif			
       
   256 	};
       
   257 
       
   258 /**
       
   259 Clear a recent event log
       
   260 @internalComponent
       
   261 */
       
   262 NONSHARABLE_CLASS(CLogClearRecentClientOp) : public CLogClientOp
       
   263 	{
       
   264 public:
       
   265 	CLogClearRecentClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   266 	void Start(TLogRecentList aList, TRequestStatus& aObserver
       
   267 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
       
   268 			, TSimId aSimId = KLogNullSimId
       
   269 #endif			
       
   270 			);
       
   271 	//
       
   272 private:
       
   273 	void InitiateRequestToServerL();
       
   274 	//
       
   275 private:
       
   276 	TLogRecentList iList;
       
   277 #ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM	
       
   278 	TSimId iSimId;
       
   279 #endif			
       
   280 	};
       
   281 
       
   282 /**
       
   283 Setup a view - Only synch version provided
       
   284 @internalComponent
       
   285 */
       
   286 NONSHARABLE_CLASS(CLogViewSetupClientOp) : public CLogClientOp
       
   287 	{
       
   288 public:
       
   289 	CLogViewSetupClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   290 	TInt Start(TLogViewId aViewId, const CLogFilterList& aFilterList, TInt aParam, TLogFilterConstructionType aFilterConstructionType);
       
   291 	//
       
   292 private:
       
   293 	void InitiateRequestToServerL();
       
   294 	//
       
   295 private:
       
   296 	TLogViewId iViewId;
       
   297 	const CLogFilterList* iFilterList;
       
   298 	TInt iParam;
       
   299 	};
       
   300 
       
   301 /**
       
   302 Remove an event from a view - Only synch version provided
       
   303 @internalComponent
       
   304 */
       
   305 NONSHARABLE_CLASS(CLogViewRemoveEventClientOp) : public CLogClientOp
       
   306 	{
       
   307 public:
       
   308 	CLogViewRemoveEventClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   309 	TInt Start(TLogViewId aViewId, TLogId aId);
       
   310 	//
       
   311 private:
       
   312 	void InitiateRequestToServerL();
       
   313 	//
       
   314 private:
       
   315 	TLogViewId iViewId;
       
   316 	TLogId iId;
       
   317 	};
       
   318 
       
   319 /**
       
   320 Do maintenance on the database - for view creation?
       
   321 @internalComponent
       
   322 */
       
   323 NONSHARABLE_CLASS(CLogMaintainClientOp) : public CLogClientOp
       
   324 	{
       
   325 public:
       
   326 	CLogMaintainClientOp(RLogSession& aSession, CLogPackage& aPackage, TInt aPriority);
       
   327 	//
       
   328 private:
       
   329 	void InitiateRequestToServerL();
       
   330 	};
       
   331 
       
   332 #endif