logsui/EngineInc/CLogsEvent.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Implements MLogsEvent interface
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __Logs_Engine_CLogsEvent_H__
       
    21 #define __Logs_Engine_CLogsEvent_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MLogsEvent.h"
       
    26 
       
    27 // FORWARD DECLARATION
       
    28 class CPhCltEmergencyCall;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  *  Implements MLogsEvent interface
       
    34  */
       
    35 class CLogsEvent :  public CBase, 
       
    36                     public MLogsEvent
       
    37     {
       
    38 
       
    39     public:
       
    40 
       
    41        /**
       
    42         * Two-phased constructor.
       
    43         *
       
    44         * @return CLogsEvent object
       
    45         */
       
    46         static CLogsEvent* NewLC();
       
    47         
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         ~CLogsEvent();
       
    52 
       
    53     private:
       
    54     
       
    55        /**
       
    56         * C++ default constructor.
       
    57         */
       
    58         CLogsEvent();
       
    59               
       
    60 
       
    61     public: // from MLogsEvent
       
    62 
       
    63        /**
       
    64         * Has the event been read already
       
    65         *
       
    66         * @return true/false
       
    67         */
       
    68 		TBool IsRead() const;
       
    69 		
       
    70         virtual TTime Time() const;
       
    71         
       
    72         TLogId LogId() const;
       
    73 
       
    74         HBufC* Number();
       
    75 
       
    76         HBufC* RemoteParty( );
       
    77 
       
    78         TLogsDirection Direction() const;
       
    79 
       
    80         TUid EventUid() const;
       
    81 
       
    82         TLogsEventType EventType() const;
       
    83 
       
    84         TInt8 Duplicates() const;
       
    85 
       
    86         void InitializeEventL( const CLogEvent& aSource,
       
    87                                TLogsEventStrings aStrings,
       
    88                                TLogsModel aModel );
       
    89 
       
    90         MLogsEventData* LogsEventData() const;
       
    91 
       
    92    	   /**
       
    93         * Set the event read/unread according to flags in 
       
    94         *
       
    95         * @param true/false
       
    96         */
       
    97         void SetIsRead(TBool aRead);
       
    98         
       
    99        /**
       
   100         * Get the ALS flag from event 
       
   101         *
       
   102         * @return true/false
       
   103         */
       
   104         TBool ALS() const; 
       
   105 
       
   106         TBool CNAP() const { return EFalse; };
       
   107 		//For ring duation feature
       
   108         TLogDuration RingDuration() const;
       
   109         
       
   110        /**
       
   111         * Return Phone number field type
       
   112         *
       
   113         * @return Phone number field type
       
   114         */       
       
   115         TInt NumberFieldType() const;
       
   116         
       
   117                                
       
   118     private:                               
       
   119 
       
   120         //void Reset(); 
       
   121 
       
   122         virtual void SetTime( const TTime aTime );
       
   123 
       
   124         void SetLogId( const TLogId aLogId );
       
   125        
       
   126         void SetNumber( HBufC* aNumber );
       
   127 
       
   128         void SetRemoteParty( HBufC* aRemoteParty );
       
   129 
       
   130         void SetDirection( const TLogsDirection aDirection );
       
   131 
       
   132         void SetEventUid( const TUid aUid );
       
   133 
       
   134         void SetEventType( const TLogsEventType aEventType );
       
   135 
       
   136         void SetDuplicates( const TInt8 aDuplicates );
       
   137 
       
   138         void SetLogsEventData( MLogsEventData* aLogsEventData );
       
   139         
       
   140        /**
       
   141         * Set the ALS flag
       
   142         *
       
   143         * @param true/false
       
   144         */
       
   145         void SetALS( TBool aALS ); 
       
   146         
       
   147         void SetRingDuration( TLogDuration aRingDuration );     
       
   148         
       
   149        /**
       
   150         * Check wether the number is an emergency number.
       
   151         *
       
   152         * @param aNumber, the number
       
   153         * @return true/false 
       
   154         */
       
   155         TBool IsEmergencyNumberL( const TDesC& aNumber );
       
   156         
       
   157         /**
       
   158          * Phone number field type setter
       
   159          *
       
   160          * @param set number field type
       
   161          */
       
   162          void SetNumberFieldType( const TInt aNumberFieldType );
       
   163         
       
   164     private:    // data
       
   165     
       
   166         //Flag to control skip time processing to optimise performance of event list view 
       
   167         TBool iTimeSet;          
       
   168 
       
   169         // own: log id
       
   170         TLogId  iLogId;        
       
   171         
       
   172         // own: direction
       
   173         TInt8  iDirection;
       
   174 
       
   175         // own: event type
       
   176         TInt8  iEventType;
       
   177 
       
   178         // own: uid
       
   179         //TUint8 iUid;
       
   180         TUid iUid;
       
   181 
       
   182         // own: Logs additional event data 
       
   183         MLogsEventData* iLogsEventData;
       
   184 
       
   185         /// Own: Remote party
       
   186         HBufC* iRemoteParty;
       
   187 
       
   188         /// Own: Nunber
       
   189         HBufC* iNumber;
       
   190         
       
   191         // own: duplicates
       
   192         TInt8   iDuplicates;               
       
   193 
       
   194         // own: time
       
   195         TTime   iTime;     
       
   196         
       
   197 		//For ring duation feature    
       
   198         TLogDuration iRingDuration;
       
   199         
       
   200         // For indicate new missed calls feature 
       
   201 	    TBool iIsRead;
       
   202 	    
       
   203 	    TBool iALS;
       
   204 	    
       
   205 	    // own: number field type
       
   206 	    TInt iNumberFieldType;
       
   207  
       
   208     };
       
   209 
       
   210 #endif      // __Logs_Engine_CLogsEvent_H__
       
   211 
       
   212 
       
   213 
       
   214 // End of File