idlefw/plugins/wrtdataplugin/inc/wrtdata.h
changeset 3 ff572005ac23
parent 1 844b978f8d5e
child 9 d0529222e3f0
equal deleted inserted replaced
2:b7904b40483f 3:ff572005ac23
    23 #include <liwcommon.h> 
    23 #include <liwcommon.h> 
    24 #include <AknsItemID.h>
    24 #include <AknsItemID.h>
    25 #include "wrtdatapluginconst.h"
    25 #include "wrtdatapluginconst.h"
    26 #include "aicontentpublisher.h"
    26 #include "aicontentpublisher.h"
    27 
    27 
       
    28 // FORWARD DECLARATIONS
    28 class MLiwInterface;
    29 class MLiwInterface;
    29 class CLiwServiceHandler;
    30 class CLiwServiceHandler;
    30 class CWrtDataObserver;
    31 class CWrtDataObserver;
    31 class CWrtDataPlugin;
    32 class CWrtDataPlugin;
    32 
    33 
       
    34 // CLASS DECLARATION
    33 /**
    35 /**
    34  *  @ingroup group_wrtdataplugin
    36  *  @ingroup group_wrtdataplugin
    35  *
    37  *
    36  *  Wrt data
    38  *  Wrt data
    37  *
    39  *
    38  *  @since S60 v3.2
    40  *  @since S60 v3.2
    39  */
    41  */
    40 class CWrtData : public CBase
    42 class CWrtData : public CBase
    41    {
    43    {
       
    44 
    42    public:
    45    public:
    43 
    46         
    44     /**
    47         /**
    45     * Part of the two phased construction
    48         * Part of the two phased construction
    46     *
    49         *
    47     * @param aPlugin refrence of the plugin
    50         * @param aPlugin refrence of the plugin
    48     * @return none
    51         * @return none
    49     */
    52         */
    50     static CWrtData* NewL(CWrtDataPlugin* aPlugin);
    53         static CWrtData* NewL(CWrtDataPlugin* aPlugin);
       
    54         
       
    55         /**
       
    56         * Destructor
       
    57         *
       
    58         * @param none
       
    59         * @return none
       
    60         */
       
    61         ~CWrtData();
    51     
    62     
    52     /**
    63    public : 
    53     * Destructor
       
    54     *
       
    55     * @param none
       
    56     * @return none
       
    57     */
       
    58     ~CWrtData();
       
    59     
    64     
       
    65         /**
       
    66         * Configures the subscriber and data to subscribe.
       
    67         *  
       
    68         * @param aConfigurations  Information about the subscriber 
       
    69         *  and the data to subscribe.
       
    70         * @return void
       
    71         */
       
    72         void ConfigureL(RAiSettingsItemArray& aConfigurations);
       
    73      
       
    74         /**
       
    75         * Checks is this menu item is supported by the publisher
       
    76         * 
       
    77         * @param aMenuItem  menu item name.
       
    78         * @return  boolean (ETrue/EFalse) 
       
    79         */
       
    80         TBool HasMenuItem(const TDesC16& aMenuItem );
       
    81 
       
    82         /**
       
    83         * Register to CPS for all (add/delete/update/execute) action
       
    84         * 
       
    85         * @param none
       
    86         * @return void
       
    87         */
       
    88         void RegisterL();
       
    89         
       
    90        /**
       
    91         * Update the publisher status 
       
    92         * 
       
    93         * @param None
       
    94         * @return void
       
    95         */
       
    96         void UpdatePublisherStatusL();     
       
    97               
       
    98         /**
       
    99         * Publish updated data for all the items in the widget
       
   100         *     
       
   101         * @param aObserver to publish data
       
   102         * @return void
       
   103         */
       
   104         void PublishDefaultImageL( MAiContentObserver* aObserver );
       
   105                 
       
   106         /**
       
   107         * Publish the updated data
       
   108         *   
       
   109         * @param aObserver to publish data
       
   110         * @param aDataMap data map
       
   111         * @return void
       
   112         */
       
   113         void PublishL( MAiContentObserver* aObserver, CLiwDefaultMap* aDataMap );
       
   114         
       
   115         /**
       
   116         * Called by the observer to refresh the changed content
       
   117         *   
       
   118         * @param aContentId content Id.
       
   119         * @param aOperation operation (add/delete/update/execute).
       
   120         * @param aDataMap data map.
       
   121         * @return void
       
   122         */
       
   123         void RefreshL( TDesC& aContentId, TDesC& aOperation, CLiwDefaultMap* aDataMap );
       
   124                 
       
   125         /**
       
   126         * Tigger for execution of a action for a specific content id.
       
   127         * 
       
   128         * @param aObjectId object Id.
       
   129         * @param aTrigger name of the trigger.
       
   130         * @return void
       
   131         */
       
   132         void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger);
       
   133 
       
   134         /**
       
   135         * Is the pugin is active to publish the data.
       
   136         * 
       
   137         * @param None
       
   138         * @return boolean (ETrue/EFalse).
       
   139         */
       
   140         TBool IsPluginActive();
       
   141 
       
   142         /**
       
   143         * Activate the publisher
       
   144         * 
       
   145         * @param None
       
   146         * @return void
       
   147         */
       
   148         void ActivateL();
       
   149                  
       
   150         /**
       
   151         * Resume the publisher
       
   152         * 
       
   153         * @param None
       
   154         * @return void
       
   155         */
       
   156         void ResumeL();
       
   157         
       
   158         /**
       
   159         * Suspend the publisher
       
   160         * 
       
   161         * @param None
       
   162         * @return void
       
   163         */
       
   164         void SuspendL();
       
   165         
       
   166         /**
       
   167         * Deactivate the publisher
       
   168         * 
       
   169         * @param None
       
   170         * @return void
       
   171         */
       
   172         void DeActivateL();
       
   173         
       
   174         /**
       
   175         * InActiveL 
       
   176         * 
       
   177         * @param None
       
   178         * @return void
       
   179         */
       
   180         void InActiveL();        
       
   181         
       
   182         /**
       
   183         * OnLineL 
       
   184         * 
       
   185         * @param None
       
   186         * @return void
       
   187         */
       
   188         void OnLineL();
       
   189         
       
   190         /**
       
   191         * OffLineL 
       
   192         * 
       
   193         * @param None
       
   194         * @return void
       
   195         */
       
   196         void OffLineL();
       
   197 
    60    private :
   198    private :
    61     
   199     
    62     /**
   200         /**
    63     * Constructor
   201         * Default Constructor
    64     *
   202         *
    65     * @param none
   203         */
    66     * @return none
   204         CWrtData();
    67     */
   205         
    68     CWrtData();
   206         /**
    69    
   207         * Part of the two phased construction
       
   208         *
       
   209         * @param aPlugin reference of the plugin
       
   210         * @return void
       
   211         */
       
   212         void ConstructL(CWrtDataPlugin* aPlugin);
       
   213          
       
   214         /**
       
   215         * Createts the filter map
       
   216         * 
       
   217         * @return filter map
       
   218         */
       
   219         CLiwDefaultMap* CreateFilterLC( );
       
   220           
       
   221         /**
       
   222         * Execute the command to get the data from CPS
       
   223         * 
       
   224         * @param aInFilter input filter for the command
       
   225         * @param aOutDataMap output data map 
       
   226         * @param aRegistry type of registry (publisher/cp_data)
       
   227         * @return void 
       
   228         */
       
   229         void ExecuteCommandL(CLiwDefaultMap* aInFilter, 
       
   230                 CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry );
       
   231        
       
   232 
       
   233         /**
       
   234         * Change the publisher status
       
   235         *
       
   236         * @param aStatus new status of the publisher
       
   237         * @return void
       
   238         */
       
   239         void ChangePublisherStatusL(const TDesC& aStatus);
       
   240         
       
   241         /**
       
   242         * Gets the menu item from the publisher
       
   243         *
       
   244         * @param none
       
   245         * @return void
       
   246         */
       
   247         void GetMenuItemsL();
       
   248         
       
   249         /**
       
   250         * Gets the widgent name and uid 
       
   251         *
       
   252         * @param aName  - widget name
       
   253         * @param aAppUID - widget uid
       
   254         * @return void
       
   255         */
       
   256         void GetWidgetNameAndUidL(TDes& aName, TDes& aAppUID );
       
   257         
       
   258         /**
       
   259         * Resolves the Uid from the string  
       
   260         *
       
   261         * @param aUidDes  - uid in string
       
   262         * @param aUid - uid
       
   263         * @return ETure/EFalse
       
   264         */ 
       
   265         TBool ResolveUid(const TDesC& aUidDes, TUid& aUid );
       
   266         
       
   267         /**
       
   268         * Creates icon from the uid
       
   269         *
       
   270         * @param aHandle  - icon handle
       
   271         * @param aMaskHandle - mask handle
       
   272         * @param aAppUid - application uid
       
   273         * @return ETure/EFalse
       
   274         */   
       
   275         void CreateIconFromUidL(TInt& aHandle, TInt& aMaskHandle, const TUid& aAppUid );
       
   276 
       
   277     private :   
       
   278         
       
   279         // Subscriber interface
       
   280         // own
       
   281         MLiwInterface* iInterface;
       
   282           
       
   283         // Data Observer to CPS
       
   284         // Own
       
   285         CWrtDataObserver* iObserver;
       
   286        
       
   287         // Service handler 
       
   288         // Own
       
   289         CLiwServiceHandler* iServiceHandler;
    70     
   290     
    71     /**
   291         // Command name in configuration Array
    72     * Part of the two phased construction
   292         HBufC8* iCommandName;
    73     *
   293           
    74     * @param aPlugin reference of the plugin
   294         // Reference of the wrt data plugin
    75     * @return void
   295         // Not owned
    76     */
   296         CWrtDataPlugin* iPlugin;
    77     void ConstructL(CWrtDataPlugin* aPlugin);
   297         
    78    
   298         // Menu item names
    79     /**
   299         // Own
    80     * Change the publisher status
   300         RPointerArray<HBufC16> iMenuItems; 
    81     *
   301         
    82     * @param aStatus new status of the publisher
   302         // Trigger names for the menu items
    83     * @return void
   303         // Own
    84     */
   304         RPointerArray<HBufC8> iMenuTriggers;
    85     void ChangePublisherStatusL(const TDesC& aStatus);
   305         
    86     
   306         // Widgets content id.
    87     /**
   307         // Own
    88     * Gets the menu item from the publisher
   308         HBufC* iContentId;
    89     *
   309  
    90     * @param none
       
    91     * @return void
       
    92     */
       
    93     void GetMenuItemsL();
       
    94     
       
    95    public :
       
    96     
       
    97     /**
       
    98     * Configures the subscriber and data to subscribe.
       
    99     *  
       
   100     * @param aConfigurations  Information about the subscriber 
       
   101     *  and the data to subscribe.
       
   102     * @return void
       
   103     */
       
   104     void ConfigureL(RAiSettingsItemArray& aConfigurations);
       
   105     
       
   106     /**
       
   107     * Publish updated data for all the items in the widget
       
   108     *     
       
   109     * @param aObserver to publish data
       
   110     * @return void
       
   111     */
       
   112     void PublishAllL( MAiContentObserver* aObserver );
       
   113     
       
   114     /**
       
   115 	* Execute the command to get the data from CPS
       
   116 	* 
       
   117 	* @param aInFilter input filter for the command
       
   118 	* @param aOutDataMap output data map 
       
   119 	* @param aRegistry type of registry (publisher/cp_data)
       
   120 	* @return void 
       
   121 	*/
       
   122     void ExecuteCommandL(CLiwDefaultMap* aInFilter, 
       
   123     		CLiwDefaultMap* aOutDataMap, const TDesC16& aRegistry );
       
   124    
       
   125     /**
       
   126 	* Checks is this menu item is supported by the publisher
       
   127 	* 
       
   128 	* @param aMenuItem  menu item name.
       
   129 	* @return  boolean (ETrue/EFalse) 
       
   130 	*/
       
   131     TBool HasMenuItem(const TDesC16& aMenuItem );
       
   132     
       
   133     /**
       
   134     * Publish the updated data
       
   135     *   
       
   136     * @param aObserver to publish data
       
   137     * @return void
       
   138     */
       
   139     void PublishL( MAiContentObserver* aObserver );
       
   140     
       
   141     /**
       
   142     * Tigger for execution of a action for a specific content id.
       
   143     * 
       
   144     * @param aObjectId object Id.
       
   145     * @param aTrigger name of the trigger.
       
   146     * @return void
       
   147     */
       
   148     void ExecuteActionL(const TDesC& aObjectId, const TDesC& aTrigger);
       
   149      
       
   150     /**
       
   151     * Register to CPS for all (add/delete/update/execute) action
       
   152     * 
       
   153     * @param none
       
   154     * @return void
       
   155     */
       
   156     void RegisterL();
       
   157      
       
   158     /**
       
   159     * Called by the observer to refresh the changed content
       
   160     *   
       
   161     * @param aPublisher  publisher.
       
   162     * @param aContentType  content type.
       
   163     * @param aContentId content Id.
       
   164     * @param aOperation operation (add/delete/update/execute).
       
   165     * @return void
       
   166     */
       
   167     void RefreshL( TDesC& aPublisher, TDesC& aContentType, 
       
   168             TDesC& aContentId, TDesC& aOperation );
       
   169      
       
   170     /**
       
   171     * Createts the filter map
       
   172     * 
       
   173     * @return filter map
       
   174     */
       
   175     CLiwDefaultMap* CreateFilterLC( );
       
   176       
       
   177     /**
       
   178     * Is the pugin is active to publish the data.
       
   179     * 
       
   180     * @param None
       
   181     * @return boolean (ETrue/EFalse).
       
   182     */
       
   183     TBool IsPluginActive();
       
   184      
       
   185     /**
       
   186     * Resume the publisher
       
   187     * 
       
   188     * @param None
       
   189     * @return void
       
   190     */
       
   191     void ResumeL();
       
   192     
       
   193     /**
       
   194 	* Suspend the publisher
       
   195 	* 
       
   196 	* @param None
       
   197 	* @return void
       
   198 	*/
       
   199     void SuspendL();
       
   200     
       
   201     /**
       
   202 	* Activate the publisher
       
   203 	* 
       
   204 	* @param None
       
   205 	* @return void
       
   206 	*/
       
   207     void ActivateL();
       
   208     
       
   209     /**
       
   210 	* Deactivate the publisher
       
   211 	* 
       
   212 	* @param None
       
   213 	* @return void
       
   214 	*/
       
   215     void DeActivateL();
       
   216     
       
   217     /**
       
   218 	* OnLineL 
       
   219 	* 
       
   220 	* @param None
       
   221 	* @return void
       
   222 	*/
       
   223     void OnLineL();
       
   224     
       
   225     /**
       
   226 	* OffLineL 
       
   227 	* 
       
   228 	* @param None
       
   229 	* @return void
       
   230 	*/
       
   231     void OffLineL();
       
   232     
       
   233     /**
       
   234    	* InActiveL 
       
   235    	* 
       
   236    	* @param None
       
   237    	* @return void
       
   238    	*/
       
   239     void InActiveL();
       
   240     
       
   241     /**
       
   242 	* Update the publisher status 
       
   243 	* 
       
   244 	* @param None
       
   245 	* @return void
       
   246 	*/
       
   247     void UpdatePublisherStatusL();
       
   248     
       
   249     /**
       
   250     * Resolves skin item id and Mif id from pattern 
       
   251     * skin( <majorId> <minorId> (<colourGroupId>) 
       
   252     * mif(<MifFileName.mif> <bitmapId> <maskId>)
       
   253     * 
       
   254     * @param aPath  skin pattern / mif pattern value
       
   255     * @param aItemId skin item id  
       
   256     * @param aMifId  mif id 
       
   257     * @param aMaskId  mask id 
       
   258     * @param aFilename mif file name
       
   259     * @return boolean (ETrue/EFalse)  
       
   260     */
       
   261     TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId,
       
   262     		TInt& aMifId, TInt& aMaskId, TDes& aFilename );
       
   263 
       
   264     private :   
       
   265     
       
   266     // Subscriber interface
       
   267     // own
       
   268     MLiwInterface* iInterface;
       
   269       
       
   270     // Data Observer to CPS
       
   271     // Own
       
   272     CWrtDataObserver* iObserver;
       
   273    
       
   274     // Service handler 
       
   275     // Own
       
   276     CLiwServiceHandler* iServiceHandler;
       
   277 
       
   278     // Command name in configuration Array
       
   279     HBufC8* iCommandName;
       
   280       
       
   281     // Reference of the wrt data plugin
       
   282     // Not owned
       
   283     CWrtDataPlugin* iPlugin;
       
   284     
       
   285     // Menu item names
       
   286     // Own
       
   287     RPointerArray<HBufC16> iMenuItems; 
       
   288     
       
   289     // Trigger names for the menu items
       
   290     // Own
       
   291     RPointerArray<HBufC8> iMenuTriggers;
       
   292     
       
   293     HBufC* iContentId;
       
   294     };
   310     };
   295 
   311 
   296 #endif /*WRTDATA_H*/
   312 #endif /*WRTDATA_H*/