phoneengine/loghandling/inc/cpeloghandling.h
changeset 0 5f000ab63145
child 9 8871b09be73b
child 76 cfea66083b62
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2003-2006 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:  This file contains the header file of the CPELogHandling class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef    CPELOGHANDLING_H
       
    20 #define    CPELOGHANDLING_H
       
    21 
       
    22 //INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <mccecall.h>
       
    25 #include <f32file.h>
       
    26 #include <logwrap.h>
       
    27 #include "mpeloghandling.h"
       
    28 
       
    29 // CONSTANTS
       
    30 // Maximum number of log events that may be needed at any given moment.
       
    31 // Due to log system limitations there is a chance more log event are needed
       
    32 // and this will be handled as it happens
       
    33 const TInt KPEMaximumNumberOfLogEvents = KPEMaximumNumberOfCalls + 2;
       
    34 
       
    35 // MACROS
       
    36 // None.
       
    37 
       
    38 // DATA TYPES
       
    39 typedef TBuf8<KCntMaxTextFieldLength> TPELogsDataFieldType;
       
    40 
       
    41 
       
    42 // FUNCTION PROTOTYPES
       
    43 // None.
       
    44 
       
    45 // FORWARD DECLARATIONS
       
    46 class CPELogHandlingCommand;
       
    47 class CPELogExternalData;
       
    48 class CPELogEvent;
       
    49 class CLogClient;
       
    50 class MPEPhoneModelInternal;
       
    51 class MPEDataStore;
       
    52 class CPELogInfo;
       
    53 class CTelLoggingExtension;
       
    54 class CSPSettings;
       
    55 class CPELogExtensionWrapper;
       
    56 
       
    57 // CLASS DECLARATION
       
    58 
       
    59 class CPELogHandling : public CBase,
       
    60                        public MPELogHandling
       
    61     {
       
    62     public:
       
    63 
       
    64         /**
       
    65         * Two-phased constructor
       
    66         */
       
    67         static MPELogHandling* NewL( MPEPhoneModelInternal& aModel, RFs& aFsSession );
       
    68              
       
    69         /**
       
    70          * Destructor.
       
    71          */
       
    72         /*****************************************************
       
    73         *    Series 60 Customer / LOGENG
       
    74         *    Series 60  LOGENG API
       
    75         *****************************************************/                
       
    76         virtual IMPORT_C ~CPELogHandling();
       
    77         
       
    78     protected:
       
    79 
       
    80         /**
       
    81         * C++ default constructor.
       
    82         */
       
    83         CPELogHandling( MPEPhoneModelInternal& aModel, RFs& aFsSession );
       
    84 
       
    85         /**
       
    86         * Constructor, second phase. 
       
    87         */
       
    88         /*****************************************************
       
    89         *    Series 60 Customer / LOGENG
       
    90         *    Series 60  LOGENG API
       
    91         *****************************************************/                
       
    92         void ConstructL();
       
    93 
       
    94     public: // From MPELogHandling
       
    95         /**
       
    96         * Save call entry
       
    97         * @since N/A
       
    98         * @param: TInt, call id
       
    99         * @return: possible error code.
       
   100         */
       
   101         IMPORT_C TInt SaveCallEntry( const TInt aCallId );
       
   102         
       
   103     public:      
       
   104         /**
       
   105         * Reroutes messages to the Phone Model.
       
   106         * @since Series60_2.7
       
   107         * @param aMessage Message id.
       
   108         * @param aErrorCode Error code.
       
   109         * @return None.
       
   110         */
       
   111         void SendMessage( MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, TInt aErrorCode );
       
   112 
       
   113         /* Get log string
       
   114         * @param: None
       
   115         * @return TLogString, string for incoming call.
       
   116         */  
       
   117         TLogString& LogStringIn( );
       
   118 
       
   119 
       
   120         /* Get log string
       
   121         * @param: None
       
   122         * @return TLogString, string for outgoing call.
       
   123         */  
       
   124         TLogString& LogStringOut( );
       
   125 
       
   126         /* Get log string
       
   127         * @param: None
       
   128         * @return TLogString, string for missed call.
       
   129         */  
       
   130         TLogString& LogStringMissed( );
       
   131 
       
   132         /* Get log string
       
   133         * @param: None
       
   134         * @return TLogString, string for delivery.
       
   135         */  
       
   136         TLogString& LogStringDelivery( );
       
   137 
       
   138         /* Get log string
       
   139         * @param: None
       
   140         * @return TLogString, string for incoming auxiliary call.
       
   141         */  
       
   142         TLogString& LogStringInAlt( );
       
   143         
       
   144         /* Get log string
       
   145         * @param: None
       
   146         * @return TLogString, string for outgoing auxiliary call.
       
   147         */  
       
   148         TLogString& LogStringOutAlt( );
       
   149         
       
   150         /* Get log string
       
   151         * @param: None
       
   152         * @return TLogString, string for unknown call.
       
   153         */  
       
   154         TLogString& LogStringUnknown( );
       
   155         
       
   156         /**
       
   157         * Reset missed call status.
       
   158         */
       
   159         void ResetMissedCalls( const TInt aCallId );
       
   160         
       
   161     private:
       
   162 
       
   163         /**
       
   164          * Set remote contact information to log info.
       
   165          * @since   S60 v9.1
       
   166          * @param   aCallId     Call identifier.
       
   167          * @param   aLogInfo    Log info.
       
   168          */
       
   169         void SetRemoteContact( TInt aCallId, CPELogInfo& aLogInfo );
       
   170         
       
   171         /**
       
   172         * Update call info to log database.
       
   173         * @since N/A
       
   174         * @param  CPELogInfo aCallInfo, call information.
       
   175         * @return None.
       
   176         */
       
   177         void SaveCallInfoL( const CPELogInfo& aLogInfo );
       
   178 
       
   179         /**
       
   180         * Save log event
       
   181         * @since N/A
       
   182         * @param: const CPELogInfo&, log information
       
   183         * @return: none.
       
   184         */
       
   185         void SaveEventL( const CPELogInfo& aLogInfo );        
       
   186     
       
   187         /**
       
   188         * Find Log database entry index by given call id.
       
   189         * @since Series60_2.7
       
   190         * @param: TInt aCallId , call identification number.
       
   191         * @return: Error code.
       
   192         */
       
   193         TInt FindEventIndexById( const TInt aCallId );
       
   194         
       
   195         /**
       
   196         * Delete event in Id array
       
   197         * @since Series60_2.7
       
   198         * @param: CPELogsEntry* aLogEntry pointer
       
   199         * @return: None.
       
   200         */
       
   201         void DeleteArrayEntry( CPELogEvent* aLogEvent );                
       
   202 
       
   203         /**
       
   204         * Log Handling cleanup if log handling of an event leaves.
       
   205         * @since Series60_2.7
       
   206         */
       
   207         void DoCleanup();
       
   208         
       
   209         /**
       
   210          * Updates log info with a data queried from logging extension plugin.
       
   211          * Log info is not changed if error happens while using extension.
       
   212          * @since   S60 v9.1
       
   213          * @param   aCallId     Call identifier.
       
   214          * @param   aLogInfo    Log info to be updated.
       
   215          */
       
   216         void UpdateLogInfoWithExtensionDataL( TInt aCallId, 
       
   217             CPELogInfo& aLogInfo );
       
   218 
       
   219         /**
       
   220          * Returns logging extension plugin for the given service. A new 
       
   221          * plugin is created if extension is not yet created for the service.
       
   222          * @since   S60 v5.1
       
   223          * @param   aServiceId  Service identifier.
       
   224          */
       
   225         CTelLoggingExtension& LoggingExtensionL( TUint aServiceId );
       
   226         
       
   227         /**
       
   228          * Returns logging extension plugin identifier from service
       
   229          * provider settings.
       
   230          * @since   S60 v9.1
       
   231          * @param   aServiceId  Service identifier.
       
   232          */
       
   233         TUid LoggingPluginIdentifierL( TUint aServiceId ) const;
       
   234         
       
   235         /**
       
   236          * Sets extension data to log info.
       
   237          * @since   S60 v9.1
       
   238          * @param   aLogInfo        Log info to be updated.
       
   239          * @param   aPhoneNumber    Phone number of remote party.
       
   240          * @param   aVoipAddress    Voip address of remote party.
       
   241          * @param   aMyAddress      Local user's registered address.
       
   242          * @param   aRemotePartyName Name of the remote party.
       
   243          */
       
   244         void SetExtensionData( CPELogInfo& aLogInfo, 
       
   245             const TDesC& aPhoneNumber, const TDesC& aVoipAddress, 
       
   246             const TDesC& aMyAddress, const TDesC& aRemotePartyName );
       
   247         
       
   248         /**
       
   249          * Creates an logging extension wrapper instance.
       
   250          * @since   S60 v5.1
       
   251          * @param   aPluginUid      An ECom plugin implementation identifier.
       
   252          * @return  Extension wrapper instance.
       
   253          */
       
   254         CPELogExtensionWrapper* CreateExtensionWrapperLC( 
       
   255             const TUid& aPluginUid ) const;
       
   256         
       
   257     private: // data 
       
   258         // Reference to MPEPhoneModelInternal, also object owner
       
   259         MPEPhoneModelInternal&  iModel;
       
   260         // Reference to data store
       
   261         MPEDataStore& iDataStore;
       
   262         // Log database connection.
       
   263         /*****************************************************
       
   264         *    Series 60 Customer / LOGENG
       
   265         *    Series 60  LOGENG API
       
   266         *****************************************************/                
       
   267         CLogClient* iLogClient;           
       
   268         // Array of active log events
       
   269         RPointerArray< class CPELogEvent > iActiveLogEventArray;
       
   270         // Array of queued log events
       
   271         RPointerArray< class CPELogEvent > iQueuedLogEventArray;
       
   272         // Array of free log event objects
       
   273         RPointerArray< class CPELogEvent > iFreeLogEventArray;
       
   274         // Logs handling command pointer   
       
   275         CPELogHandlingCommand* iLogHandlingCommand;  
       
   276         // Log external data pointer
       
   277         CPELogExternalData* iLogExternalData;
       
   278         // File session connection
       
   279         RFs& iFsSession;
       
   280         // Identifiers of active calls.
       
   281         RArray<TInt> iActiveCallIds;
       
   282         // pointer to the log event under processing
       
   283         CPELogEvent* iLogEventUnderProcessing;
       
   284         
       
   285         // Enumeration for incoming call, get from database  
       
   286         /*****************************************************
       
   287         *    Series 60 Customer / LOGENG
       
   288         *    Series 60  LOGENG API
       
   289         *****************************************************/                
       
   290         TLogString iLogStringIn;          
       
   291         // Enumeration for outgoing call, get from database
       
   292         /*****************************************************
       
   293         *    Series 60 Customer / LOGENG
       
   294         *    Series 60  LOGENG API
       
   295         *****************************************************/                
       
   296         TLogString iLogStringOut;       
       
   297         // Enumeration for missed call, get from database
       
   298         /*****************************************************
       
   299         *    Series 60 Customer / LOGENG
       
   300         *    Series 60  LOGENG API
       
   301         *****************************************************/                
       
   302         TLogString iLogStringMissed;  
       
   303         // Enumeration for delivery, ger from database.
       
   304         /*****************************************************
       
   305         *    Series 60 Customer / LOGENG
       
   306         *    Series 60  LOGENG API
       
   307         *****************************************************/                
       
   308         TLogString iLogStringDelivery;  
       
   309        // Enumeration for incoming auxiliary line call, get from database.
       
   310         /*****************************************************
       
   311         *    Series 60 Customer / LOGENG
       
   312         *    Series 60  LOGENG API
       
   313         *****************************************************/                
       
   314         TLogString iLogStringInAlt;
       
   315         // Enumeration for outgoing auxiliary line call, get from database.
       
   316         /*****************************************************
       
   317         *    Series 60 Customer / LOGENG
       
   318         *    Series 60  LOGENG API
       
   319         *****************************************************/                
       
   320         TLogString iLogStringOutAlt;
       
   321         // Enumeration for Unknown name, get from database.
       
   322         /*****************************************************
       
   323         *    Series 60 Customer / LOGENG
       
   324         *    Series 60  LOGENG API
       
   325         *****************************************************/                
       
   326         TLogString iLogStringUnknown;        
       
   327         
       
   328         /**
       
   329          * Logging extension plugins.
       
   330          * Own.
       
   331          */
       
   332         RPointerArray<CPELogExtensionWrapper> iPlugins;
       
   333 
       
   334     };
       
   335 
       
   336 #endif // CPELOGSHANDLER_H
       
   337 
       
   338 // End of File
       
   339