harvester/harvesterserver/inc/cpixstateobserver.h
changeset 24 65456528cac2
equal deleted inserted replaced
23:d4d56f5e7c55 24:65456528cac2
       
     1 /*
       
     2 * Copyright (c) 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:  MDE harvester utility class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPIXSTATEOBSERVER_H_
       
    19 #define CPIXSTATEOBSERVER_H_
       
    20 
       
    21 #include <e32def.h>
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <usbmsshared.h>
       
    25 #include <mpxcollectionobserver.h>
       
    26 #include <harvesterclient.h>
       
    27 
       
    28 class MMPXCollectionUtility;
       
    29 
       
    30 class MCPiXStateObserver
       
    31     {
       
    32 public:
       
    33     /* A pure virtual function that need to be handled for cases of MMC harvesting,
       
    34      * Musicplayer sync events by pausing the currect indexing operations
       
    35      */
       
    36     virtual void HandleStateObserverChangeL(const TBool aActive) = 0;
       
    37     };
       
    38 
       
    39 class CPiXStateObserver : public CBase,
       
    40                           public MHarvesterEventObserver,
       
    41                           public MMPXCollectionObserver
       
    42 {
       
    43 public:
       
    44     /**
       
    45      * NewL construction.
       
    46      * @return Pointer to created CPiXStateObserver object.
       
    47      */
       
    48     static CPiXStateObserver* NewL( MCPiXStateObserver* aObserver, RFs* aFsSession );    
       
    49 
       
    50     /**
       
    51      * Destructor.
       
    52      */
       
    53     virtual ~CPiXStateObserver();
       
    54     
       
    55     void StartMonitoringL();
       
    56     
       
    57 private:  // Constructors and destructors
       
    58 
       
    59     /**
       
    60      * C++ default constructor.
       
    61      * @param aObserver Observer
       
    62      */
       
    63     CPiXStateObserver(MCPiXStateObserver* aObserver);
       
    64 
       
    65     /**
       
    66      * 2nd phase constructor.
       
    67      */
       
    68     void ConstructL( RFs* aFsSession );    
       
    69     
       
    70     //void UpdatePSValue();
       
    71     
       
    72     // from MHarvesterEventObserver
       
    73     void HarvestingUpdated( HarvesterEventObserverType aHEObserverType, 
       
    74                             HarvesterEventState aHarvesterEventState,
       
    75                             TInt aItemsLeft );
       
    76         
       
    77     // from MMPXCollectionObserver
       
    78     void HandleCollectionMessage( CMPXMessage* aMessage,  TInt aError );
       
    79     
       
    80     //from MMPXCollectionObserver::HandleOpenL
       
    81     void HandleOpenL(const CMPXMedia& aEntries, TInt aIndex, TBool aComplete, TInt aError);
       
    82 
       
    83     //from MMPXCollectionObserver::HandleOpenL
       
    84     void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist, TInt aError);  
       
    85     
       
    86     //from MMPXCollectionObserver::HandleCollectionMediaL
       
    87     void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
       
    88     
       
    89     TBool GetStatus();
       
    90     
       
    91     void NotifyObserverL();
       
    92     
       
    93 private:
       
    94     
       
    95     //MDS Harvester client
       
    96    RHarvesterClient iHarvesterClient;
       
    97    
       
    98    MMPXCollectionUtility* iCollectionUtility;
       
    99    
       
   100    MCPiXStateObserver* iObserver;
       
   101    
       
   102    //RProperty iDriveState;
       
   103    
       
   104    TBool iMMCHarvesting;
       
   105    TBool iMPXHarvesting;
       
   106    // inserted/ejected status of mmc
       
   107    //TBool iMassStorageMode;
       
   108    
       
   109    TInt iPreviousState;
       
   110    TInt  itemsleft;   
       
   111    RFs* iFsSession;
       
   112   
       
   113 };
       
   114 #endif /* CPIXSTATEOBSERVER_H_ */