camerauis/cameraxui/cxengine/tsrc/unit/system_include/harvesterclient.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2006-2010 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:  copy of normally used "system" file for harvester client
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __HARVESTER_CLIENT_H__
       
    20 #define __HARVESTER_CLIENT_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 
       
    24 class MHarvestObserver
       
    25 	{
       
    26 public:
       
    27     /**
       
    28      * Callback to inform when fast harvesting of a file is complete.
       
    29      * 
       
    30      * @param aURI    URI of the harvested file.
       
    31      * @param aError  Error code of the fast harvesting. <code>KErrNone</code> is
       
    32      *                expected if fast harvesting succeeded. Otherwise some
       
    33      *                system wide error code. 
       
    34      *
       
    35      */
       
    36 	virtual void HarvestingComplete( TDesC& aURI, TInt aError ) = 0;
       
    37 	};
       
    38 
       
    39 
       
    40 
       
    41 /**
       
    42  * Harvester client session class which provides also means to:
       
    43  * - Pause/resume the Harvesting framework
       
    44  * - Fast harvest files and observe when they have been harvested
       
    45  * - Setup observers to observe the harvesting progress
       
    46  */
       
    47 class RHarvesterClient
       
    48 	{
       
    49 
       
    50 	public:
       
    51 		
       
    52         /**
       
    53          * Constructor
       
    54          */
       
    55         RHarvesterClient();
       
    56 
       
    57         /**
       
    58          * Public method to connect Harvester server.
       
    59          * 
       
    60          * @return Symbian OS error code.
       
    61          */
       
    62         TInt Connect();
       
    63          
       
    64         /**
       
    65          * Public method to close session to Harvester server.
       
    66          */
       
    67         void Close();
       
    68             
       
    69         /**
       
    70          * Public method to set observer for fast harvesting.
       
    71          * Only one observer is currently supported.
       
    72          *
       
    73          * @param aObserver  Pointer to the observer
       
    74          */     
       
    75         void SetObserver(MHarvestObserver* aObserver);
       
    76 
       
    77         /**
       
    78          * Public method to remove observer for fast harvesting.
       
    79          *
       
    80          * @param aObserver  Pointer to the observer
       
    81          */     
       
    82         void RemoveObserver(MHarvestObserver* aObserver);
       
    83         
       
    84         /**
       
    85          * Public method for doing fast harvesting. These files
       
    86          * are handled first before the ones that are in the harvesting 
       
    87          * queue inside the Harvesting framework.
       
    88          *
       
    89          * @param aURI          Uri of the file to be harvested
       
    90          * @param aAlbumIds     Array of album id's that the harvested file 
       
    91          *                      will be included in
       
    92          * @param aAddLocation  Should location information be added to item
       
    93          */ 
       
    94     	void HarvestFile(const TDesC& aURI, RArray<TUint32> &aAlbumIds, TBool aAddLocation);
       
    95         
       
    96         
       
    97 	private: 
       
    98 
       
    99 	    /**
       
   100 	     * Observer of the class
       
   101 	     */ 
       
   102 	     MHarvestObserver* mObserver;
       
   103 
       
   104     	};
       
   105 
       
   106 #endif // __HARVESTER_CLIENT_H__