lbs/common/inc/LbsLogger.h
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 /**
       
     2 * Copyright (c) 2006-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 the License "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24 */
       
    25 
       
    26 #ifndef LBS_LOGGER_H
       
    27 #define LBS_LOGGER_H
       
    28 
       
    29 #include <lbslogevent.h>
       
    30 #include <e32base.h>
       
    31 
       
    32 class CLbsLogWriterEngine;
       
    33 
       
    34 class RLbsLogger
       
    35 /**
       
    36  Class the provides the APIs for adding and updating LBS events into the LogEng.
       
    37  In order to add (or update) any event, a handle must have been opened for this class 
       
    38  (so OpenL() must have been called, without calling Close() meanwhile on the class).
       
    39  
       
    40  Internally, the engine, queues the add and update requests until they can be processed. The 
       
    41  queue has a maximum size, so if too many items will get on the queue the AddEventL() method 
       
    42  can return an error.
       
    43 
       
    44  When the client finishes sending all the add and update requests, Close() should be 
       
    45  called on the class. This will ensure that the internal engine logs all the events it 
       
    46  queued into the LogEng. When calling Close() it will wait for LogEng to finish 
       
    47  logging all the events.
       
    48  
       
    49  @internalTechnology
       
    50  @released
       
    51 */
       
    52 	{
       
    53 public:
       
    54 	IMPORT_C RLbsLogger();
       
    55 	IMPORT_C ~RLbsLogger();
       
    56 	
       
    57 	IMPORT_C TInt Open(TUint aMaxBufferSize);
       
    58 	IMPORT_C TInt AddEvent(CLbsLogEvent& aLogEvent);
       
    59 	IMPORT_C TInt UpdateEvent(CLbsLogEvent& aLogEvent);
       
    60 	IMPORT_C TInt Close();
       
    61 	// for BC consideration
       
    62 	virtual void ExtensionInterfaceL(TUid aInterface, void*& aObject);
       
    63 
       
    64 private:
       
    65 	void CheckLoggingAdminSettings();
       
    66 
       
    67 private:
       
    68 	/** Pointer to the active object which does the logging */
       
    69 	CLbsLogWriterEngine* iLogWriterEngine;
       
    70 	
       
    71 	/** Flag to indicate if logging is currently On or Off, determined from the admin db setting. */
       
    72 	TBool iLoggingOn;
       
    73 	}; // class RLbsLogger
       
    74 
       
    75 #endif // LBS_LOGGER_H