sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: // CLogEventType
sl@0: // 
sl@0: //
sl@0: 
sl@0: /** Gets the UID identifying the event type.
sl@0: 
sl@0: @return The UID. */
sl@0: inline TUid CLogEventType::Uid() const
sl@0: 	{
sl@0: 	return iUid;
sl@0: 	}
sl@0: 
sl@0: /** Sets the UID identifying the event type.
sl@0: 
sl@0: @param aUid The Uid. */
sl@0: inline void CLogEventType::SetUid(TUid aUid)
sl@0: 	{
sl@0: 	iUid = aUid;
sl@0: 	}
sl@0: 
sl@0: /** Gets the human readable and localised name of the event type.
sl@0: 
sl@0: @return A non-modifiable descriptor containing the name. */
sl@0: inline const TDesC& CLogEventType::Description() const
sl@0: 	{
sl@0: 	return *iDescription;
sl@0: 	}
sl@0: 
sl@0: /** Sets the human readable and localised name of the event type.
sl@0: 
sl@0: For example, Email.
sl@0: 
sl@0: @param aDescription The name. */
sl@0: inline void CLogEventType::SetDescription(const TDesC& aDescription)
sl@0: 	{
sl@0: 	iDescription->Des().Copy(aDescription);
sl@0: 	}
sl@0: 
sl@0: /** Determines whether logging for this event type is enabled.
sl@0: 
sl@0: @return ETrue, if logging is enabled. EFalse, if logging is disabled. */
sl@0: inline TBool CLogEventType::LoggingEnabled() const
sl@0: 	{
sl@0: 	return iLoggingEnabled;
sl@0: 	}
sl@0: 
sl@0: /** Enables or disables logging for this event type.
sl@0: 
sl@0: Note that disabling the logging of an event type causes a CLogClient::AddEventL() 
sl@0: request for an event of that type to complete with an appropriate error.
sl@0: 
sl@0: @param aEnable ETrue, to enable logging for this event type.EFalse, to disable 
sl@0: logging for this event type.
sl@0: @see CLogClient::AddEvent() */
sl@0: inline void CLogEventType::SetLoggingEnabled(TBool aEnable)
sl@0: 	{
sl@0: 	iLoggingEnabled = aEnable;
sl@0: 	}
sl@0: 
sl@0: //**********************************
sl@0: // CLogFilter
sl@0: //**********************************
sl@0: 
sl@0: /** Gets the event type used by the filter.
sl@0: 
sl@0: @return The event type UID.
sl@0: @see CLogEvent::EventType() */
sl@0: inline TUid CLogFilter::EventType() const
sl@0: 	{
sl@0: 	return iEventType;
sl@0: 	}
sl@0: 
sl@0: /** Sets the event type to be used by the filter.
sl@0: 
sl@0: @param aType The event type UID.
sl@0: @see CLogEvent::SetEventType() */
sl@0: inline void CLogFilter::SetEventType(TUid aType)
sl@0: 	{
sl@0: 	iEventType = aType;
sl@0: 	}
sl@0: 
sl@0: /** Gets the remote party string used by the filter.
sl@0: 
sl@0: @return A non-modifiable descriptor containing the remote party string.
sl@0: @see CLogEvent::RemoteParty() */
sl@0: inline const TDesC& CLogFilter::RemoteParty() const
sl@0: 	{
sl@0: 	return *iRemoteParty;
sl@0: 	}
sl@0: 
sl@0: /** Sets the remote party string to be used by the filter.
sl@0: 
sl@0: @param aRemote The remote party string.
sl@0: @see CLogEvent::SetRemoteParty() */
sl@0: inline void CLogFilter::SetRemoteParty(const TDesC& aRemote)
sl@0: 	{
sl@0: 	iRemoteParty->Des().Copy(aRemote);
sl@0: 	}
sl@0: 
sl@0: /** Gets the direction string used by the filter.
sl@0: 
sl@0: @return A non-modifiable descriptor containing the direction string.
sl@0: @see CLogEvent::Direction() */
sl@0: inline const TDesC& CLogFilter::Direction() const
sl@0: 	{
sl@0: 	return *iDirection;
sl@0: 	}
sl@0: 
sl@0: /** Sets the direction string to be used by the filter.
sl@0: 
sl@0: @param aDirection The direction string.
sl@0: @see CLogEvent::SetDirection() */
sl@0: inline void CLogFilter::SetDirection(const TDesC& aDirection)
sl@0: 	{
sl@0: 	iDirection->Des().Copy(aDirection);
sl@0: 	}
sl@0: 
sl@0: /** Gets the duration type used by the filter.
sl@0: 
sl@0: @return The duration type.
sl@0: @see CLogEvent::DurationType() */
sl@0: inline TLogDurationType CLogFilter::DurationType() const
sl@0: 	{
sl@0: 	return iDurationType;
sl@0: 	}
sl@0: 
sl@0: /** Sets the duration type to be used by the filter.
sl@0: 
sl@0: @param aType The duration type.
sl@0: @see CLogEvent::SetDurationType() */
sl@0: inline void CLogFilter::SetDurationType(TLogDurationType aType)
sl@0: 	{
sl@0: 	iDurationType = aType;
sl@0: 	}
sl@0: 
sl@0: /** Gets the delivery status used by the filter.
sl@0: 
sl@0: @return A non-modifiable descriptor containing the delivery status.
sl@0: @see CLogEvent::Status() */
sl@0: inline const TDesC& CLogFilter::Status() const
sl@0: 	{
sl@0: 	return *iStatus;
sl@0: 	}
sl@0: 
sl@0: /** Sets the delivery status to be used by the filter.
sl@0: 
sl@0: @param aStatus The delivery status.
sl@0: @see CLogEvent::SetStatus() */
sl@0: inline void CLogFilter::SetStatus(const TDesC& aStatus)
sl@0: 	{
sl@0: 	iStatus->Des().Copy(aStatus);
sl@0: 	}
sl@0: 
sl@0: /** Gets the contact ID used by the filter.
sl@0: 
sl@0: @return The contact ID.
sl@0: @see CLogEvent::Contact() */
sl@0: inline TLogContactItemId  CLogFilter::Contact() const
sl@0: 	{
sl@0: 	return iContact;
sl@0: 	}
sl@0: 
sl@0: /** Sets the contact ID to be used by the filter.
sl@0: 
sl@0: @param aContact The contact ID.
sl@0: @see CLogEvent::SetContact() */
sl@0: inline void CLogFilter::SetContact(TLogContactItemId  aContact)
sl@0: 	{
sl@0: 	iContact = aContact;
sl@0: 	}
sl@0: 
sl@0: /** Gets the phone number used by the filter.
sl@0: 
sl@0: @return A non-modifiable descriptor containing the phone number.
sl@0: @see CLogEvent::Number() */
sl@0: inline const TDesC& CLogFilter::Number() const
sl@0: 	{
sl@0: 	return *iNumber;
sl@0: 	}
sl@0: 
sl@0: /** Sets the phone number to be used by the filter.
sl@0: 
sl@0: @param aNumber The phone number.
sl@0: @see CLogEvent::SetNumber() */
sl@0: inline void CLogFilter::SetNumber(const TDesC& aNumber)
sl@0: 	{
sl@0: 	iNumber->Des().Copy(aNumber);
sl@0: 	}
sl@0: 
sl@0: /** Identifies the fields defined as NULL in the filter. These are the fields that 
sl@0: the filter expects to be NULL in the database. A NULL field is one that has 
sl@0: no value.
sl@0: 
sl@0: @return Bit values defining the null fields.
sl@0: @see SetNullFields() */
sl@0: inline TUint32 CLogFilter::NullFields() const
sl@0: 	{
sl@0: 	return iNullFields;
sl@0: 	}
sl@0: 
sl@0: /** Defines NULL fields to the filter. These are the fields that the filter expects 
sl@0: to be NULL in the database. A NULL field is one that has no value.
sl@0: 
sl@0: Each field is identified by a bit value. The bit values may be ORd together 
sl@0: in any combination.
sl@0:  
sl@0: Note that setting a flag and explicitly setting a value for the corresponding 
sl@0: field generates an OR condition in the SQL WHERE clause.
sl@0: 
sl@0: @param aFields Bit values defining the null fields. These are one or more 
sl@0: of the following values defined in logwrap.hrh: ELogContactField, ELogDirectionField, 
sl@0: ELogDurationTypeField, ELogEventTypeField, ELogNumberField, ELogRemotePartyField, 
sl@0: ELogStatusField, ELogFlagsField, ELogSubjectField, ELogLinkField, ELogDataField, ELogSimIdField. */
sl@0: inline void CLogFilter::SetNullFields(TUint32 aFields)
sl@0: 	{
sl@0: 	iNullFields = aFields;
sl@0: 	}
sl@0: 
sl@0: /** Gets the UTC start time used by the filter.
sl@0: 
sl@0: @return The UTC start time. */
sl@0: inline const TTime& CLogFilter::StartTime() const
sl@0: 	{
sl@0: 	return iStartTime;
sl@0: 	}
sl@0: 
sl@0: /** Sets the specified UTC start time to be used by the filter.
sl@0: 
sl@0: @param aStartTime The UTC start time to be set. */
sl@0: inline void CLogFilter::SetStartTime(const TTime& aStartTime)
sl@0: 	{
sl@0: 	iStartTime = aStartTime; 
sl@0: 	}
sl@0: 	
sl@0: /** Gets the UTC end time used by the filter.
sl@0: 
sl@0: @return The UTC end time. */
sl@0: inline const TTime& CLogFilter::EndTime() const
sl@0: 	{
sl@0: 	return iEndTime;
sl@0: 	}
sl@0: 
sl@0: /** Sets the specified UTC end time to be used by the filter.
sl@0: 
sl@0: @param aEndTime The UTC end time to be set. */
sl@0: inline void CLogFilter::SetEndTime(const TTime& aEndTime)
sl@0: 	{
sl@0: 	iEndTime = aEndTime;
sl@0: 	}
sl@0: 
sl@0: /** Gets the flags used by the filter.
sl@0: 
sl@0: @return The flags. */
sl@0: inline TLogFlags CLogFilter::Flags() const
sl@0: 	{
sl@0: 	return iFlags;
sl@0: 	}
sl@0: 
sl@0: /** Sets the specified flags to be used by the filter.
sl@0: 
sl@0: @param aFlags The flags to be set. */
sl@0: inline void CLogFilter::SetFlags(TLogFlags aFlags)
sl@0: 	{
sl@0: 	__ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
sl@0: 	iFlags = (TLogFlags)(iFlags | aFlags);
sl@0: 	}
sl@0: 
sl@0: /** Clears the specified flags to be used by the filter. 
sl@0: 
sl@0: The constant KLogFlagsMask can be used to clear all the flags.
sl@0: 
sl@0: @param aFlags The flags to be cleared */
sl@0: inline void CLogFilter::ClearFlags(TLogFlags aFlags)
sl@0: 	{
sl@0: 	__ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
sl@0: 	iFlags = (TLogFlags)(iFlags & ~aFlags);
sl@0: 	}