idlefw/plugins/wrtdataplugin/inc/wrtdata.h
branchRCL_3
changeset 15 a0713522ab97
parent 8 d0529222e3f0
child 16 b276298d5729
equal deleted inserted replaced
14:15e4dd19031c 15:a0713522ab97
    30 // Forward declarations
    30 // Forward declarations
    31 class MLiwInterface;
    31 class MLiwInterface;
    32 class CLiwServiceHandler;
    32 class CLiwServiceHandler;
    33 class CWrtDataObserver;
    33 class CWrtDataObserver;
    34 class CWrtDataPlugin;
    34 class CWrtDataPlugin;
       
    35 class MAiCpsCommandBuffer;
    35 
    36 
    36 /**
    37 /**
    37  *  @ingroup group_wrtdataplugin
    38  *  @ingroup group_wrtdataplugin
    38  *
    39  *
    39  *  Wrt data
    40  *  Wrt data
    41  *  @since S60 5.2
    42  *  @since S60 5.2
    42  */
    43  */
    43 NONSHARABLE_CLASS( CWrtData ) : public CBase
    44 NONSHARABLE_CLASS( CWrtData ) : public CBase
    44     {    
    45     {    
    45 public:
    46 public:
    46     // constructor and destructor
    47     
    47     
    48     /**
       
    49     * Part of the two phased constuction
       
    50     *
       
    51     * @param none
       
    52     * @return none
       
    53     */
    48     static CWrtData* NewL( CWrtDataPlugin* aPlugin );
    54     static CWrtData* NewL( CWrtDataPlugin* aPlugin );
    49 
    55     
       
    56     /*
       
    57     * Destructor  
       
    58     */
    50     ~CWrtData();
    59     ~CWrtData();
    51     
    60 
    52    public : 
    61 private :
    53     
    62 
    54         /**
    63     /**
    55         * Configures the subscriber and data to subscribe.
    64     * Default Constructor
    56         *  
    65     *
    57         * @param aConfigurations  Information about the subscriber 
    66     */
    58         *  and the data to subscribe.
    67     CWrtData();
    59         * @return void
    68     
    60         */
    69     /**
    61         void ConfigureL(RAiSettingsItemArray& aConfigurations);
    70     * Part of the two phased construction
       
    71     *
       
    72     * @param aPlugin reference of the plugin
       
    73     * @return void
       
    74     */
       
    75     void ConstructL(CWrtDataPlugin* aPlugin);
       
    76     
       
    77 public : 
       
    78     // new functions 
       
    79     
       
    80     /**
       
    81     * Configures the subscriber and data to subscribe.
       
    82     *  
       
    83     * @param aConfigurations  Information about the subscriber 
       
    84     *  and the data to subscribe.
       
    85     * @return void
       
    86     */
       
    87     void ConfigureL(RAiSettingsItemArray& aConfigurations);
       
    88  
       
    89     /**
       
    90     * Checks is this menu item is supported by the publisher
       
    91     * 
       
    92     * @param aMenuItem  menu item name.
       
    93     * @return  boolean (ETrue/EFalse) 
       
    94     */
       
    95     TBool HasMenuItem(const TDesC16& aMenuItem );
       
    96 
       
    97     /**
       
    98     * Register to CPS for all (add/delete/update/execute) action
       
    99     * 
       
   100     * @param none
       
   101     * @return void
       
   102     */
       
   103     void RegisterL();
       
   104     
       
   105    /**
       
   106     * Update the publisher status 
       
   107     * 
       
   108     * @param None
       
   109     * @return void
       
   110     */
       
   111     void UpdatePublisherStatusL();     
       
   112           
       
   113     /**
       
   114     * Publish updated data for all the items in the widget
       
   115     *     
       
   116     * @param aObserver to publish data
       
   117     * @return void
       
   118     */
       
   119     void PublishDefaultImageL( MAiContentObserver* aObserver );
       
   120             
       
   121     /**
       
   122     * Publish the updated data
       
   123     *   
       
   124     * @param aObserver to publish data
       
   125     * @param aDataMap data map
       
   126     * @return void
       
   127     */
       
   128     void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap );
       
   129     
       
   130     /**
       
   131     * Called by the observer to refresh the changed content
       
   132     *   
       
   133     * @param aContentId content Id.
       
   134     * @param aOperation operation (add/delete/update/execute).
       
   135     * @param aDataMap data map.
       
   136     * @return void
       
   137     */
       
   138     void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap );
       
   139             
       
   140     /**
       
   141     * Tigger for execution of a action for a specific content id.
       
   142     * 
       
   143     * @param aObjectId object Id.
       
   144     * @param aTrigger name of the trigger.
       
   145     * @return void
       
   146     */
       
   147     void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger);
       
   148 
       
   149     /**
       
   150     * Is the pugin is active to publish the data.
       
   151     * 
       
   152     * @param None
       
   153     * @return boolean (ETrue/EFalse).
       
   154     */
       
   155     TBool IsPluginActive();
       
   156 
       
   157     /**
       
   158     * Notify the status to the publisher
       
   159     *
       
   160     * @param aStatus new status of the publisher
       
   161     * @return void
       
   162     */
       
   163     void NotifyPublisherL(const TDesC8& aStatus);
       
   164     
       
   165     /**
       
   166     * Sets property value.
       
   167     *
       
   168     * @since S60 5.2
       
   169     * @param aAny - contains pointer to command buffer.
       
   170     * @param aNameSpace - plugin name space id
       
   171     */
       
   172     void SetCommandBuffer(TAny* aAny, const TDesC8& aNameSpace);
       
   173     
       
   174 private: 
       
   175     // new functions
    62      
   176      
    63         /**
   177     /**
    64         * Checks is this menu item is supported by the publisher
   178     * Createts the filter map
    65         * 
   179     * 
    66         * @param aMenuItem  menu item name.
   180     * @return filter map
    67         * @return  boolean (ETrue/EFalse) 
   181     */
    68         */
   182     CLiwDefaultMap* CreateFilterLC( );
    69         TBool HasMenuItem(const TDesC16& aMenuItem );
   183       
    70 
   184     /**
    71         /**
   185     * Execute the command to get the data from CPS
    72         * Register to CPS for all (add/delete/update/execute) action
   186     * 
    73         * 
   187     * @param aInFilter input filter for the command
    74         * @param none
   188     * @param aOutDataMap output data map 
    75         * @return void
   189     * @param aRegistry type of registry (publisher/cp_data)
    76         */
   190     * @return void 
    77         void RegisterL();
   191     */
    78         
   192     void ExecuteCommandL(CLiwDefaultMap* aInFilter, 
    79        /**
   193             CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry );
    80         * Update the publisher status 
   194    
    81         * 
   195     /**
    82         * @param None
   196     * Gets the menu item from the publisher
    83         * @return void
   197     *
    84         */
   198     * @param none
    85         void UpdatePublisherStatusL();     
   199     * @return void
    86               
   200     */
    87         /**
   201     void GetMenuItemsL();
    88         * Publish updated data for all the items in the widget
   202     
    89         *     
   203     /**
    90         * @param aObserver to publish data
   204     * Gets the widgent name and uid 
    91         * @return void
   205     *
    92         */
   206     * @param aName  - widget name
    93         void PublishDefaultImageL( MAiContentObserver* aObserver );
   207     * @param aAppUID - widget uid
    94                 
   208     * @return void
    95         /**
   209     */
    96         * Publish the updated data
   210     void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID );
    97         *   
   211     
    98         * @param aObserver to publish data
   212     /**
    99         * @param aDataMap data map
   213     * Resolves the Uid from the string  
   100         * @return void
   214     *
   101         */
   215     * @param aUidDes  - uid in string
   102         void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap );
   216     * @param aUid - uid
   103         
   217     * @return ETure/EFalse
   104         /**
   218     */ 
   105         * Called by the observer to refresh the changed content
   219     TBool ResolveUid(const TDesC& aUidDes, TUid& aUid );
   106         *   
   220     
   107         * @param aContentId content Id.
   221     /**
   108         * @param aOperation operation (add/delete/update/execute).
   222     * Creates icon from the uid
   109         * @param aDataMap data map.
   223     *
   110         * @return void
   224     * @param aHandle  - icon handle
   111         */
   225     * @param aMaskHandle - mask handle
   112         void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap );
   226     * @param aAppUid - application uid
   113                 
   227     * @return ETure/EFalse
   114         /**
   228     */   
   115         * Tigger for execution of a action for a specific content id.
   229     void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid );
   116         * 
   230 
   117         * @param aObjectId object Id.
   231     /**
   118         * @param aTrigger name of the trigger.
   232     * Resend the the current plugin status to publisher 
   119         * @return void
   233     *
   120         */
   234     * @param aActionsList new list of status for the publisher
   121         void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger);
   235     * @return void
   122 
   236     */
   123         /**
   237     void ReSendNotificationL(CLiwDefaultList* aActionsList);
   124         * Is the pugin is active to publish the data.
   238             
   125         * 
   239 private :   
   126         * @param None
       
   127         * @return boolean (ETrue/EFalse).
       
   128         */
       
   129         TBool IsPluginActive();
       
   130 
       
   131         /**
       
   132         * Activate the publisher
       
   133         * 
       
   134         * @param None
       
   135         * @return void
       
   136         */
       
   137         void ActivateL();
       
   138                  
       
   139         /**
       
   140         * Resume the publisher
       
   141         * 
       
   142         * @param None
       
   143         * @return void
       
   144         */
       
   145         void ResumeL();
       
   146         
       
   147         /**
       
   148         * Suspend the publisher
       
   149         * 
       
   150         * @param None
       
   151         * @return void
       
   152         */
       
   153         void SuspendL();
       
   154         
       
   155         /**
       
   156         * Deactivate the publisher
       
   157         * 
       
   158         * @param None
       
   159         * @return void
       
   160         */
       
   161         void DeActivateL();      
       
   162         
       
   163         /**
       
   164         * OnLineL 
       
   165         * 
       
   166         * @param None
       
   167         * @return void
       
   168         */
       
   169         void OnLineL();
       
   170         
       
   171         /**
       
   172         * OffLineL 
       
   173         * 
       
   174         * @param None
       
   175         * @return void
       
   176         */
       
   177         void OffLineL();
       
   178 
       
   179    private :
       
   180     
       
   181         /**
       
   182         * Default Constructor
       
   183         *
       
   184         */
       
   185         CWrtData();
       
   186         
       
   187         /**
       
   188         * Part of the two phased construction
       
   189         *
       
   190         * @param aPlugin reference of the plugin
       
   191         * @return void
       
   192         */
       
   193         void ConstructL(CWrtDataPlugin* aPlugin);
       
   194          
       
   195         /**
       
   196         * Createts the filter map
       
   197         * 
       
   198         * @return filter map
       
   199         */
       
   200         CLiwDefaultMap* CreateFilterLC( );
       
   201           
       
   202         /**
       
   203         * Execute the command to get the data from CPS
       
   204         * 
       
   205         * @param aInFilter input filter for the command
       
   206         * @param aOutDataMap output data map 
       
   207         * @param aRegistry type of registry (publisher/cp_data)
       
   208         * @return void 
       
   209         */
       
   210         void ExecuteCommandL(CLiwDefaultMap* aInFilter, 
       
   211                 CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry );
       
   212        
       
   213 
       
   214         /**
       
   215         * Change the publisher status
       
   216         *
       
   217         * @param aStatus new status of the publisher
       
   218         * @return void
       
   219         */
       
   220         void ChangePublisherStatusL(const TDesC& aStatus);
       
   221         
       
   222         /**
       
   223         * Gets the menu item from the publisher
       
   224         *
       
   225         * @param none
       
   226         * @return void
       
   227         */
       
   228         void GetMenuItemsL();
       
   229         
       
   230         /**
       
   231         * Gets the widgent name and uid 
       
   232         *
       
   233         * @param aName  - widget name
       
   234         * @param aAppUID - widget uid
       
   235         * @return void
       
   236         */
       
   237         void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID );
       
   238         
       
   239         /**
       
   240         * Resolves the Uid from the string  
       
   241         *
       
   242         * @param aUidDes  - uid in string
       
   243         * @param aUid - uid
       
   244         * @return ETure/EFalse
       
   245         */ 
       
   246         TBool ResolveUid(const TDesC& aUidDes, TUid& aUid );
       
   247         
       
   248         /**
       
   249         * Creates icon from the uid
       
   250         *
       
   251         * @param aHandle  - icon handle
       
   252         * @param aMaskHandle - mask handle
       
   253         * @param aAppUid - application uid
       
   254         * @return ETure/EFalse
       
   255         */   
       
   256         void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid );
       
   257 
       
   258     private :   
       
   259     // data
   240     // data
   260     
   241     TBuf<KHsPublisherNamespaceMaxLength> iPluginId;
       
   242     /** CPS Command Buffer Interface, Not Owned */
       
   243     MAiCpsCommandBuffer* iCpsExecute;
   261     /** Subscriber interface, owned */    
   244     /** Subscriber interface, owned */    
   262     MLiwInterface* iInterface;     
   245     MLiwInterface* iInterface;     
   263     /** Data Observer to CPS, owned */
   246     /** Data Observer to CPS, owned */
   264     CWrtDataObserver* iObserver;   
   247     CWrtDataObserver* iObserver;   
   265     /** Service handler, owned */    
   248     /** Service handler, owned */