contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h
branchRCL_3
changeset 30 a5a39a295112
equal deleted inserted replaced
29:0efa10d348c0 30:a5a39a295112
       
     1 /*
       
     2 * Copyright (c) 2007 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  *
       
    16 */
       
    17 
       
    18 #ifndef C_CCHSWIPLUGIN_H
       
    19 #define C_CCHSWIPLUGIN_H
       
    20 
       
    21 #include <contentharvesterplugin.h>
       
    22 #include <apgnotif.h>
       
    23 
       
    24 #include "chswimassmodeobserver.h"
       
    25 
       
    26 class MLiwInterface;
       
    27 class CLiwGenericParamList;
       
    28 
       
    29 class CCHSwiUsbHandler;
       
    30 class CCHSwiUsbObserver;
       
    31 
       
    32 /**
       
    33  *  Active Data plugin for SIS installation events.
       
    34  *
       
    35  *  @since S60 S60 v3.1
       
    36  */
       
    37 class CCHSwiPlugin: public CContentHarvesterPlugin,
       
    38         MApaAppListServObserver, MCHSwiMassModeObserver
       
    39 	{
       
    40 	
       
    41 public:
       
    42 	/**
       
    43 	 * Two-phased constructor.
       
    44      * @param aInterface liw interface
       
    45 	 */
       
    46 	static CCHSwiPlugin* NewL( MLiwInterface* aInterface );
       
    47 	
       
    48 	/**
       
    49 	 * Destructor.
       
    50 	 */
       
    51 	virtual ~CCHSwiPlugin();			 		
       
    52 
       
    53 	/**
       
    54 	 * From CContentHarvesterPlugin.
       
    55 	 * This function updates all data entries which could change when an applicaion is installed
       
    56 	 * or when the MMC is removed/inserted.
       
    57 	 */
       
    58 	void UpdateL();
       
    59 	
       
    60 private:
       
    61 	
       
    62 	// from MCHSwiMassModeObserver
       
    63 	void SetMassStorageMode( TBool aMode );
       
    64 	TBool IsMassStorageMode();
       
    65 	void HandleMassStorageModeEndEvent();
       
    66 	void HandleSuccessfulAsynchDriveScan();
       
    67 	
       
    68     // from MApaAppListServObserver
       
    69 
       
    70     void HandleAppListEvent( TInt aEvent );    
       
    71     /**
       
    72 	 * Performs the second phase construction of a CADatSwi object.
       
    73 	 */		
       
    74 	void ConstructL();
       
    75 	
       
    76 	/**
       
    77 	 * Default Constructor.
       
    78 	 * @param aActiveSpace An instance of the Active Space Client.
       
    79 	 */
       
    80 	CCHSwiPlugin( MLiwInterface* aInterface );
       
    81 	
       
    82     /**
       
    83      * Removes publishers from database when an applicaion 
       
    84      * is uninstalled or when the MMC is removed.
       
    85      */
       
    86 	void UpdateWidgetsL();
       
    87 	
       
    88 	/**
       
    89 	 * Removes widgets.
       
    90 	 * @param aWidgets Widgets list.
       
    91 	 */
       
    92 	void RemoveWidgetsL( CLiwGenericParamList* aWidgets );
       
    93 	
       
    94 	/** 
       
    95 	 * Removes single widget.
       
    96 	 * @param aType Widget type.
       
    97 	 * @param aPublisherId Widget UID.
       
    98 	 */
       
    99 	void RemoveWidgetL( const TDesC& aType, 
       
   100         const TDesC& aPublisherId );
       
   101 	
       
   102     /**
       
   103      * Checks if mass memory is available
       
   104      * @return ETrue if internal mass memory is available in this device
       
   105      *     EFalse if not
       
   106      */
       
   107     TBool InternalMassMemoryAvailable( );
       
   108     
       
   109 private:
       
   110     
       
   111     /**
       
   112      * An interface to Content Publisher Service
       
   113      */
       
   114     MLiwInterface* iCPSInterface;
       
   115    
       
   116     /**
       
   117      * AppArc session.
       
   118      * Own.
       
   119      */     
       
   120     RApaLsSession iApaLsSession;
       
   121     
       
   122     /**
       
   123      * File session.
       
   124      */
       
   125     RFs iFs;
       
   126     
       
   127     /**
       
   128      * Change notifier.
       
   129      * Own.
       
   130      */
       
   131     CApaAppListNotifier* iNotifier; 
       
   132     
       
   133     /**
       
   134      * Mass storage mode handler. 
       
   135      * Own.
       
   136      */
       
   137     CCHSwiUsbHandler* iUsbHandler;
       
   138     
       
   139     /**
       
   140      * Disk observer for monitoring status of mass drive. 
       
   141      * Own.
       
   142      */
       
   143     CCHSwiUsbObserver* iUsbObserver;
       
   144     
       
   145     /**
       
   146      * Mass storage mode flag.
       
   147      */
       
   148     TBool iMassStorageMode;
       
   149     
       
   150     /*
       
   151      * Flag indicating if mass memory is available on this hardware
       
   152      */
       
   153     TBool iMassMemoryAvailable;
       
   154     
       
   155 
       
   156 	};
       
   157 
       
   158 
       
   159 
       
   160 #endif // C_CCHSWIPLUGIN_H