diff -r 0efa10d348c0 -r a5a39a295112 contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/inc/chswiplugin.h Wed Sep 01 12:22:09 2010 +0100 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: + * +*/ + +#ifndef C_CCHSWIPLUGIN_H +#define C_CCHSWIPLUGIN_H + +#include +#include + +#include "chswimassmodeobserver.h" + +class MLiwInterface; +class CLiwGenericParamList; + +class CCHSwiUsbHandler; +class CCHSwiUsbObserver; + +/** + * Active Data plugin for SIS installation events. + * + * @since S60 S60 v3.1 + */ +class CCHSwiPlugin: public CContentHarvesterPlugin, + MApaAppListServObserver, MCHSwiMassModeObserver + { + +public: + /** + * Two-phased constructor. + * @param aInterface liw interface + */ + static CCHSwiPlugin* NewL( MLiwInterface* aInterface ); + + /** + * Destructor. + */ + virtual ~CCHSwiPlugin(); + + /** + * From CContentHarvesterPlugin. + * This function updates all data entries which could change when an applicaion is installed + * or when the MMC is removed/inserted. + */ + void UpdateL(); + +private: + + // from MCHSwiMassModeObserver + void SetMassStorageMode( TBool aMode ); + TBool IsMassStorageMode(); + void HandleMassStorageModeEndEvent(); + void HandleSuccessfulAsynchDriveScan(); + + // from MApaAppListServObserver + + void HandleAppListEvent( TInt aEvent ); + /** + * Performs the second phase construction of a CADatSwi object. + */ + void ConstructL(); + + /** + * Default Constructor. + * @param aActiveSpace An instance of the Active Space Client. + */ + CCHSwiPlugin( MLiwInterface* aInterface ); + + /** + * Removes publishers from database when an applicaion + * is uninstalled or when the MMC is removed. + */ + void UpdateWidgetsL(); + + /** + * Removes widgets. + * @param aWidgets Widgets list. + */ + void RemoveWidgetsL( CLiwGenericParamList* aWidgets ); + + /** + * Removes single widget. + * @param aType Widget type. + * @param aPublisherId Widget UID. + */ + void RemoveWidgetL( const TDesC& aType, + const TDesC& aPublisherId ); + + /** + * Checks if mass memory is available + * @return ETrue if internal mass memory is available in this device + * EFalse if not + */ + TBool InternalMassMemoryAvailable( ); + +private: + + /** + * An interface to Content Publisher Service + */ + MLiwInterface* iCPSInterface; + + /** + * AppArc session. + * Own. + */ + RApaLsSession iApaLsSession; + + /** + * File session. + */ + RFs iFs; + + /** + * Change notifier. + * Own. + */ + CApaAppListNotifier* iNotifier; + + /** + * Mass storage mode handler. + * Own. + */ + CCHSwiUsbHandler* iUsbHandler; + + /** + * Disk observer for monitoring status of mass drive. + * Own. + */ + CCHSwiUsbObserver* iUsbObserver; + + /** + * Mass storage mode flag. + */ + TBool iMassStorageMode; + + /* + * Flag indicating if mass memory is available on this hardware + */ + TBool iMassMemoryAvailable; + + + }; + + + +#endif // C_CCHSWIPLUGIN_H