harvester/harvesterplugins/MessagePlugin/inc/harvestermessageplugin.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:  Harvests metadata from sms/mms messages.*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef __CHARVESTERMESSAGEPLUGIN_H__
       
    19 #define __CHARVESTERMESSAGEPLUGIN_H__
       
    20 
       
    21 #include <mdeobject.h>
       
    22 #include <fbs.h>
       
    23 #include <msvapi.h>
       
    24 
       
    25 #include "harvesterplugin.h"
       
    26 #include "monitorplugin.h"
       
    27 
       
    28 // forward declarations
       
    29 class CHarvesterMessagePluginAO;
       
    30 class CMsvSession;
       
    31 class CClientMtmRegistry;
       
    32 class CMmsClientMtm;
       
    33 class CSmsClientMtm;
       
    34 
       
    35 /**
       
    36  * Message harvester plug-in.
       
    37  * Harvests metadata from sms/mms messages.
       
    38  * Implements CHarvesterPlugin.
       
    39  */
       
    40 class CHarvesterMessagePlugin : public CHarvesterPlugin,
       
    41 								public MMsvSessionObserver
       
    42     {
       
    43     public:
       
    44 
       
    45         /**
       
    46         * Construction
       
    47         * @return Harvester image plugin
       
    48         */
       
    49         static CHarvesterMessagePlugin* NewL();
       
    50 
       
    51         /**
       
    52         * Destruction
       
    53         */
       
    54         virtual ~CHarvesterMessagePlugin();
       
    55 
       
    56 		/**
       
    57 		* @param aHD harvester data type
       
    58 		*/
       
    59 		void HarvestL( CHarvesterData* aHD );
       
    60 		
       
    61 		/**
       
    62         * From MMsvSessionObserver
       
    63         */
       
    64         virtual void HandleSessionEventL( TMsvSessionEvent aEvent, 
       
    65                                           TAny* aArg1, 
       
    66                                           TAny* aArg2, 
       
    67                                           TAny* aArg3 );
       
    68 		
       
    69     private:
       
    70     
       
    71         /**
       
    72          * Default constructor
       
    73          */
       
    74         CHarvesterMessagePlugin();
       
    75         
       
    76         /**
       
    77          * 2nd phase constructor.
       
    78          */
       
    79         void ConstructL();
       
    80         
       
    81         /**
       
    82          * The method that actually extracts the metadata
       
    83          * @param aMetadataObject  Metadata object which is filled with metadata
       
    84          * @return Error code which indicates status of the operation
       
    85          */                
       
    86          TInt GatherDataL( CMdEObject& aMetadataObject );
       
    87          
       
    88          /**
       
    89          * It takes const ref to two THarvestResult objects and returns zero if 
       
    90          * the iUri of objects are equal, a negative value if aFirst is less than aSecond and 
       
    91          * a positive value if aFirst is greater than aSecond. 
       
    92          * @param aFirst
       
    93          * @param aSecond   
       
    94          * @return returns zero if the objects are equal, a negative value if aFirst 
       
    95          * is less than aSecond and a positive value if aFirst is greater than aSecond. 
       
    96          */   
       
    97          static TInt CompareByUri( const THarvestResult& aFirst, const THarvestResult& aSecond );
       
    98          
       
    99          /**
       
   100          * It takes const ref to two CMdEObject objects and returns zero if 
       
   101          * the id of objects are equal, a negative value if aFirst is less than aSecond and 
       
   102          * a positive value if aFirst is greater than aSecond. 
       
   103          * @param aFirst
       
   104          * @param aSecond   
       
   105          * @return returns zero if the objects are equal, a negative value if aFirst 
       
   106          * is less than aSecond and a positive value if aFirst is greater than aSecond. 
       
   107          */   
       
   108          static TInt CompareById( const CMdEObject& aFirst, const CMdEObject& aSecond );    
       
   109          
       
   110          /**
       
   111           *
       
   112           */
       
   113          void SetPropertiesL(CHarvesterData& aHD);
       
   114     
       
   115     private:
       
   116     	
       
   117 		/**
       
   118 		 * Session Message server session, own
       
   119 		 */
       
   120 		 CMsvSession* iMsvSession;
       
   121     
       
   122 		 /**
       
   123         * iMTMReg Accesses the MTM on the message server
       
   124         */
       
   125         CClientMtmRegistry* iMtmReg;    
       
   126         
       
   127         /**
       
   128         * iMmsMtm Access MMS messages on the message server
       
   129         */
       
   130         CMmsClientMtm* iMmsMtm;    
       
   131         
       
   132         /**
       
   133         * iSmsMtm Access SMS messages on the message server
       
   134         */
       
   135         CSmsClientMtm* iSmsMtm;
       
   136         
       
   137         /**
       
   138          *
       
   139          */
       
   140         HBufC* iFromOrTo;
       
   141         
       
   142         /**
       
   143          *
       
   144          */
       
   145         TInt64 iSize;
       
   146         
       
   147         /**
       
   148          *
       
   149          */
       
   150         TBool iIncoming;
       
   151         
       
   152         /**
       
   153          *
       
   154          */
       
   155         TTime iDate;
       
   156         
       
   157         /**
       
   158          *
       
   159          */
       
   160         TPtrC iItemType;
       
   161         
       
   162         /**
       
   163          *
       
   164          */
       
   165         TPtrC iSubject;
       
   166     };
       
   167 
       
   168 #endif
       
   169