lbs/common/inc/LbsLogEvent.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  @publishedPartner
       
    25  @released
       
    26 */
       
    27 
       
    28 #ifndef LBS_LOG_EVENT_H
       
    29 #define LBS_LOG_EVENT_H
       
    30 
       
    31 #include <e32base.h>
       
    32 #include <e32err.h>
       
    33 #include <logwrap.h>
       
    34 #include <logcli.h>
       
    35 #include <lbs/lbsloggerdefs.h>
       
    36 
       
    37 #include <lbspositioninfo.h>
       
    38 #include <lbssatellite.h>
       
    39 /**
       
    40  class for the privacy request information 
       
    41 */
       
    42 class TPrivacyRequestParams;
       
    43 
       
    44 /**
       
    45  class for the privacy response information 
       
    46 */
       
    47 class TPrivacyResponseParams;
       
    48 
       
    49 enum TLbsRequestOutcome
       
    50 /**
       
    51  enum for the request outcomes
       
    52 */
       
    53 	{
       
    54 	ELbsRequestOutcomeInconclusive =0,
       
    55 	ELbsRequestOutcomeSuccess,
       
    56 	ELbsRequestOutcomeFail,
       
    57 	ELbsRequestOutcomeCancel,
       
    58 	};
       
    59     
       
    60 class CLbsLogEvent : public CBase
       
    61 /**
       
    62  Base class for the classes representing LBS events to be logged. It provides the common 
       
    63  functionality (internalising, externalising, updating this class from another one and creating 
       
    64  a copy of this class).
       
    65  
       
    66  @prototype
       
    67 */
       
    68 	{
       
    69 public:
       
    70 	IMPORT_C static CLbsLogEvent* NewL(const CLogEvent& aLogEvent);
       
    71 	IMPORT_C CLogEvent* ExternalizeL() const;
       
    72 	IMPORT_C void SetPositionInfo(TPositionInfoBase* aPosInfo);
       
    73 
       
    74 	virtual ~CLbsLogEvent();
       
    75 	void UpdateL(const CLbsLogEvent& aLogEvent);
       
    76 	void UpdateRootEvent(CLogEvent* aTargetEvent);
       
    77 	CLbsLogEvent* CopyL() const;
       
    78 	
       
    79 	// Inline functions
       
    80 	IMPORT_C void SetDirection(TBool aDirection);
       
    81 	IMPORT_C TBool Direction() const;
       
    82 	IMPORT_C TUid EventType() const;
       
    83 	IMPORT_C void SetEventType(TUid aId);
       
    84 	IMPORT_C void SetRequestOutcome(TLbsRequestOutcome aRequestOutcome);
       
    85 	IMPORT_C TLbsRequestOutcome RequestOutcome() const;
       
    86 	IMPORT_C TBool IsCostInformationAvailable() const;
       
    87 	IMPORT_C void SetCostInformation(TUint aCostInformation);
       
    88 	IMPORT_C TUint CostInformation() const;
       
    89 	IMPORT_C TPositionInfoBase* PositionInfo() const;
       
    90 	
       
    91 protected:
       
    92 	CLbsLogEvent();
       
    93 	void InternalizeL(const CLogEvent& aLogEvent);
       
    94 	TPositionInfo* CopyPosInfoToEvent(const TPositionInfoBase* aSrcosInfo);
       
    95 	void WritePosInfo(RWriteStream& aWriteStream, const TPositionInfo* aPosInfo) const;
       
    96 	void ReadPosInfo(RReadStream& aReadStream, TPositionInfo*& aPosInfo);
       
    97 	// for BC consideration, possible handling TAny* data member
       
    98 	// called by derived 3rd party classes
       
    99 	void BaseConstructL();
       
   100 	virtual void DoExternalizeL(RWriteStream& aReadStream) const = 0;
       
   101 	virtual void DoInternalizeL(RReadStream& aReadStream) = 0;
       
   102 	virtual void DoUpdateL(const CLbsLogEvent& aSourceLogEvent) = 0;
       
   103 	virtual void DoCopyL(CLbsLogEvent*& aTargetLogEvent) const = 0;
       
   104 	virtual TInt DataSize() const = 0;
       
   105 protected:
       
   106 	/** The size of the data from a TPositionInfo that is written to disk */
       
   107 	const TInt			iPosInfoWriteSize;
       
   108 	/** The Location Request Event Type */
       
   109 	TUid 				iEventType;
       
   110 	/** The returned location information if the request is completed successfully */
       
   111 	TPositionInfo*		iPosInfo;
       
   112 	/** Data for BC consideration, and inherited by derived CLbsLog classes */
       
   113 	TAny*				iReservedData;
       
   114 	
       
   115 private:
       
   116 	/**	MO-LR (True) to R_LOG_DIR_OUT and MT-LR to R_LOG_DIR_IN */
       
   117 	TBool				iDirection;
       
   118 	/** The outcome of the request */
       
   119 	TLbsRequestOutcome 	iRequestOutcome;
       
   120 	/** Flag which specifies if the cost information is available or not */
       
   121 	TBool 				iCostInformationAvailable;
       
   122 	/** The cost information */
       
   123 	TUint 				iCostInformation;
       
   124 	}; // class CLbsLogEvent
       
   125 	
       
   126 
       
   127 #endif // LBS_LOG_EVENT_H