serviceproviders/sapi_logging/loggingservice/inc/loggingfilter.h
changeset 5 989d2f495d90
child 26 5d0ec8b709be
equal deleted inserted replaced
1:a36b1e19a461 5:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Includes logging core class filter methods.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef LOGGINGFILTER_H
       
    19 #define LOGGINGFILTER_H
       
    20 
       
    21 #include <cntdef.h>
       
    22 
       
    23 /**
       
    24 * Forward Declarations
       
    25 */
       
    26 
       
    27 class CLogFilter ;
       
    28 class CLogsEvent ;
       
    29 
       
    30 /**
       
    31 * CLogsFilter:this is a wrapper class for the symbian CLogFilter class.
       
    32 */
       
    33 
       
    34 class CLogsFilter : public CBase
       
    35     {
       
    36     public :
       
    37 
       
    38         /**
       
    39         * NewL and NewLC method to construct the sapiFilter
       
    40         */
       
    41 
       
    42         IMPORT_C static CLogsFilter* NewL() ;
       
    43 
       
    44         static CLogsFilter* NewLC() ;
       
    45 
       
    46         /**
       
    47         * Gets the associated filter
       
    48         */
       
    49 
       
    50         inline CLogFilter* getFilter()
       
    51             {
       
    52             return iLogFilter ;
       
    53             }
       
    54 
       
    55         /**
       
    56         * Sets the filter
       
    57         */
       
    58 
       
    59         inline void setFilter(CLogFilter& aLogFilter)
       
    60             {
       
    61             aLogFilter.Copy(*iLogFilter);
       
    62             }
       
    63 
       
    64         /**
       
    65         * Copy function, does a deep copy of SapiFilter
       
    66         */
       
    67 
       
    68         inline void Copy(CLogsFilter& aLogFilter)
       
    69             {
       
    70             (aLogFilter.getFilter())->Copy(*iLogFilter) ;
       
    71             }
       
    72 
       
    73         /**
       
    74         * Clears the flags to be used by filter
       
    75         */
       
    76 
       
    77         inline void ClearFlags(TLogFlags aFlags)
       
    78             {
       
    79             iLogFilter->ClearFlags(aFlags) ;
       
    80             }
       
    81 
       
    82         /**
       
    83         * Returns Null Fields in the filter
       
    84         */
       
    85 
       
    86         inline TUint32 NullFields()
       
    87             {
       
    88             return iLogFilter->NullFields() ;
       
    89             }
       
    90 
       
    91         /**
       
    92         * Sets the Null Fields in the filter
       
    93         * These are the fields that the filter expects to be NULL in the database.
       
    94         *
       
    95         */
       
    96 
       
    97         inline void SetNullFields(TUint32 aNullFields)
       
    98             {
       
    99             iLogFilter->SetNullFields(aNullFields) ;
       
   100             }
       
   101 
       
   102         /**
       
   103         * Gets the event type used by this filter
       
   104         */
       
   105         inline TUid EventType()
       
   106             {
       
   107             return iLogFilter->EventType() ;
       
   108             }
       
   109 
       
   110         /**
       
   111         * Sets the event type to be used by this filter
       
   112         *
       
   113         * @param aEventType, event type to be set
       
   114         */
       
   115 
       
   116         inline void SetEventType(TUid aEventType)
       
   117             {
       
   118             iLogFilter->SetEventType(aEventType) ;
       
   119             }
       
   120 
       
   121         /**
       
   122         * Gets the Remot party used by the filter
       
   123         */
       
   124 
       
   125         inline const TDesC& RemoteParty()
       
   126             {
       
   127             return iLogFilter->RemoteParty() ;
       
   128             }
       
   129 
       
   130         /**
       
   131         * Sets the remot party used by this filter
       
   132         *
       
   133         * @param TDesC aRemotParty, Remot party description
       
   134         */
       
   135 
       
   136         inline void SetRemoteParty(const TDesC &aRemoteParty)
       
   137             {
       
   138             iLogFilter->SetRemoteParty(aRemoteParty) ;
       
   139             }
       
   140 
       
   141         /**
       
   142         * Direction, Get the direction of this filter
       
   143         * INCOMING , OUTGOING
       
   144         */
       
   145 
       
   146         inline const TDesC& Direction()
       
   147             {
       
   148             return iLogFilter->Direction() ;
       
   149             }
       
   150 
       
   151         /**
       
   152         * Sets the direction of the filter
       
   153         *
       
   154         * @param aDirection , direction of the filter
       
   155         */
       
   156 
       
   157         IMPORT_C void SetDirection(TInt aDirection) ;
       
   158 
       
   159         /**
       
   160         * DurationType Gets the log duration used by the filter
       
   161         */
       
   162 
       
   163         inline TLogDurationType DurationType()
       
   164             {
       
   165             return iLogFilter->DurationType() ;
       
   166             }
       
   167 
       
   168         /**
       
   169         * SetDurationType, sets the duration type used by this filter
       
   170         *
       
   171         * @param aDurationType, duration type to be set
       
   172         */
       
   173 
       
   174         inline void SetDurationType(TLogDurationType aDurationType)
       
   175             {
       
   176             iLogFilter->SetDurationType(aDurationType) ;
       
   177             }
       
   178 
       
   179         /**
       
   180         * Status, gets the Delivery status used by this filter
       
   181         */
       
   182 
       
   183         inline const TDesC &Status()
       
   184             {
       
   185             return iLogFilter->Status() ;
       
   186             }
       
   187 
       
   188         /**
       
   189         * SetStatus, sets the Delivery status used by this filter
       
   190         *
       
   191         * @param aStatus, status to be set for this filter
       
   192         */
       
   193 
       
   194         IMPORT_C void SetStatus(TInt aStatus) ;
       
   195 
       
   196 
       
   197         /**
       
   198         * SetRequestType, set the request type (GetEvent or GetList)
       
   199         *
       
   200         * @param aTaskId, Task Id for this filter
       
   201         */
       
   202 
       
   203         inline void SetRequestType(TInt aTaskId)
       
   204             {
       
   205             iTaskId = aTaskId ;
       
   206             }
       
   207 
       
   208         /**
       
   209         * GetRequestType, gets the request type of
       
   210         */
       
   211 
       
   212         inline TInt GetRequestType(void)
       
   213             {
       
   214             return iTaskId ;
       
   215             }
       
   216 
       
   217         /**
       
   218         * GetEvent, gets the request type of
       
   219         */
       
   220 
       
   221         inline CLogsEvent* GetEvent(void)
       
   222             {
       
   223             return iEvent  ;
       
   224             }
       
   225 
       
   226         /**
       
   227         * SetEvent, Sets the event for the filer
       
   228         *
       
   229         * @param aEvent , event to be set
       
   230         */
       
   231 
       
   232         IMPORT_C void SetEventL(CLogsEvent *aEvent) ;
       
   233 
       
   234 
       
   235         /**
       
   236         * GetRecentList , gets the recent list
       
   237         */
       
   238 
       
   239         inline TLogRecentList GetRecentList(void)
       
   240             {
       
   241             return iRecentList;
       
   242             }
       
   243 
       
   244         /**
       
   245         * SetRecentList, sets the recent List for recent view
       
   246         *
       
   247         * @param aRecentList, recent list to be set for recent view
       
   248         */
       
   249 
       
   250         inline void SetRecentList(TLogRecentList aRecentList)
       
   251             {
       
   252             iRecentList = aRecentList;
       
   253             }
       
   254 
       
   255         /**
       
   256         * SetNumber, sets the number view filter
       
   257         *
       
   258         * @param aNumber, number to be set
       
   259         */
       
   260 
       
   261         inline void SetNumber (const TDesC& aNumber)
       
   262             {
       
   263             iLogFilter->SetNumber(aNumber) ;
       
   264             }
       
   265 
       
   266         /**
       
   267         * get the number used by the filter
       
   268         */
       
   269 
       
   270         inline const TDesC& Number()
       
   271             {
       
   272             return iLogFilter->Number() ;
       
   273             }
       
   274 
       
   275         /**
       
   276         * Set EndTime for the event filter
       
   277         *
       
   278         * @param aEndTime, EndTime to be set
       
   279         */
       
   280 
       
   281         inline void SetEndTime(const TTime& aEndTime)
       
   282             {
       
   283             iLogFilter->SetEndTime(aEndTime) ;
       
   284             }
       
   285 
       
   286         /**
       
   287         *  get function
       
   288         */
       
   289 
       
   290         TTime getTime() const
       
   291             {
       
   292             return iLogFilter->EndTime();
       
   293             }
       
   294 
       
   295         /**
       
   296         * Set the contact id
       
   297         *
       
   298         * @param aContactId , contact id to  be set
       
   299         */
       
   300 
       
   301         inline void SetContact(TContactItemId aId)
       
   302             {
       
   303             iLogFilter->SetContact(aId) ;
       
   304             }
       
   305 
       
   306         /**
       
   307         * get the contact id
       
   308         */
       
   309 
       
   310         TContactItemId getContact() const
       
   311             {
       
   312             return iLogFilter->Contact();
       
   313             }
       
   314 
       
   315         /**
       
   316         * Gets the flag associated with the event
       
   317         */
       
   318 
       
   319         inline TLogFlags Flags()
       
   320             {
       
   321             return iLogFilter->Flags() ;
       
   322             }
       
   323 
       
   324         /**
       
   325         * Gets the flags associated with the event
       
   326         * @param aFlags , flags to be set
       
   327         */
       
   328 
       
   329         inline void SetFlags(TLogFlags aFlags)
       
   330             {
       
   331             iLogFilter->SetFlags(aFlags) ;
       
   332             }
       
   333 
       
   334         /**
       
   335         * Default Destructor
       
   336         */
       
   337 
       
   338         ~CLogsFilter() ;
       
   339 
       
   340 
       
   341     protected :
       
   342 
       
   343         /**
       
   344         * Default consturctor
       
   345         */
       
   346 
       
   347         CLogsFilter() ;
       
   348 
       
   349         /**
       
   350         * ConstructL: Function to consturct members of Filter class
       
   351         */
       
   352 
       
   353         void ConstructL() ;
       
   354 
       
   355     private :
       
   356 
       
   357         CLogFilter *iLogFilter ;
       
   358         //  CLogViewRecent *iRecentList ;
       
   359         TLogRecentList iRecentList;
       
   360         CLogsEvent*    iEvent ;
       
   361         /**
       
   362         * To fetch direction strings and status strings
       
   363         */
       
   364         CLogClient*     iLogClient ;
       
   365         RFs        iFs ;
       
   366         TInt iTaskId  ;
       
   367 
       
   368     } ;
       
   369 
       
   370 #endif