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