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