loggingservices/eventlogger/LogCli/inc/LOGCLI.INL
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // CLogEventType
       
    15 // 
       
    16 //
       
    17 
       
    18 /** Gets the UID identifying the event type.
       
    19 
       
    20 @return The UID. */
       
    21 inline TUid CLogEventType::Uid() const
       
    22 	{
       
    23 	return iUid;
       
    24 	}
       
    25 
       
    26 /** Sets the UID identifying the event type.
       
    27 
       
    28 @param aUid The Uid. */
       
    29 inline void CLogEventType::SetUid(TUid aUid)
       
    30 	{
       
    31 	iUid = aUid;
       
    32 	}
       
    33 
       
    34 /** Gets the human readable and localised name of the event type.
       
    35 
       
    36 @return A non-modifiable descriptor containing the name. */
       
    37 inline const TDesC& CLogEventType::Description() const
       
    38 	{
       
    39 	return *iDescription;
       
    40 	}
       
    41 
       
    42 /** Sets the human readable and localised name of the event type.
       
    43 
       
    44 For example, Email.
       
    45 
       
    46 @param aDescription The name. */
       
    47 inline void CLogEventType::SetDescription(const TDesC& aDescription)
       
    48 	{
       
    49 	iDescription->Des().Copy(aDescription);
       
    50 	}
       
    51 
       
    52 /** Determines whether logging for this event type is enabled.
       
    53 
       
    54 @return ETrue, if logging is enabled. EFalse, if logging is disabled. */
       
    55 inline TBool CLogEventType::LoggingEnabled() const
       
    56 	{
       
    57 	return iLoggingEnabled;
       
    58 	}
       
    59 
       
    60 /** Enables or disables logging for this event type.
       
    61 
       
    62 Note that disabling the logging of an event type causes a CLogClient::AddEventL() 
       
    63 request for an event of that type to complete with an appropriate error.
       
    64 
       
    65 @param aEnable ETrue, to enable logging for this event type.EFalse, to disable 
       
    66 logging for this event type.
       
    67 @see CLogClient::AddEvent() */
       
    68 inline void CLogEventType::SetLoggingEnabled(TBool aEnable)
       
    69 	{
       
    70 	iLoggingEnabled = aEnable;
       
    71 	}
       
    72 
       
    73 //**********************************
       
    74 // CLogFilter
       
    75 //**********************************
       
    76 
       
    77 /** Gets the event type used by the filter.
       
    78 
       
    79 @return The event type UID.
       
    80 @see CLogEvent::EventType() */
       
    81 inline TUid CLogFilter::EventType() const
       
    82 	{
       
    83 	return iEventType;
       
    84 	}
       
    85 
       
    86 /** Sets the event type to be used by the filter.
       
    87 
       
    88 @param aType The event type UID.
       
    89 @see CLogEvent::SetEventType() */
       
    90 inline void CLogFilter::SetEventType(TUid aType)
       
    91 	{
       
    92 	iEventType = aType;
       
    93 	}
       
    94 
       
    95 /** Gets the remote party string used by the filter.
       
    96 
       
    97 @return A non-modifiable descriptor containing the remote party string.
       
    98 @see CLogEvent::RemoteParty() */
       
    99 inline const TDesC& CLogFilter::RemoteParty() const
       
   100 	{
       
   101 	return *iRemoteParty;
       
   102 	}
       
   103 
       
   104 /** Sets the remote party string to be used by the filter.
       
   105 
       
   106 @param aRemote The remote party string.
       
   107 @see CLogEvent::SetRemoteParty() */
       
   108 inline void CLogFilter::SetRemoteParty(const TDesC& aRemote)
       
   109 	{
       
   110 	iRemoteParty->Des().Copy(aRemote);
       
   111 	}
       
   112 
       
   113 /** Gets the direction string used by the filter.
       
   114 
       
   115 @return A non-modifiable descriptor containing the direction string.
       
   116 @see CLogEvent::Direction() */
       
   117 inline const TDesC& CLogFilter::Direction() const
       
   118 	{
       
   119 	return *iDirection;
       
   120 	}
       
   121 
       
   122 /** Sets the direction string to be used by the filter.
       
   123 
       
   124 @param aDirection The direction string.
       
   125 @see CLogEvent::SetDirection() */
       
   126 inline void CLogFilter::SetDirection(const TDesC& aDirection)
       
   127 	{
       
   128 	iDirection->Des().Copy(aDirection);
       
   129 	}
       
   130 
       
   131 /** Gets the duration type used by the filter.
       
   132 
       
   133 @return The duration type.
       
   134 @see CLogEvent::DurationType() */
       
   135 inline TLogDurationType CLogFilter::DurationType() const
       
   136 	{
       
   137 	return iDurationType;
       
   138 	}
       
   139 
       
   140 /** Sets the duration type to be used by the filter.
       
   141 
       
   142 @param aType The duration type.
       
   143 @see CLogEvent::SetDurationType() */
       
   144 inline void CLogFilter::SetDurationType(TLogDurationType aType)
       
   145 	{
       
   146 	iDurationType = aType;
       
   147 	}
       
   148 
       
   149 /** Gets the delivery status used by the filter.
       
   150 
       
   151 @return A non-modifiable descriptor containing the delivery status.
       
   152 @see CLogEvent::Status() */
       
   153 inline const TDesC& CLogFilter::Status() const
       
   154 	{
       
   155 	return *iStatus;
       
   156 	}
       
   157 
       
   158 /** Sets the delivery status to be used by the filter.
       
   159 
       
   160 @param aStatus The delivery status.
       
   161 @see CLogEvent::SetStatus() */
       
   162 inline void CLogFilter::SetStatus(const TDesC& aStatus)
       
   163 	{
       
   164 	iStatus->Des().Copy(aStatus);
       
   165 	}
       
   166 
       
   167 /** Gets the contact ID used by the filter.
       
   168 
       
   169 @return The contact ID.
       
   170 @see CLogEvent::Contact() */
       
   171 inline TLogContactItemId  CLogFilter::Contact() const
       
   172 	{
       
   173 	return iContact;
       
   174 	}
       
   175 
       
   176 /** Sets the contact ID to be used by the filter.
       
   177 
       
   178 @param aContact The contact ID.
       
   179 @see CLogEvent::SetContact() */
       
   180 inline void CLogFilter::SetContact(TLogContactItemId  aContact)
       
   181 	{
       
   182 	iContact = aContact;
       
   183 	}
       
   184 
       
   185 /** Gets the phone number used by the filter.
       
   186 
       
   187 @return A non-modifiable descriptor containing the phone number.
       
   188 @see CLogEvent::Number() */
       
   189 inline const TDesC& CLogFilter::Number() const
       
   190 	{
       
   191 	return *iNumber;
       
   192 	}
       
   193 
       
   194 /** Sets the phone number to be used by the filter.
       
   195 
       
   196 @param aNumber The phone number.
       
   197 @see CLogEvent::SetNumber() */
       
   198 inline void CLogFilter::SetNumber(const TDesC& aNumber)
       
   199 	{
       
   200 	iNumber->Des().Copy(aNumber);
       
   201 	}
       
   202 
       
   203 /** Identifies the fields defined as NULL in the filter. These are the fields that 
       
   204 the filter expects to be NULL in the database. A NULL field is one that has 
       
   205 no value.
       
   206 
       
   207 @return Bit values defining the null fields.
       
   208 @see SetNullFields() */
       
   209 inline TUint32 CLogFilter::NullFields() const
       
   210 	{
       
   211 	return iNullFields;
       
   212 	}
       
   213 
       
   214 /** Defines NULL fields to the filter. These are the fields that the filter expects 
       
   215 to be NULL in the database. A NULL field is one that has no value.
       
   216 
       
   217 Each field is identified by a bit value. The bit values may be ORd together 
       
   218 in any combination.
       
   219  
       
   220 Note that setting a flag and explicitly setting a value for the corresponding 
       
   221 field generates an OR condition in the SQL WHERE clause.
       
   222 
       
   223 @param aFields Bit values defining the null fields. These are one or more 
       
   224 of the following values defined in logwrap.hrh: ELogContactField, ELogDirectionField, 
       
   225 ELogDurationTypeField, ELogEventTypeField, ELogNumberField, ELogRemotePartyField, 
       
   226 ELogStatusField, ELogFlagsField, ELogSubjectField, ELogLinkField, ELogDataField, ELogSimIdField. */
       
   227 inline void CLogFilter::SetNullFields(TUint32 aFields)
       
   228 	{
       
   229 	iNullFields = aFields;
       
   230 	}
       
   231 
       
   232 /** Gets the UTC start time used by the filter.
       
   233 
       
   234 @return The UTC start time. */
       
   235 inline const TTime& CLogFilter::StartTime() const
       
   236 	{
       
   237 	return iStartTime;
       
   238 	}
       
   239 
       
   240 /** Sets the specified UTC start time to be used by the filter.
       
   241 
       
   242 @param aStartTime The UTC start time to be set. */
       
   243 inline void CLogFilter::SetStartTime(const TTime& aStartTime)
       
   244 	{
       
   245 	iStartTime = aStartTime; 
       
   246 	}
       
   247 	
       
   248 /** Gets the UTC end time used by the filter.
       
   249 
       
   250 @return The UTC end time. */
       
   251 inline const TTime& CLogFilter::EndTime() const
       
   252 	{
       
   253 	return iEndTime;
       
   254 	}
       
   255 
       
   256 /** Sets the specified UTC end time to be used by the filter.
       
   257 
       
   258 @param aEndTime The UTC end time to be set. */
       
   259 inline void CLogFilter::SetEndTime(const TTime& aEndTime)
       
   260 	{
       
   261 	iEndTime = aEndTime;
       
   262 	}
       
   263 
       
   264 /** Gets the flags used by the filter.
       
   265 
       
   266 @return The flags. */
       
   267 inline TLogFlags CLogFilter::Flags() const
       
   268 	{
       
   269 	return iFlags;
       
   270 	}
       
   271 
       
   272 /** Sets the specified flags to be used by the filter.
       
   273 
       
   274 @param aFlags The flags to be set. */
       
   275 inline void CLogFilter::SetFlags(TLogFlags aFlags)
       
   276 	{
       
   277 	__ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
       
   278 	iFlags = (TLogFlags)(iFlags | aFlags);
       
   279 	}
       
   280 
       
   281 /** Clears the specified flags to be used by the filter. 
       
   282 
       
   283 The constant KLogFlagsMask can be used to clear all the flags.
       
   284 
       
   285 @param aFlags The flags to be cleared */
       
   286 inline void CLogFilter::ClearFlags(TLogFlags aFlags)
       
   287 	{
       
   288 	__ASSERT_DEBUG(aFlags <= KLogFlagsMask, User::Invariant());
       
   289 	iFlags = (TLogFlags)(iFlags & ~aFlags);
       
   290 	}