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