serviceproviders/sapi_logging/tsrc/dev/tloggingservice/inc/loggingevent.h
changeset 19 989d2f495d90
child 33 50974a8b132e
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 wrapper over Clogevent.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SAPIEVENT_H
       
    20 #define SAPIEVENT_H
       
    21 
       
    22 #include <logwrap.h>
       
    23 #include <CNTDEF.H>
       
    24 
       
    25 /**
       
    26 * CLogsEvent:this is a wrapper class for the symbian CLogEvent class.
       
    27 */
       
    28 
       
    29 class CLogsEvent : public CBase
       
    30     {
       
    31     public :
       
    32 
       
    33         /**
       
    34         * NewL: Two phased construction
       
    35         */
       
    36 
       
    37         IMPORT_C static CLogsEvent *NewL() ;
       
    38 
       
    39         /**
       
    40         * NewLC: Creates an instance of CLogSyncServiceClass
       
    41         * Two Phased constructor
       
    42         * returns newly allocated object.
       
    43         */
       
    44 
       
    45         static CLogsEvent* NewLC() ;
       
    46 
       
    47         /**
       
    48         * Default Destructor
       
    49         */
       
    50 
       
    51         ~CLogsEvent() ;
       
    52 
       
    53         /**
       
    54         * Sets unique id to identify event type.
       
    55         */
       
    56 
       
    57         inline  void SetEventType(TUid aEventTypeId)
       
    58             {
       
    59             iLogEvent->SetEventType(aEventTypeId);
       
    60             }
       
    61 
       
    62         /**
       
    63         * Sets the duration of the event.
       
    64         */
       
    65 
       
    66         inline void SetDuration(TLogDuration aDuration)
       
    67             {
       
    68             iLogEvent->SetDuration(aDuration);
       
    69             }
       
    70             
       
    71         /**
       
    72         * Sets the durationType of the event.
       
    73         */    
       
    74             
       
    75         inline void SetDurationType(TLogDurationType aDurationType)
       
    76             {
       
    77             iLogEvent->SetDurationType( aDurationType );
       
    78             }
       
    79     
       
    80         /**
       
    81         * Sets the subject of the event.
       
    82         */
       
    83 
       
    84         inline void SetSubject(const TDesC &aSubject)
       
    85             {
       
    86             iLogEvent->SetSubject(aSubject);
       
    87             }
       
    88 
       
    89         /**
       
    90         * Sets the time of the event.
       
    91         */
       
    92 
       
    93         inline void SetTime(const TTime &aTime)
       
    94             {
       
    95             iLogEvent->SetTime(aTime);
       
    96             }
       
    97 
       
    98         /**
       
    99         * Sets the number associated with the event..
       
   100         */
       
   101 
       
   102         inline void SetNumber(const TDesC &aNumber)
       
   103             {
       
   104             iLogEvent->SetNumber(aNumber);
       
   105             }
       
   106 
       
   107         /**
       
   108         * Sets the remote party associated with the event.
       
   109         */
       
   110 
       
   111         inline void SetRemoteParty(const TDesC &aRemote)
       
   112             {
       
   113             iLogEvent->SetRemoteParty(aRemote);
       
   114             }
       
   115 
       
   116         /**
       
   117         * Sets the Direction of the .event
       
   118         */
       
   119 
       
   120         IMPORT_C void SetDirection(TInt aDirection) ;
       
   121 
       
   122 
       
   123         /**
       
   124         * Sets the contact id.
       
   125         */
       
   126 
       
   127         inline void SetContact(TContactItemId aContact)
       
   128             {
       
   129             iLogEvent->SetContact(aContact);
       
   130             }
       
   131 
       
   132         /**
       
   133         * Sets description of event type
       
   134         */
       
   135 
       
   136         inline void SetDescription(const TDesC &aDescription)
       
   137             {
       
   138             iLogEvent->SetDescription(aDescription);
       
   139             }
       
   140 
       
   141         /**
       
   142         * Sets data of event type
       
   143         */
       
   144         inline void SetDataL(const TDesC8 &aData)
       
   145             {
       
   146             iLogEvent->SetDataL(aData);
       
   147             }
       
   148 
       
   149         /**
       
   150         * Sets link value
       
   151         */
       
   152 
       
   153         inline void SetLink(TLogLink aLink)
       
   154             {
       
   155             iLogEvent->SetLink(aLink);
       
   156             }
       
   157 
       
   158         /**
       
   159         *  Sets status of event
       
   160         */
       
   161 
       
   162         IMPORT_C void SetStatus(TInt aStatus) ;
       
   163 
       
   164 
       
   165         /**
       
   166         * Sets unique id to identify event type.
       
   167         *  @param aEvent, event details to be copied
       
   168         */
       
   169 
       
   170         inline void SetEvent(const CLogEvent& aEvent)
       
   171             {
       
   172             iLogEvent->CopyL(aEvent) ;
       
   173             }
       
   174 
       
   175         /**
       
   176         *  get logid
       
   177         */
       
   178 
       
   179         inline TLogId Id()
       
   180             {
       
   181             return iLogEvent->Id() ;
       
   182             }
       
   183 
       
   184         /**
       
   185         *  copy function
       
   186         */
       
   187 
       
   188         inline  void Copy(CLogEvent* aEvent)
       
   189             {
       
   190             iLogEvent->CopyL(*aEvent);
       
   191             }
       
   192 
       
   193         /**
       
   194         *  gets eventtype
       
   195         */
       
   196 
       
   197         TUid getEventType() const
       
   198             {
       
   199             return iLogEvent->EventType();
       
   200             }
       
   201 
       
   202         /**
       
   203         *  gets eventduration
       
   204         */
       
   205 
       
   206         TLogDuration getDuration() const
       
   207             {
       
   208             return iLogEvent->Duration();
       
   209             }
       
   210 
       
   211         /**
       
   212         *  gets subject
       
   213         */
       
   214 
       
   215         const TDesC& getSubject() const
       
   216             {
       
   217             return iLogEvent->Subject() ;
       
   218             }
       
   219 
       
   220         /**
       
   221         *  gets time
       
   222         */
       
   223 
       
   224         TTime getTime() const
       
   225             {
       
   226             return iLogEvent->Time();
       
   227             }
       
   228 
       
   229         /**
       
   230         *  gets number
       
   231         */
       
   232 
       
   233         const TDesC& getNumber() const
       
   234             {
       
   235             return iLogEvent->Number();
       
   236             }
       
   237 
       
   238         /**
       
   239         *  gets remoteparty
       
   240         */
       
   241 
       
   242         const TDesC& getRemoteParty() const
       
   243             {
       
   244             return iLogEvent->RemoteParty();
       
   245             }
       
   246 
       
   247         /**
       
   248         *  gets direction
       
   249         */
       
   250 
       
   251         const TDesC& getDirection() const
       
   252             {
       
   253             return iLogEvent->Direction();
       
   254             }
       
   255 
       
   256         /**
       
   257         *  gets contactid
       
   258         */
       
   259 
       
   260         TContactItemId getContact() const
       
   261             {
       
   262             return iLogEvent->Contact();
       
   263             }
       
   264 
       
   265         /**
       
   266         *  gets description
       
   267         */
       
   268 
       
   269         const TDesC& getDescription() const
       
   270             {
       
   271             return iLogEvent->Description();
       
   272             }
       
   273 
       
   274         /**
       
   275         *  gets data
       
   276         */
       
   277 
       
   278 
       
   279         const TDesC8& getDataL() const
       
   280             {
       
   281             return iLogEvent->Data();
       
   282             }
       
   283 
       
   284         /**
       
   285         *  gets linkvalue
       
   286         */
       
   287 
       
   288 
       
   289         TLogLink getLink() const
       
   290             {
       
   291             return iLogEvent->Link();
       
   292             }
       
   293 
       
   294         /**
       
   295         *  gets status
       
   296         */
       
   297 
       
   298         const TDesC& getStatus() const
       
   299             {
       
   300             return iLogEvent->Status();
       
   301             }
       
   302 
       
   303         /**
       
   304         * getEvents: Gets the event .
       
   305         */
       
   306 
       
   307         inline CLogEvent* getEvent()
       
   308             {
       
   309             return iLogEvent ;
       
   310             }
       
   311 
       
   312         /**
       
   313         *  setid function
       
   314         */
       
   315 
       
   316         inline void SetId(TLogId aId)
       
   317             {
       
   318             iLogEvent->SetId(aId);
       
   319             }
       
   320 
       
   321         /**
       
   322         * Gets the flag associated with the event
       
   323         */
       
   324 
       
   325         inline TLogFlags Flags()
       
   326             {
       
   327             return iLogEvent->Flags() ;
       
   328             }
       
   329 
       
   330         /**
       
   331         * Gets the flags associated with the event
       
   332         * @param aFlags , flags to be set
       
   333         */
       
   334 
       
   335         inline void SetFlags(TLogFlags aFlags)
       
   336             {
       
   337             iLogEvent->SetFlags(aFlags) ;
       
   338             }
       
   339 
       
   340     protected:
       
   341 
       
   342         /**
       
   343         * ConstructL(): Internal method to construct members
       
   344         */
       
   345 
       
   346         void ConstructL() ;
       
   347 
       
   348         /**
       
   349         * Default constructor
       
   350         */
       
   351 
       
   352         CLogsEvent() ;
       
   353 
       
   354     private:
       
   355 
       
   356         /**
       
   357         *  contains the details of an event
       
   358         */
       
   359 
       
   360         CLogEvent* iLogEvent;
       
   361 
       
   362         /**
       
   363         * Required for the Setting Direction and the status for
       
   364         * the event
       
   365         */
       
   366 
       
   367         RFs iFs ;
       
   368         CLogClient *iLogClient ;
       
   369 
       
   370     };
       
   371 
       
   372 
       
   373 #endif