logsui/EngineInc/CLogsEventData.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005 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 "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: 
       
    15 *     Contents of Log database's additional Data field
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __Logs_Engine_CLogsEventData_H__
       
    21 #define __Logs_Engine_CLogsEventData_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MLogsEventData.h"
       
    26 
       
    27 
       
    28 // FORWARD DECLARATION
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 class CLogsEventData :  public CBase, 
       
    33                         public MLogsEventData
       
    34     {
       
    35 
       
    36     public:  
       
    37 
       
    38        /**
       
    39         * Two-phased constructor.
       
    40         *
       
    41         * @param aData LogEvent's additional free format field
       
    42         * @param aReadMessageParts In case this object needs only to be initialised but 
       
    43         *                         no  need to read actual (e.g. in case data contains packege
       
    44         *                         buffer in some other format )
       
    45         * @return CLogsEvent object
       
    46         */
       
    47         static CLogsEventData* NewL( const TDesC8 &aData, TBool aReadMessageParts );
       
    48 
       
    49        /**
       
    50         * Destructor.
       
    51         */
       
    52         virtual ~CLogsEventData();
       
    53 
       
    54 
       
    55     public:  
       
    56        /**
       
    57         *   ALS flag (Alternate line service).
       
    58         *
       
    59         *   @return  ALS status flag. EFalse if not ALS event, ETrue if ALS event.
       
    60         */
       
    61         TBool ALS() const;
       
    62 
       
    63         /**
       
    64         *   CNAP flag (Calling name presentation service).
       
    65         *
       
    66         *   @return  CNAP status flag. EFalse if not CNAP event, ETrue if CNAP event.
       
    67         */
       
    68         TBool CNAP() const;
       
    69 
       
    70         /**
       
    71         *   VT flag (Video Telephony).
       
    72         *
       
    73         *   @return  VT status flag. EFalse if not VT event, ETrue if VT event.
       
    74         */
       
    75         TBool VT() const;
       
    76 
       
    77         /**
       
    78         *   PoC flag.
       
    79         *
       
    80         *   @return  PoC status flag. EFalse if not PoC event, ETrue if PoC event.
       
    81         */
       
    82         TBool PoC() const;
       
    83 
       
    84         /**
       
    85         *   VoIP flag.
       
    86         *
       
    87         *   @return  VoIP status flag. EFalse if not VoIP event, ETrue if VoIP event.
       
    88         */
       
    89         TBool VoIP() const;
       
    90 
       
    91         /**
       
    92         *   Data Recived counter. 
       
    93         *
       
    94         *   @return  Data received (where applicable).
       
    95         */
       
    96         TInt64 DataReceived() const;
       
    97 
       
    98         /**
       
    99         *   URL. 
       
   100         *
       
   101         *   @return  URL (where applicable).
       
   102         */
       
   103         TDesC8& Url() const;
       
   104 
       
   105         /**
       
   106         *   Profile information (normally used for VoIP profile)
       
   107         *
       
   108         *   @return  Profile data (where applicable).
       
   109         */
       
   110         TDesC8& Profile() const;
       
   111 
       
   112         /**
       
   113         *   Additional reference, the Logging application can use to mediate, e.g. reference to PoC call group
       
   114         *
       
   115         *   @return  Additional reference data (where applicable).
       
   116         */
       
   117         TDesC8& Id() const;
       
   118 
       
   119         /**
       
   120         *   Data Sent counter. 
       
   121         *
       
   122         *   @return  Data sent (where applicable).
       
   123         */
       
   124         TInt64 DataSent() const;
       
   125         
       
   126         /**
       
   127         *   Data's type
       
   128         *
       
   129         *   @return  Data's type (where applicable).
       
   130         */
       
   131         TInt Type() const;
       
   132 
       
   133         /**
       
   134         *   My address
       
   135         *
       
   136         *   @return  User's own address (My address  where applicable).
       
   137         */
       
   138         TDesC8& MyAddress();        
       
   139 
       
   140         /**
       
   141         *   Emergency flag.
       
   142         *
       
   143         *   @return  Emergency call flag. EFalse if not emerg call, ETrue if emerg call.
       
   144         */
       
   145         TBool Emerg() const;
       
   146 
       
   147         /**
       
   148         *   Parts in sms.
       
   149         *
       
   150         *   @return  Parts in sms, this info is meaningful only for sms events
       
   151         */
       
   152         TInt MsgPartsNumber() const;
       
   153         
       
   154 // Sawfish VoIP changes  >>>>
       
   155         /**
       
   156         *   Service ID of this event.
       
   157         *
       
   158         *   @return  Service ID. 
       
   159         */
       
   160         TUint32 ServiceId() const;
       
   161         
       
   162         /**
       
   163         *   ContactLink of this event.
       
   164         *
       
   165         *   @param aContactLink after return contains contactlink 
       
   166         *
       
   167         *   @return  KErrNone if link was found otherwise KErrNotFound 
       
   168         */
       
   169         TInt GetContactLink( TPtrC8& aContactLink );
       
   170         
       
   171         /**
       
   172         *   Returns the unparsed data of the data field.
       
   173         *
       
   174         *   @return  Data field.
       
   175         */
       
   176         TDesC8& DataField() const;      
       
   177 // <<<<  Sawfish VoIP changes  
       
   178 
       
   179     private:
       
   180 
       
   181        /**
       
   182         * C++ default constructor.
       
   183         */
       
   184         CLogsEventData();
       
   185 
       
   186 
       
   187         CLogsEventData( const TDesC8 &aData );  
       
   188 
       
   189         /**
       
   190         * By default Symbian OS constructor is private.
       
   191         */
       
   192         void ConstructL( TBool aReadMessageParts );
       
   193 
       
   194         TBool CheckNonTaggedData(TPtrC8 aDataPtr );
       
   195         void CheckTaggedDataL();        
       
   196         void SetMsgPartsNumber();
       
   197               
       
   198     private:    // data
       
   199 
       
   200         //Temporary Pointer to Log database datafield reference (TPtrC8 to TDesC8 &)
       
   201         //NOTE! It is NOT guaranteed that the TDesC8& (and hence iDataFieldPtr we're using to point if) 
       
   202         //is alive longer than during the call the ConstructL.
       
   203         TPtrC8 iTempDataFieldPtr; 
       
   204    
       
   205         //contains the raw datafield data, this is stored in order to make
       
   206         //it possible for extensions to extract that information that they 
       
   207         //need. e.g. there might be identifiers used in the data field that
       
   208         //the parser in CLogsEventData::CheckTaggedDataL() might not under-
       
   209         //stand and then the extension could extact the information directly
       
   210         //from the datafield (by using its own parser).
       
   211         HBufC8* iDataField;
       
   212         
       
   213         // Alternate Line flag
       
   214         TBool iALS;
       
   215 
       
   216         // Calling Name Presentation service flag
       
   217         TBool iCNAP;
       
   218 
       
   219         // Video Telephone flag
       
   220         TBool iVT;
       
   221 
       
   222         // PoC flag
       
   223         TBool iPoC;
       
   224 
       
   225         // VoIP flag
       
   226         TBool iVoIP;
       
   227 
       
   228         //URL
       
   229         HBufC8* iURL8;
       
   230 
       
   231         //
       
   232         HBufC8* iProfile;
       
   233 
       
   234         //Internal ID (can be used to mediate additional Logging application's data)
       
   235         HBufC8* iId;
       
   236 
       
   237         //Flag that indicates whether this is an emegegency related event (i.e emerg call)
       
   238         TBool iEmerg;
       
   239 
       
   240         //Sent and received data where applicable (in bytes)
       
   241         TInt64 iDataSent;
       
   242         TInt64 iDataReceived;
       
   243 
       
   244         //Datatype
       
   245         TInt iDataType;
       
   246         
       
   247         //My address fields
       
   248         HBufC8* iMyAddress8;
       
   249         HBufC*  iMyAddress;        
       
   250     
       
   251         //Message parts. Meaningful only for sms            
       
   252         TInt iMsgPartsNumber;            
       
   253 
       
   254 // Sawfish VoIP changes ---------
       
   255         // ServiceID
       
   256         TUint32 iServiceId;
       
   257         
       
   258         /*
       
   259         * ContactLink
       
   260         * Own.
       
   261         */
       
   262         HBufC8* iContactLink;    
       
   263 // ------------------------------  
       
   264     };
       
   265 
       
   266 #endif      // __Logs_Engine_CLogsEventData_H__
       
   267 
       
   268 
       
   269 
       
   270 // End of File