homescreensrv_plat/hs_settings_api/inc/hspluginsettings.h
branchRCL_3
changeset 11 bd874ee5e5e2
parent 8 d0529222e3f0
equal deleted inserted replaced
8:d0529222e3f0 11:bd874ee5e5e2
    50  *  @endcode
    50  *  @endcode
    51  *
    51  *
    52  *  @lib HomeScreenSettingsIf.lib
    52  *  @lib HomeScreenSettingsIf.lib
    53  *  @since S60 v5.0
    53  *  @since S60 v5.0
    54  */
    54  */
    55 class CHomescreenSettings:
    55 NONSHARABLE_CLASS( CHomescreenSettings ) :
    56     public CBase,
    56     public CBase,
    57     public MLiwNotifyCallback,
    57     public MLiwNotifyCallback,
    58     public MHomescreenSettingsIf
    58     public MHomescreenSettingsIf
    59     {
    59     {
       
    60 public: // static methods
       
    61     /**
       
    62      * Get instance to settings API.
       
    63      * 
       
    64      * InitializeL must be called before calling this method.
       
    65      * Otherwise NULL is returned. InitializeL and Instance
       
    66      * must be called within same thread since TLS is used
       
    67      * to storage instance data.
       
    68      * 
       
    69      * @return CHomescreenSettings* Pointer to settings api.
       
    70      *                              Can return NULL in case of
       
    71      *                              error. 
       
    72      */
       
    73     IMPORT_C static CHomescreenSettings* Instance();
       
    74 
       
    75     /**
       
    76      * Initialize settings api.
       
    77      *
       
    78      * There must be one UnInitialize call for each Initialize call
       
    79      * in order to prevent memory leaking.
       
    80      * (Implementation contains reference counting)
       
    81      */
       
    82     IMPORT_C static void InitializeL( const TDesC8& aAppUid );
       
    83 
       
    84     /**
       
    85      * Uninitialize settings api.
       
    86      *
       
    87      * There must be one UnInitialize call for each Initialize call
       
    88      * in order to prevent memory leaking.
       
    89      * (Implementation contains reference counting)
       
    90      */
       
    91     IMPORT_C static void UnInitialize();    
       
    92 
    60 public:
    93 public:
    61     /**
    94     /**
    62      * Two-phased constructor.
    95      * Add observer
    63      * 
    96      * 
    64      * @param aAppUid Application uid in integer format
    97      * @param aObserver     Observer to be added.
    65      * @param aObserver Observer
    98      */
    66      */
    99     IMPORT_C void AddObserverL( MHomeScreenSettingsObserver* aObserver );        
    67     IMPORT_C static CHomescreenSettings* NewL(
   100     
    68         const TDesC8& aAppUid,
   101     /**
    69         const TDesC8& aPluginId,
   102      * Remove observer
    70         MHomeScreenSettingsObserver* aObserver );
   103      * 
    71     
   104      * @param aObserver     Observer to be removed.
    72     /**
   105      */    
    73      * Two-phased constructor.
   106     IMPORT_C void RemoveObserver( MHomeScreenSettingsObserver* aObserver );        
    74      * 
   107     
    75      * @param aAppUid Application uid in integer format
       
    76      * @param aObserver Observer
       
    77      */
       
    78     IMPORT_C static CHomescreenSettings* NewLC(
       
    79         const TDesC8& aAppUid,
       
    80         const TDesC8& aPluginId,
       
    81         MHomeScreenSettingsObserver* aObserver );
       
    82     
       
    83     /**
       
    84     * Destructor.
       
    85     */
       
    86     IMPORT_C virtual ~CHomescreenSettings();
       
    87 
       
    88 public: 
   108 public: 
    89     /**
   109     /**
    90      * From MHomescreenSettingsIf
   110      * From MHomescreenSettingsIf
    91      * Stores defined plugin’s settings. 
   111      * Stores defined plugin’s settings. 
    92      * Plugin is identified with unique plugin ID used in application’s
   112      * Plugin is identified with unique plugin ID used in application’s
   112      * @return Operation status. KErrNone (success), KErrNotFound
   132      * @return Operation status. KErrNone (success), KErrNotFound
   113      */
   133      */
   114     IMPORT_C TInt SetSettingsL(
   134     IMPORT_C TInt SetSettingsL(
   115         const TDesC8& aPluginId,
   135         const TDesC8& aPluginId,
   116         const RPointerArray<CItemMap>& aSettings,
   136         const RPointerArray<CItemMap>& aSettings,
   117         const TBool aStoringParam );
   137         const TBool aStoringParam );   
   118         
   138     
   119 
       
   120 protected:
   139 protected:
   121     /**
   140     /**
       
   141      * Two-phased constructor.
       
   142      * 
       
   143      * @param aAppUid Application uid in integer format
       
   144      */
       
   145     static CHomescreenSettings* NewL( const TDesC8& aAppUid );
       
   146     
       
   147     /**
       
   148      * Two-phased constructor.
       
   149      * 
       
   150      * @param aAppUid Application uid in integer format
       
   151      */
       
   152     static CHomescreenSettings* NewLC(
       
   153         const TDesC8& aAppUid );
       
   154     
       
   155     /**
       
   156     * Destructor.
       
   157     */
       
   158     virtual ~CHomescreenSettings(); 
       
   159     
       
   160     /**
   122      * Constructor.
   161      * Constructor.
   123      * 
   162      */
   124      * @param aAppUid Application uid in integer format
   163     CHomescreenSettings();
   125      * @param aObserver Observer
       
   126      */
       
   127     CHomescreenSettings(
       
   128         MHomeScreenSettingsObserver* aObserver,
       
   129         const TDesC8& aPluginId );
       
   130     
   164     
   131     /**
   165     /**
   132      * Second phase constructor
   166      * Second phase constructor
   133      * 
   167      * 
   134      * @param aAppUid Application uid in integer format
   168      * @param aAppUid Application uid in integer format
   180     TInt SetPluginSettingsL( 
   214     TInt SetPluginSettingsL( 
   181         const TDesC8& aPluginId,
   215         const TDesC8& aPluginId,
   182         const RPointerArray<CItemMap>& aSettings,
   216         const RPointerArray<CItemMap>& aSettings,
   183         const TDesC8& aStoringParam );
   217         const TDesC8& aStoringParam );
   184     
   218     
   185     
       
   186 protected:  
   219 protected:  
   187     /**
   220     /**
   188      * From MLiwNotifyCallback
   221      * From MLiwNotifyCallback
   189      * Handle HSPS notifications 
   222      * Handle HSPS notifications 
   190      *
   223      *
   208     CLiwCriteriaItem* iHspsService;   
   241     CLiwCriteriaItem* iHspsService;   
   209     /**
   242     /**
   210      * Owned. Provides hsps services.
   243      * Owned. Provides hsps services.
   211      */
   244      */
   212     MLiwInterface* iHspsInterface;
   245     MLiwInterface* iHspsInterface;
   213     /**
   246 
   214      * Not owned. Wrapper observer
       
   215      */    
       
   216     MHomeScreenSettingsObserver* iObserver;
       
   217     /*
   247     /*
   218      * Asynchronous service request tarnsaction id
   248      * Asynchronous service request tarnsaction id
   219      */ 
   249      */ 
   220     TInt iTransactionId;
   250     TInt iTransactionId;
   221     /**
   251     
   222      * Plugin id
   252     /*
   223      */
   253      * List of observers. Items not owned!
   224     const TDesC8& iPluginId;
   254      */ 
       
   255     RPointerArray<MHomeScreenSettingsObserver> iObservers;
   225     };
   256     };
   226 
   257 
   227 } //namespace HSPluginSettingsIf
   258 } //namespace HSPluginSettingsIf
   228 
   259 
   229 #endif // C_CHomeScreenSettingsIf_H
   260 #endif // C_CHomeScreenSettingsIf_H