diff -r 5aadd1120515 -r b57382753122 calendarui/customisationmanager/inc/calencustomisationmanager.h --- a/calendarui/customisationmanager/inc/calencustomisationmanager.h Fri Oct 15 12:10:36 2010 +0530 +++ b/calendarui/customisationmanager/inc/calencustomisationmanager.h Wed Nov 03 17:12:22 2010 +0530 @@ -16,36 +16,35 @@ */ + #ifndef CALENCUSTOMISATIONMANAGER_H #define CALENCUSTOMISATIONMANAGER_H -#include // Q_DECL_EXPORT macro +#include // CAknSettingItem #include // CBase -#include "calennotificationhandler.h" // MCalenNotificationHandler +#include // MCalenNotificationHandler #include // RImplInfoPtrArray - - -#ifdef CALENCUSTOMISATIONMANAGER_DLL -#define CUSTOMISATIONMANAGER_EXPORT Q_DECL_EXPORT -#else -#define CUSTOMISATIONMANAGER_EXPORT Q_DECL_IMPORT -#endif +#include // TCyclePosition // forward declarations - - +class CEikMenuPane; +class CCalenView; class CCalenCustomisation; class MCalenCommandHandler; +class CCalenGlobalData; +class CCoeControl; +class CCalenViewInfo; +class CAknSettingItem; class MCalenServicesFactory; class MCalenServices; -class HbWidget; -class HbMenu; +class CCalenSetting; +class MCalenPreview; /** * CCalenCustomisationManager manages customisations for calendar. * */ -class CUSTOMISATIONMANAGER_EXPORT CCalenCustomisationManager : public CBase, +class CCalenCustomisationManager : public CBase, public MCalenNotificationHandler { public: // Types @@ -66,97 +65,179 @@ /** * Returns a new CCalenCustomisationManager object. */ - static CCalenCustomisationManager* NewL( - MCalenServicesFactory& aFactory, - MCalenServices& aServices ); + IMPORT_C static CCalenCustomisationManager* NewL( + MCalenServicesFactory& aFactory, + CCalenPluginStatusArray& aPluginSettingsStatus, + MCalenServices& aServices, + RPointerArray& aViewArray ); - static TBool PluginInfoFinder( const TUid* aUid , - const CImplementationInformation& aArrayItem); - /** * Destructor. */ ~CCalenCustomisationManager(); public: // New functions - + /** + * Get a command handler for a specific command + * @param aCommand Command to find a command handler for + */ + IMPORT_C MCalenCommandHandler* GetCommandHandlerL( TInt aCommand ); + + /** + * Offers the menu pane to customisations for modification. + */ + IMPORT_C void OfferMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + /** + * Gets a custom preview pane from the appropriate customisation. + */ + IMPORT_C MCalenPreview* CustomPreviewPaneL( TRect& aRect ); + + /** + * Gets a preview pane from the appropriate customisation. + */ + IMPORT_C CCoeControl* PreviewPane( TRect& aRect ); /** * Gets a info bar from the appropriate customisation. */ - HbWidget* Infobar(); - - /** - * Returns info bar text - */ - QString* InfobarTextL(); + IMPORT_C CCoeControl* Infobar( const TRect& aRect ); /** - * Offer the menu to Plugins to customisation - * @param aMenu Where the customisation apply to - */ - void OfferMenu(HbMenu* aHbMenu); - + * Gets a info bar from the appropriate customisation. + */ + IMPORT_C const TDesC& Infobar(); + /** - * Get a command handler for a specific command - * @param aCommand Command to find a command handler for + * Gets settings from the given plugin. + * NOTE: The contents of the array are owned by the caller - caller + * must guarantee to call ResetAndDestroy on the array in all cases. */ - MCalenCommandHandler* GetCommandHandlerL( TInt aCommand ); - - /** - * Returns a reference to an array of active plugins uids - */ - const RArray& ActivePlugins() const; + IMPORT_C void GetPluginSettingsL( TUid aPluginUid, + RPointerArray& aSettingArray ); + + /** + * Returns a reference to an array of active plugins uids + */ + IMPORT_C const RArray& ActivePlugins() const; + + /** + * GetCustomViews returns custom views info in an array for a given + * plugin. + * NOTE: The contents of the array are owned by the caller - caller + * must guarantee to call ResetAndDestroy on the array in all cases. + */ + IMPORT_C void GetCustomViewsL( TUid aPluginUid, + RPointerArray& aViews ); /** * Disables the given plugin. Does nothing if the plugin can't be found. */ - void SetPluginAvailabilityL( TUid aPluginUid, TBool aEnabled ); + IMPORT_C void SetPluginAvailabilityL( TUid aPluginUid, TBool aEnabled ); /** * Returns a const reference to the plugin information array. */ - const RImplInfoPtrArray& PluginInfoArray() const; + IMPORT_C const RImplInfoPtrArray& PluginInfoArray() const; + + /** + * Returns a const reference to the views array. + */ + IMPORT_C const RPointerArray& Views() const; /** * When a plugin is disabled it can not be unloaded until * any views etc it has provided have been deleted. This function * is called when it is safe to unload the plugin. */ - void UnloadPluginsL( const RArray& aPlugins); - + IMPORT_C void UnloadPluginsL( const RArray& aPlugins); + + /** + * Returns ETrue if a view has been hidden by a plugin, + */ + IMPORT_C TBool HiddenView( TUid aHiddenView) const; + + /** + * Returns if a view is provided by a rom based plugin + */ + IMPORT_C TBool IsViewRomBased( TUid aViewUid ) const; + + /** + * Fills the list of views hidden by a particular plugin + */ + IMPORT_C void GetHiddenViewIdL( TUid aPluginUid, RArray& aHiddenViews ); + /** + * Returns plugin view uid that is hidking the input view + */ + IMPORT_C TUid GetReplacePluginViewIdL( TUid aHiddenViewId ); + /** + * Returns if plugin can be enabled/disabled from settings + */ + IMPORT_C TBool CanBeEnabledDisabledL(TUid aPluginUid); + + /** + * Disable all plugins + */ + IMPORT_C void DisableAllPluginsL(); + + /** + * Reload all plugins + */ + IMPORT_C void DoPluginLoadingL(); + public: // from MCalenNotificationHandler void HandleNotification(const TCalenNotification aNotification ); private: // Constructors CCalenCustomisationManager( MCalenServicesFactory& aFactory, - MCalenServices& aServices ); + MCalenServices& aServices, + RPointerArray& aViewArray, + CCalenPluginStatusArray& aPluginSettingsStatus ); void ConstructL(); private: // New functions void LoadPluginL( TUid aPluginUid ); - void DoImmediatePluginLoadingL(); + void DoImmediatePluginLoadingL(); + + void OfferMenuPaneToPluginsL( TInt aResourceId, CEikMenuPane* aMenuPane ); CCalenCustomisation* FindPluginL( TUid aUid ); static TBool PluginAvailabilityFinder( const TUid* aUid, const TCalenPluginAvailability& aArrayItem ); + + static TBool PluginInfoFinder( const TUid* aUid , + const CImplementationInformation& aArrayItem); - void AddPluginL( CCalenCustomisation* aPlugin, TUid aUid ); + void AddPluginL( CCalenCustomisation* aPlugin, TUid aUid ); + RPointerArray& ViewInfoArray(); void CreateActivePluginListL(); - - void LoadPluginsBasedOnVariantL(); void EnablePluginL( TUid aPluginUid ); - void DisablePluginL( TUid aPluginUid ); + void DisablePluginL( TUid aPluginUid ); + + void CheckHiddenViewL( TUid aViewUid, TUid aPluginUid ); void HandleNotificationL(TCalenNotification aNotification); - + + + + /** + * Disable plugin on fake exit + */ + void DisablePluginOnFakeExitL(TUid aPluginUid); + + /* + * Load custom plugins based on the variant + */ + void LoadPluginsBasedOnVariantL(); + + private: /** * Internal class used as a wrapper around a plugin @@ -183,18 +264,41 @@ }; private: // Data - RImplInfoPtrArray iPluginInfo; + MCalenServicesFactory& iServicesFactory; + // takes ownership of the plugins RPointerArray iPlugins; + + // Array of views. Neither the array nor the contents are owned here at any time. + RPointerArray& iViewInfoArray; + RArray iActivePlugins; - RArray iRomBasedPlugins; + RArray iRomBasedPlugins; + + CCalenGlobalData* iGlobalData; + + TLinearOrder iSortOrder; + MCalenServices& iServices; - TUid iInfoBarProviderUid; + + TUid iInfoBarProviderUid; + TUid iPreviewPaneProviderUid; + + RArray iHiddenViews; + + CCalenPluginStatusArray& iPluginSettingsStatus; + TBool iPluginsEnabledDisabled; RArray iDefferedUnloadPluginList; + CCalenSetting* iSetting; + TPtrC iInfoBarStr; + /** + * True if FeatureManager is initialized. + */ + TBool iFeatMgrInitialized; }; #endif // CALENCUSTOMISATIONMANAGER_H