homescreensrv_plat/ai_utilities_api/inc/aipluginsettings.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_AIPLUGINSETTINGS_H
       
    20 #define M_AIPLUGINSETTINGS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 const TInt KMaxSettingsValueStringLength = 1024;
       
    25 
       
    26 class MAiPluginSettings;
       
    27 class MAiPluginSettingsItem;
       
    28 class MAiPluginContentItem;
       
    29 class MAiPluginConfigurationItem;
       
    30 
       
    31 typedef RPointerArray<MAiPluginSettings> RAiSettingsItemArray;
       
    32 
       
    33 enum TAiPluginItem
       
    34     {
       
    35     EAiPluginSettingsItem = 0,
       
    36     EAiPluginContentItem,
       
    37     EAiPluginConfigurationItem
       
    38     };
       
    39 
       
    40 /**
       
    41  * Active Idle framework settings storing interface.
       
    42  *
       
    43  * @since S60 3.2
       
    44  */
       
    45 class MAiPluginSettingsStorer
       
    46     {
       
    47 public:
       
    48     /**
       
    49      * Saves setting item value identified by key to settings store.
       
    50      *
       
    51      * @param aKey   setting item key.
       
    52      * @param aValue setting item value.
       
    53      */
       
    54     virtual void SaveL(TInt32 aKey, const TDesC& aValue) = 0;
       
    55 
       
    56     /**
       
    57      * Reads setting item value identified by key from settings store.
       
    58      *
       
    59      * @param aKey   setting item key.
       
    60      * @param aValue received setting item value.
       
    61      */
       
    62     virtual void ReadL(TInt32 aKey, TDes& aValue) = 0;
       
    63 
       
    64     };
       
    65 
       
    66 /**
       
    67  * Active Idle framework settings access interface.
       
    68  *
       
    69  * @since S60 3.2
       
    70  */
       
    71 class MAiPluginSettings
       
    72     {
       
    73 public:
       
    74     /**
       
    75      * Returns the settings item.
       
    76      */
       
    77     virtual MAiPluginSettingsItem& AiPluginSettingsItem() = 0;
       
    78 
       
    79     virtual ~MAiPluginSettings() { }
       
    80     
       
    81     virtual TInt AiPluginItemType() = 0;
       
    82     
       
    83     virtual MAiPluginContentItem& AiPluginContentItem() = 0;
       
    84     
       
    85     virtual MAiPluginConfigurationItem& AiPluginConfigurationItem() = 0;
       
    86 
       
    87     };
       
    88 
       
    89 /**
       
    90  * Active Idle framework settings item interface.
       
    91  *
       
    92  * @since S60 3.2
       
    93  */
       
    94 class MAiPluginSettingsItem
       
    95     {
       
    96 public:
       
    97 
       
    98     /**
       
    99      * Get a pointer to the descriptor value of the setting.
       
   100      *
       
   101      * @return returns the value of the setting item.
       
   102      *
       
   103      * @since S60 3.2
       
   104      */
       
   105     virtual TPtrC Value() = 0;
       
   106 
       
   107     /**
       
   108      * Sets the setting value.
       
   109      *
       
   110      * @param aValue       the descriptor value for the Setting.
       
   111      * @param aSaveToStore (this parameter is ignored)
       
   112      *
       
   113      * @since S60 3.2
       
   114      */
       
   115     virtual void SetValueL(const TDesC& aValue, TBool aSaveToStore = ETrue) = 0;
       
   116 
       
   117     /**
       
   118      * Get publisher uid this setting item belongs to.
       
   119      *
       
   120      * @return publisher uid.
       
   121      *
       
   122      * @since S60 3.2
       
   123      */
       
   124     virtual const TUid& PublisherId() const = 0;
       
   125 
       
   126     /**
       
   127      * Set publisher uid this setting item belongs to.
       
   128      *
       
   129      * @param aUid publisher uid.
       
   130      *
       
   131      * @since S60 3.2
       
   132      */
       
   133     virtual void SetPublisherId(const TUid& aUid) = 0;
       
   134 
       
   135     /**
       
   136      * Get setting item key.
       
   137      *
       
   138      * @return key value.
       
   139      *
       
   140      * @since S60 3.2
       
   141      */
       
   142     virtual TInt32 Key() const = 0;
       
   143 
       
   144     /**
       
   145      * Set setting item key.
       
   146      *
       
   147      * @param aKey setting item key.
       
   148      *
       
   149      * @since S60 3.2
       
   150      */
       
   151     virtual void SetKey(TInt32 aKey) = 0;
       
   152 
       
   153     /**
       
   154      * Set storer for this setting item.
       
   155      *
       
   156      * @param aStorer pointer to instance of storer interface.
       
   157      *
       
   158      * @since S60 3.2
       
   159      */
       
   160     virtual void SetStorer(MAiPluginSettingsStorer* aStorer) = 0;
       
   161 
       
   162     /**
       
   163      * Reads this setting item value from settings store.
       
   164      *
       
   165      * @since S60 3.2
       
   166      */
       
   167     virtual void ReadFromStoreL() = 0;
       
   168 
       
   169     /**
       
   170      * Saves this setting item value to settings store.
       
   171      *
       
   172      * @since S60 3.2
       
   173      */
       
   174     virtual void SaveToStoreL() = 0;
       
   175 
       
   176 protected:
       
   177 
       
   178     /**
       
   179      * Protected destructor prevents deletion through this interface.
       
   180      */
       
   181     ~MAiPluginSettingsItem() { }
       
   182 
       
   183     };
       
   184 
       
   185 
       
   186 /**
       
   187  * Active Idle framework dynamic content model item interface.
       
   188  *
       
   189  * @since S60 5.0
       
   190  */
       
   191 class MAiPluginContentItem
       
   192     {
       
   193 public:
       
   194 
       
   195     /**
       
   196      * Get a pointer to the descriptor name of the content item.
       
   197      *
       
   198      * @return returns the value of the content item.
       
   199      *
       
   200      * @since S60 5.0
       
   201      */
       
   202     virtual TPtrC Name() = 0;
       
   203 
       
   204     /**
       
   205      * Sets the content item name.
       
   206      *
       
   207      * @param aName  the descriptor name for the content item.
       
   208      *
       
   209      * @since S60 5.0
       
   210      */
       
   211     virtual void SetNameL(const TDesC& aName) = 0;
       
   212 
       
   213     /**
       
   214      * Get a pointer to the content item type.
       
   215      *
       
   216      * @return returns content item type
       
   217      *
       
   218      * @since S60 5.0
       
   219      */
       
   220     virtual TPtrC Type() = 0;
       
   221 
       
   222     /**
       
   223      * Sets the type of the content item.
       
   224      *
       
   225      * @param aType
       
   226      *
       
   227      * @since S60 5.0
       
   228      */
       
   229     virtual void SetTypeL(const TDesC& aType) = 0;
       
   230     
       
   231 protected:
       
   232 
       
   233     /**
       
   234      * Protected destructor prevents deletion through this interface.
       
   235      */
       
   236     ~MAiPluginContentItem() { }
       
   237     };
       
   238 
       
   239 
       
   240 /**
       
   241  * Active Idle framework dynamic content source configuration interface.
       
   242  *
       
   243  * @since S60 5.0
       
   244  */
       
   245 class MAiPluginConfigurationItem
       
   246     {
       
   247 public:
       
   248 
       
   249     /**
       
   250      * Get a pointer to the configuration item owner.
       
   251      *
       
   252      * @return returns configuration item type
       
   253      *
       
   254      * @since S60 5.0
       
   255      */
       
   256     virtual TPtrC Owner() = 0;
       
   257     
       
   258     /**
       
   259      * Sets the owner of the configuration item.
       
   260      *
       
   261      * @param aOwner
       
   262      *
       
   263      * @since S60 5.0
       
   264      */
       
   265     virtual void SetOwnerL( const TDesC& aOwner ) = 0;
       
   266 
       
   267     /**
       
   268      * Get a pointer to the descriptor name of the configuration item.
       
   269      *
       
   270      * @return returns the name of the configuration item.
       
   271      *
       
   272      * @since S60 5.0
       
   273      */
       
   274     virtual TPtrC Name() = 0;
       
   275 
       
   276     /**
       
   277      * Sets the configuration item name.
       
   278      *
       
   279      * @param aName the descriptor name for the configuration item.
       
   280      *
       
   281      * @since S60 5.0
       
   282      */
       
   283     virtual void SetNameL( const TDesC& aName ) = 0;
       
   284     
       
   285     /**
       
   286      * Get a pointer to the configuration item value.
       
   287      *
       
   288      * @return returns configuration item value
       
   289      *
       
   290      * @since S60 5.0
       
   291      */
       
   292     virtual TPtrC Value() = 0;
       
   293 
       
   294     /**
       
   295      * Sets the value of the configuration item.
       
   296      *
       
   297      * @param aValue
       
   298      *
       
   299      * @since S60 5.0
       
   300      */
       
   301     virtual void SetValueL( const TDesC& aValue ) = 0;
       
   302     
       
   303 protected:
       
   304 
       
   305     /**
       
   306      * Protected destructor prevents deletion through this interface.
       
   307      */
       
   308     ~MAiPluginConfigurationItem() { }
       
   309     };
       
   310 
       
   311 #endif // M_AIPLUGINSETTINGS_H
       
   312