idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h
branchRCL_3
changeset 9 d0529222e3f0
parent 2 b7904b40483f
child 51 15e4dd19031c
--- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h	Tue Feb 02 00:23:10 2010 +0200
+++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugin.h	Fri Feb 19 23:07:29 2010 +0200
@@ -19,277 +19,137 @@
 #ifndef CMCSPLUGIN_H
 #define CMCSPLUGIN_H
 
-#include <aicontentpublisher.h>
-#include <aipropertyextension.h>
+// System includes
+
+// User includes
+#include <hscontentpublisher.h>
 #include <aicontentmodel.h>
-#include <aieventhandlerextension.h>
-#include <centralrepository.h>
-#include "mcspluginwatcher.h"
 
+// Forward declarations
 class MAiContentObserver;
 class MAiContentItemIterator;
 class CMCSPluginEngine;
 class TMCSData;
-//class CMCSPluginData;
-
-//class RAiSettingsItemArray;
 
 /**
- *  @ingroup group_mcsplugin
+ * @ingroup group_mcsplugin
  *
- *  Plug-in main class
+ * MCS Plug-in main class
  *
- *  @since S60 v3.2
+ * @since S60 5.2
  */
-class CMCSPlugin : public CAiContentPublisher,
-                   public MAiPropertyExtension,
-                   public MAiEventHandlerExtension,
-                   public MMCSPluginWatcherObserver
+NONSHARABLE_CLASS( CMCSPlugin ) : public CHsContentPublisher    
+    {
+public:
+    // constructor and destructor
 
-
-    {
-
-public:
-
-    /**
-    * Part of the two phased constuction
-    *
-    * @param none
-    * @return none
-    */
     static CMCSPlugin* NewL();
 
+    ~CMCSPlugin();
+
+private:
+    // constructors
+    
     /**
-     * CompareItems
-     * 
-     * @param aFirst
-     * @param aSecond
-     */
-    static TInt CompareItems(const MAiPluginSettings& aFirst,
-        const MAiPluginSettings& aSecond );
-    /**
-    * Constructor
-    *
-    * @param none
-    * @return none
+    * C++ default constructor
     */
     CMCSPlugin();
-    
-    /**
-    * Destructor
-    *
-    * @param none
-    * @return none
-    */
-    ~CMCSPlugin();
-    
-    /**
-    * Publishes profile names
-    *
-    * @param void
-    * @return void
-    */
-    void PublishL();
 
     /**
-    * From base class MMCSPluginWatcherObserver
-    * .a method for Skin UID cenrep key change handeling
+    * 2nd phase constructor
     */
-    void HandleNotifyL();
-
-// from base class CAiContentPublisher
+    void ConstructL();
+    
+public:
+    // from CHsContentPublisher
   
     /**
-    * From CAiContentPublisher
-    * The method is called by the framework to request the plug-in free all
-    * memory and CPU resources and close all its open files, e.g. the plug-in 
-    * should unload its engines due backup operation. The method transits the 
-    * plug-in to "Idle" state.
-    *
-    * @param aReason reason for state change, see TAiTransitionChange.
-    * @return void
-    */
-    void Stop( TAiTransitionReason aReason );
+     * @see CHsContentPublisher
+     */
+    void Start( TStartReason aReason );
 
     /**
-    * From CAiContentPublisher
-    * The method is called by the framework to instruct plug-in that it is
-    * allowed to consume CPU resources, e.g plug-in is able to run timers,
-    * perform asynchronous operations, etc. The method transits the plug-in
-    * to "Alive" state.
-    *
-    * @param aReason reason for state change, see TAiTransitionChange.
-    * @return void
-    */
-    void Resume( TAiTransitionReason aReason );
+     * @see CHsContentPublisher
+     */
+    void Stop( TStopReason aReason );
 
     /**
-    * From CAiContentPublisher
-    * The method is called by the framework to instruct plug-in that it is
-    * not allowed to consume CPU resources, e.g plug-in MUST stop each
-    * timers, cancel outstanding asynchronous operations, etc. The method
-    * transits the plug-in to "Suspendend" state.
-    *
-    * @param aReason reason for state change, see TAiTransitionChange.
-    * @return void
-    */
-    void Suspend( TAiTransitionReason aReason );
+     * @see CHsContentPublisher
+     */    
+    void Resume( TResumeReason aReason );
 
     /**
-    * From CAiContentPublisher
-    * Adds the content observer / subscriber to plug-in. The plug-in MUST
-    * maintain a registry of subscribers and send notification to all them
-    * whenever the plug-in changes state or new content available.
-    *
-    * @param aObserver content observer to register.
-    * @return void
-    */
-    void SubscribeL( MAiContentObserver& aObserver );
-    
+     * @see CHsContentPublisher
+     */    
+    void Suspend( TSuspendReason aReason );
+
     /**
-    * From CAiContentPublisher
-    * Configures the plug-in.
-    * Plug-ins take ownership of the settings array, so it must either
-    * store it in a member or free it. Framework has put the array in cleanup
-    * stack so the plugin shouldn't do that.
-    * If this leaves, the plug-in will be destroyed by AI FW.
-    * Plug-in must support LaunchByValue-event even if normal shortcuts don't
-    * work. The only allowed serious enough leave is KErrNotFound from CenRep.
-    *
-    * @param aSettings setting items defined in the UI definition.
-    * @return void
-    */
+     * @see CHsContentPublisher
+     */    
+    void SubscribeL( MAiContentObserver& aObserver );
+
+    /**
+     * @see CHsContentPublisher
+     */    
     void ConfigureL( RAiSettingsItemArray& aSettings );
 
     /**
-    * From CAiContentPublisher
-    * Returns interface extension. In Series 60 3.1 only event & property
-    * extensions are supported. See MAiEventExtension & MAiPropertyExtension
-    * interfaces.
-    *
-    * @param  aUid - UID of the extension interface to access.
-    * @return the extension interface. Actual type depends on the passed aUid 
-    *         argument.
-    */
-    TAny* Extension( TUid aUid );  
-
-// from base class MAiPropertyExtension
+     * @see CHsContentPublisher
+     */    
+    TAny* GetProperty( TProperty aProperty );
 
     /**
-    * From MAiPropertyExtension.
-    * Read property of publisher plug-in.
-    *
-    * @param aProperty - identification of property.
-    * @return pointer to property value.
-    */
-    TAny* GetPropertyL( TInt aProperty );
+     * @see CHsContentPublisher
+     */   
+    void HandleEvent( const TDesC& aEventName, const TDesC& aParam );
+    
+public:
+    // new functions
 
     /**
-    * From MAiPropertyExtension.
-    * Write property value.
-    *
-    * @param aProperty - identification of property.
-    * @param aValue - contains pointer to property value.
+    * Publishes data
     */
-    void SetPropertyL( TInt aProperty, TAny* aValue );
-  
- // from base class MAiEventHandlerExtension
-   
-     /**
-     * From MAiEventHandlerExtension
-     * Invoked by the framework when plug-in must handle an event.
-     *
-     * @param aEvent - unique identifier of event from plug-in content model.
-     * @param aParam - parameters associated with event. Each UI Definition
-     *        declares events in the format: <event name>(<event params>),
-     *        where <event name> is mapped by the framework to unique
-     *        identifier supplied in aEvent, <event params> are provided to
-     *        plug-in as-is in the descriptor.
-     * @since S60 3.2
-     */
-    void HandleEvent(TInt aEvent, const TDesC& aParam);
+    void PublishL();
+    
+private:
+    // new functions
     
     /**
-     * From MAiEventHandlerExtension
-     * Invoked by the framework when plug-in must handle an event.
-     *
-     * @param aEventName - name of the event from plug-in content model.
-     * @param aParam - parameters associated with event. Each UI Definition
-     *        declares events in the format: <event name>(<event params>),
-     *        where  <event name> mapping to unique identifier supplied by event 
-     *        is failed by the frame work then the  <event name> and  
-     *        <event params>  are provided to plug-in as-is in the descriptor.
+     * CompareItems
      */
-     void HandleEvent(const TDesC& aEventName, const TDesC& aParam);
-
-protected:
-
-private:
-
-    /**
-    * Part of the two phased construction
-    *
-    * @param void
-    * @return void
-    */
-    void ConstructL();
-    
-    /**
-    * Resume the plug-in.
-    *
-    * @param aReason reason for state change, see TAiTransitionChange.
-    * @return void
-    */    
-    void DoResumeL(TAiTransitionReason aReason);
-    
+    static TInt CompareItems( const MAiPluginSettings& aFirst,
+        const MAiPluginSettings& aSecond );
+          
     /**
      * Publishes content for one menu item
      */
     void PublishLItemL( MAiContentObserver& aObserver, TMCSData& aDataItem, TInt aIndex );
         
     /**
-    * Free the engine
-    *
-    * @param void
-    * @return void
-    */  
-    void FreeEngine();
-
-    /**
     * Delete content model
     */  
     void DeleteContentModel();    
     
-private: // data
-
-    // Iterator for plugin content
-    // Own
-    MAiContentItemIterator* iContent;
-
-    // Number of data in the content model.
-    TInt iDataCount;
-
-    // Dynamic content model
-    // Own.
-    TAiContentItem* iContentModel;
+    /**
+     * Determines if dirty items exists
+     */
+    TBool PublishRequired() const; 
+    
+private: 
+    // data
 
-    // Plugin engine
-    // Own
+    /** Iterator for plugin content, owned */    
+    MAiContentItemIterator* iContent;
+    /** Number of data in the content model */
+    TInt iDataCount;
+    /** Dynamic content model, owned */    
+    TAiContentItem* iContentModel;
+    /** Plugin engine, owned */    
     CMCSPluginEngine* iEngine;
-
-    // Array of content observers
-    // not own
+    /** Array of content observers, not owned */    
     RPointerArray<MAiContentObserver> iObservers;
-
-    // Information about the content publisher (this plug-in)
-    TAiPublisherInfo iInfo;
-
-    // For accessing central repository keys
-    CRepository* iRepository;
-
-    // For observing central repository Skin UID key change 
-    CMCSPluginWatcher* iRepositoryWatcher;
-
     };
 
 #endif // CMCSPLUGIN_H
+
+// End of file