idlefw/plugins/sapidataplugin/inc/sapidata.h
branchRCL_3
changeset 8 d0529222e3f0
parent 1 844b978f8d5e
child 11 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 8:d0529222e3f0
    17 
    17 
    18 
    18 
    19 #ifndef SAPIDATA_H
    19 #ifndef SAPIDATA_H
    20 #define SAPIDATA_H
    20 #define SAPIDATA_H
    21 
    21 
    22 // INCLUDE FILES
    22 // System includes
    23 #include <liwcommon.h> 
    23 #include <liwcommon.h> 
    24 #include <AknsItemID.h>
    24 #include <AknsItemID.h>
    25 #include <aieventhandlerextension.h>
    25 
       
    26 // User includes
       
    27 #include <hscontentpublisher.h>
    26 #include "sapidatapluginconst.h"
    28 #include "sapidatapluginconst.h"
    27 #include "aicontentpublisher.h"
    29 
    28 
    30 // Forward declarations
    29 class MLiwInterface;
    31 class MLiwInterface;
    30 class CLiwServiceHandler;
    32 class CLiwServiceHandler;
    31 class CSapiDataObserver;
    33 class CSapiDataObserver;
    32 class CSapiDataPlugin;
    34 class CSapiDataPlugin;
    33 
    35 class MAiContentObserver;
    34 
    36 
    35 class CContentItem :  public CBase
    37 /**
       
    38  *  @ingroup group_sapidataplugin
       
    39  *
       
    40  *  Content item
       
    41  *
       
    42  *  @since S60 5.0
       
    43  */
       
    44 NONSHARABLE_CLASS( CContentItem ) : public CBase
    36 	{
    45 	{
    37 	public :
    46 public:
    38 
    47 
    39 	/**
    48 	/**
    40 	* Part of the two phased constuction
    49 	* Part of the two phased constuction
    41 	*
    50 	*
    42 	* @param none
    51 	* @param none
    43 	* @return none
    52 	* @return none
    44 	*/
    53 	*/
    45 	static CContentItem* NewL();
    54 	static CContentItem* NewL();
    46 
       
    47 	
    55 	
    48 	/*
    56 	/*
    49 	* Destructor  
    57 	* Destructor  
    50 	*/
    58 	*/
    51 	~CContentItem();
    59 	~CContentItem();
    52 
    60 
    53 	private :
    61 private:
    54 		
    62 		
    55 	/* 
    63 	/* 
    56 	* Constructor  
    64 	* Constructor  
    57 	*/
    65 	*/
    58 		CContentItem();   
    66     CContentItem();   
    59 	
    67 	
    60 	/**
    68 	/**
    61 	* Part of the two phased construction
    69 	* Part of the two phased construction
    62 	*
    70 	*
    63 	* @param none
    71 	* @param none
    64 	* @return void
    72 	* @return void
    65 	*/
    73 	*/
    66 	void ConstructL();
    74 	void ConstructL();
    67 
    75 
    68 	public :
    76 public:
    69 
    77 
    70     TInt iId;
    78     TInt iId;
    71 	/* item id */
    79 	/* item id */
    72 	HBufC* iName;
    80 	HBufC* iName;
    73 	/* type (image/text) */
    81 	/* type (image/text) */
    79 /**
    87 /**
    80  *  @ingroup group_sapidataplugin
    88  *  @ingroup group_sapidataplugin
    81  *
    89  *
    82  *  Sapi data
    90  *  Sapi data
    83  *
    91  *
    84  *  @since S60 v3.2
    92  *  @since S60 5.0
    85  */
    93  */
    86 class CSapiData : public CBase
    94 NONSHARABLE_CLASS( CSapiData ) : public CBase
    87    {
    95    {
    88    public:
    96 public:
    89  
    97     // constructor and destructor
       
    98     
    90     /**
    99     /**
    91     * Part of the two phased construction
   100     * Part of the two phased construction
    92     *
   101     *
    93     * @param aPlugin refrence of the plugin
   102     * @param aPlugin refrence of the plugin
    94     * @return none
   103     * @return none
   101     * @param none
   110     * @param none
   102     * @return none
   111     * @return none
   103     */
   112     */
   104     ~CSapiData();
   113     ~CSapiData();
   105     
   114     
   106    private :
   115 private:
   107 
   116     // constructors
   108 
   117     
   109     /**
   118     /**
   110     * Constructor
   119     * Constructor
   111     *
   120     *
   112     * @param none
   121     * @param none
   113     * @return none
   122     * @return none
   114     */
   123     */
   115     CSapiData();
   124     CSapiData();
   116    
   125        
   117     
       
   118     /**
   126     /**
   119     * Part of the two phased construction
   127     * Part of the two phased construction
   120     *
   128     *
   121     * @param aPlugin reference of the plugin
   129     * @param aPlugin reference of the plugin
   122     * @return void
   130     * @return void
   123     */
   131     */
   124     void ConstructL(CSapiDataPlugin* aPlugin);
   132     void ConstructL(CSapiDataPlugin* aPlugin);
   125    
   133 
       
   134     // new functions
       
   135 
       
   136     /**
       
   137     * Gets the menu item from the publisher
       
   138     *
       
   139     * @param none
       
   140     * @return void
       
   141     */
       
   142     void GetMenuItemsL();
       
   143     
       
   144 public:
       
   145     // new functions
       
   146     
   126     /**
   147     /**
   127     * Change the publisher status
   148     * Change the publisher status
   128     *
   149     *
   129     * @param aStatus new status of the publisher
   150     * @param aStatus new status of the publisher
   130     * @return void
   151     * @return void
   131     */
   152     */
   132     void ChangePublisherStatusL(const TDesC& aStatus);
   153     void ChangePublisherStatusL(const TDesC& aStatus);
   133     
       
   134     /**
       
   135     * Gets the menu item from the publisher
       
   136     *
       
   137     * @param none
       
   138     * @return void
       
   139     */
       
   140     void GetMenuItemsL();
       
   141     
       
   142    public :
       
   143     
   154     
   144     /**
   155     /**
   145     * Configures the subscriber and data to subscribe.
   156     * Configures the subscriber and data to subscribe.
   146     *  
   157     *  
   147     * @param aConfigurations  Information about the subscriber 
   158     * @param aConfigurations  Information about the subscriber 
   148     *  and the data to subscribe.
   159     *  and the data to subscribe.
   149     * @return void
   160     * @return void
   150     */
   161     */
   151     void ConfigureL(RAiSettingsItemArray& aConfigurations);
   162     void ConfigureL(RAiSettingsItemArray& aConfigurations);
   152     
   163     
       
   164     /**
       
   165      * Sets content id
       
   166      * 
       
   167      * @param aId Content id
       
   168      */
   153     void SetContentIdL(const TDesC8& aId);
   169     void SetContentIdL(const TDesC8& aId);
       
   170     
       
   171     /**
       
   172      * Sets startup reason, which will be communicated to CPS client
       
   173      * in the case of late registration.
       
   174      * 
       
   175      * @param aStartupReason A reason
       
   176      */
       
   177     void SetStartupReasonL(const TDesC& aStartupReason);
   154     
   178     
   155     /**
   179     /**
   156 	* Execute the command to get the data from CPS
   180 	* Execute the command to get the data from CPS
   157 	*
   181 	*
   158 	* @param aRegistry type of registry (publisher/cp_data) 
   182 	* @param aRegistry type of registry (publisher/cp_data) 
   276     * 
   300     * 
   277     * @param None
   301     * @param None
   278     * @return boolean (ETrue/EFalse).
   302     * @return boolean (ETrue/EFalse).
   279     */
   303     */
   280     TBool IsPluginActive();
   304     TBool IsPluginActive();
   281      
       
   282     /**
       
   283     * Resume the publisher
       
   284     * 
       
   285     * @param None
       
   286     * @return void
       
   287     */
       
   288     void ResumeL();
       
   289     
       
   290     /**
       
   291 	* Suspend the publisher
       
   292 	* 
       
   293 	* @param None
       
   294 	* @return void
       
   295 	*/
       
   296     void SuspendL();
       
   297     
       
   298     /**
       
   299 	* Activate the publisher
       
   300 	* 
       
   301 	* @param None
       
   302 	* @return void
       
   303 	*/
       
   304     void ActivateL();
       
   305     
       
   306     /**
       
   307 	* Deactivate the publisher
       
   308 	* 
       
   309 	* @param None
       
   310 	* @return void
       
   311 	*/
       
   312     void DeActivateL();
       
   313     
       
   314     /**
       
   315 	* OnLineL 
       
   316 	* 
       
   317 	* @param None
       
   318 	* @return void
       
   319 	*/
       
   320     void OnLineL();
       
   321     
       
   322     /**
       
   323 	* OffLineL 
       
   324 	* 
       
   325 	* @param None
       
   326 	* @return void
       
   327 	*/
       
   328     void OffLineL();
       
   329     
       
   330     /**
       
   331 	* InActiveL 
       
   332 	* 
       
   333 	* @param None
       
   334 	* @return void
       
   335 	*/
       
   336 	void InActiveL();
       
   337 	
   305 	
   338     /**
   306     /**
   339 	* Update the publisher status 
   307 	* Update the publisher status 
   340 	* 
   308 	* 
   341 	* @param aPublisher publisher name
   309 	* @param aPublisher publisher name
   364 	* @param aStatus update needed status (ETrue/EFalse)
   332 	* @param aStatus update needed status (ETrue/EFalse)
   365 	* @return void  
   333 	* @return void  
   366 	*/
   334 	*/
   367     void SetUpdateNeeded(TBool aStatus);
   335     void SetUpdateNeeded(TBool aStatus);
   368     
   336     
   369     private :   
   337 private:   
   370     
   338     // data
   371     // Subscriber interface
   339     
   372     // own
   340     /** Subscriber interface, owned */    
   373     MLiwInterface* iInterface;
   341     MLiwInterface* iInterface;      
   374       
   342     /** Data Observer to CPS content registry, owned */    
   375     // Data Observer to CPS content registry
   343     CSapiDataObserver* iContentObserver;    
   376     // Own // iConObserver;
   344     /** Data Observer to CPS publisher registry, owned */    
   377     CSapiDataObserver* iContentObserver;
       
   378     
       
   379     // Data Observer to CPS publisher registry
       
   380     // Own // iConObserver;
       
   381     CSapiDataObserver* iPubObserver;
   345     CSapiDataObserver* iPubObserver;
   382    
   346     /** Service handler, owned */    
   383     // Service handler 
   347     CLiwServiceHandler* iServiceHandler;    
   384     // Own
   348     /** Array of configurations, owned */    
   385     CLiwServiceHandler* iServiceHandler;
       
   386     
       
   387     // Array of configurations
       
   388     // Own
       
   389     RPointerArray<CContentItem> iItemList;
   349     RPointerArray<CContentItem> iItemList;
   390 
   350     /** Number of configurations */ 
   391     // Number of configurations 
   351     TInt iItemCount;    
   392     TInt iItemCount;
   352     /** Command name in configuration Array, owned */
   393     
       
   394     // Command name in configuration Array
       
   395     HBufC8* iCommandName;
   353     HBufC8* iCommandName;
   396 	/* publisher id */
   354 	/** publisher id, owned */
   397 	HBufC* iPublisher;
   355 	HBufC* iPublisher;
   398 	/* content type */
   356 	/** content type, owned */
   399 	HBufC* iContentType;
   357 	HBufC* iContentType;
   400 	/* content id */
   358 	/** content id, owned */
   401 	HBufC* iContentId;
   359 	HBufC* iContentId;
   402 
   360 	/** Startup reason, owned */
   403     // Reference of the sapi data plugin
   361 	HBufC* iStartupReason;
   404     // Not owned
   362     /** Reference of the sapi data plugin, not owned */    
   405     CSapiDataPlugin* iPlugin;
   363     CSapiDataPlugin* iPlugin;    
   406     
   364     /** Menu item names, owned */    
   407     // Menu item names
   365     RPointerArray<HBufC> iMenuItems;    
   408     // Own
   366     /** Trigger names for the menu items, owned */
   409     RPointerArray<HBufC> iMenuItems; 
   367     RPointerArray<HBufC8> iMenuTriggers;    
   410     
   368     /** Store the status of update needed on resume */
   411     // Trigger names for the menu items
       
   412     // Own
       
   413     RPointerArray<HBufC8> iMenuTriggers;
       
   414     
       
   415     // Store the status of update needed on resume
       
   416     TBool iUpdateNeeded;
   369     TBool iUpdateNeeded;
   417     };
   370     };
   418 
   371 
   419 #endif /*SAPIDATA_H*/
   372 #endif // SAPIDATA_H
       
   373 
       
   374 // End of file