sapi_logging/tsrc/testing/tloggingservicetest/inc/loggingservice.h
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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 the License "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:   Includes logging synchronous service methods.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef LOGGINGDELIGATOR_H
       
    21 #define LOGGINGDELIGATOR_H
       
    22 
       
    23 
       
    24 /**
       
    25 * Forward Declarations
       
    26 */
       
    27 class CLogAsyncService  ;
       
    28 class CLogSyncService   ;
       
    29 class CLogsEvent        ;
       
    30 class CLogsFilter       ;
       
    31 class MLoggingCallback  ;
       
    32 class CCallbackSlot ;
       
    33 class CLogIter      ;
       
    34 
       
    35 /**
       
    36 * CLoggingService: Deligator class declariation, this is a wrapper class
       
    37 * for all the functionalities offers by symbian logging service.
       
    38 */
       
    39 
       
    40 
       
    41 class CLoggingService : public CBase
       
    42     {
       
    43     public :
       
    44         /**
       
    45         *  NewL: Two phased construction
       
    46         */
       
    47 
       
    48         IMPORT_C static CLoggingService* NewL() ;
       
    49 
       
    50         /**
       
    51         * NewLC: Creates an instance of CLogSyncServiceClass
       
    52         * Two Phased constructor
       
    53         * returns newly allocated object.
       
    54         */
       
    55 
       
    56         static CLoggingService* NewLC() ;
       
    57 
       
    58         /**
       
    59         * Default Destructor.
       
    60         */
       
    61 
       
    62         ~CLoggingService() ;
       
    63 
       
    64         /**
       
    65         * Adds an event to the event database synchronously
       
    66         * @parm Details of the event to be logged
       
    67         */
       
    68 
       
    69         IMPORT_C TLogId AddEventL( CLogsEvent *aSapiEvent ) ;
       
    70 
       
    71         
       
    72         /**
       
    73         * Async AddEvent function. adds an Event asynchronously
       
    74         * do event database
       
    75         * @param aEvent, details of the event to be added to the
       
    76         * event database
       
    77         */
       
    78 
       
    79         IMPORT_C TInt AddEventL( TUint aTransId ,
       
    80                                  CLogsEvent* aSapiEvent ,
       
    81                                  MLoggingCallback* aCallback ) ;
       
    82         /**
       
    83         * Deletes an event from the event database synchronously
       
    84         * @parm Details of the event to be logged
       
    85         * @param aFilter, search criteria for this event in event database
       
    86         */
       
    87 
       
    88         IMPORT_C TInt DeleteEventL( TLogId aLogId );
       
    89 
       
    90         /**
       
    91         * Deletes a event from the event database
       
    92         * @param aLogId Event id of the event in the database
       
    93         * @param aFilter, search criteria for this event in event database
       
    94         */
       
    95 
       
    96         IMPORT_C void DeleteEventL( TUint aTransId ,
       
    97                                     TLogId aLogId,
       
    98                                     MLoggingCallback* aCallback ) ;
       
    99 
       
   100         /**
       
   101         * Gets the list of items from the log database synchronously
       
   102         * @param aTransId: Transaction ID.
       
   103         * @param aCallBack: Notify callback object
       
   104         * @param aFilter : Query Criteria for log database
       
   105         */
       
   106 
       
   107         IMPORT_C CLogIter* GetListL( CLogsFilter* aFilter ) ;
       
   108 
       
   109         /**
       
   110         * Gets the list of items from the log database asynchronously
       
   111         * @param aTransId: Transaction ID.
       
   112         * @param aFilter : Query Criteria for log database
       
   113         */
       
   114 
       
   115         IMPORT_C TInt GetListL( TUint aTransId ,
       
   116                                 CLogsFilter* aFilter ,
       
   117                                 MLoggingCallback* aCallback ) ;
       
   118 
       
   119         /**
       
   120         * NotifyUpdatesL, overloaded function for Notifications
       
   121         *
       
   122         * aUid, Transation Id
       
   123         * @param aDelay, Minium delay for reciving the updates
       
   124         * @param aCallback callback address for notifications
       
   125         */
       
   126 
       
   127         IMPORT_C TInt NotifyUpdatesL( TUint aUid ,
       
   128                                       TTimeIntervalMicroSeconds32 aDelay ,
       
   129                                       MLoggingCallback *aCallback );
       
   130 
       
   131         /**
       
   132         * CancelServiceL, cancels the on going service
       
   133         * @param aTransid
       
   134         */
       
   135 
       
   136         IMPORT_C TInt CancelServiceL( TUint aTransid );
       
   137 
       
   138 
       
   139         protected :
       
   140 
       
   141         /**
       
   142         * ConstructL(): Internal method to construct members
       
   143         */
       
   144 
       
   145         void ConstructL() ;
       
   146 
       
   147         /**
       
   148         * Default constructor
       
   149         */
       
   150 
       
   151         CLoggingService() ;
       
   152 
       
   153 
       
   154 
       
   155     private :
       
   156 
       
   157         CLogSyncService *iLogService ;
       
   158         CLogsEvent*       iSapiEvent;
       
   159         RArray <CCallbackSlot *> iRegTable ;
       
   160 
       
   161     };
       
   162 
       
   163 #endif