phonesrv_plat/service_provider_settings_api/inc/spentry.h
branchRCL_3
changeset 19 7d48bed6ce0c
parent 0 ff3b6d0fd310
child 20 987c9837762f
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
    34  *  @since S60 V3.2
    34  *  @since S60 V3.2
    35  */
    35  */
    36 NONSHARABLE_CLASS( CSPEntry ): public CBase
    36 NONSHARABLE_CLASS( CSPEntry ): public CBase
    37     {
    37     {
    38 
    38 
    39 	public: // Constructors and destructor
    39     public: // Constructors and destructor
    40 	    /**
    40         /**
    41 	    * Two-phased constructor.
    41         * Two-phased constructor.
    42 	    */
    42         */
    43 	    IMPORT_C static CSPEntry* NewL();
    43         IMPORT_C static CSPEntry* NewL();
    44 
    44 
    45 	    /**
    45         /**
    46 	    * Two-phased constructor.
    46         * Two-phased constructor.
    47 	    */
    47         */
    48 	    IMPORT_C static CSPEntry* NewLC();
    48         IMPORT_C static CSPEntry* NewLC();
    49 
    49 
    50 	    /**
    50         /**
    51 	    * Destructors.
    51         * Destructors.
    52 	    */
    52         */
    53 	    IMPORT_C virtual ~CSPEntry();
    53         IMPORT_C virtual ~CSPEntry();
    54 
    54 
    55 	public: // Member functions
    55     public: // Member functions
    56 	    /**
    56         /**
    57 	     * Returns service Id of this entry.
    57          * Returns service Id of this entry.
    58 	     *
    58          *
    59 	     * @since S60 V3.2
    59          * @since S60 V3.2
    60 	     * @return Service ID
    60          * @return Service ID
    61 	     */
    61          */
    62 	    IMPORT_C TServiceId GetServiceId() const;
    62         IMPORT_C TServiceId GetServiceId() const;
    63 
    63 
    64 	    /**
    64         /**
    65 	     * Sets unique service provider ID for this entry.
    65          * Sets unique service provider ID for this entry.
    66 	     * This ID is generated automatically when new entry is added.
    66          * This ID is generated automatically when new entry is added.
    67 	     * Service ID is also required when user updates entry in service table
    67          * Service ID is also required when user updates entry in service table
    68 	     *
    68          *
    69 	     * @since S60 V3.2
    69          * @since S60 V3.2
    70 	     * @param aServiceId service ID
    70          * @param aServiceId service ID
    71 	     */
    71          */
    72 	    void SetServiceId( TServiceId aServiceId ); 
    72         void SetServiceId( TServiceId aServiceId ); 
    73 
    73 
    74 	    /**
    74         /**
    75 	     * Returns service name of this entry.
    75          * Returns service name of this entry.
    76 	     *
    76          *
    77 	     * @since S60 V3.2
    77          * @since S60 V3.2
    78 	     * @return Service name 
    78          * @return Service name 
    79 	     */
    79          */
    80 	    IMPORT_C const TDesC& GetServiceName() const;
    80         IMPORT_C const TDesC& GetServiceName() const;
    81 
    81 
    82 	    /**
    82         /**
    83 	     * Sets service name for this entry.
    83          * Sets service name for this entry.
    84 	     *
    84          *
    85 	     * @since S60 V3.2
    85          * @since S60 V3.2
    86 	     * @param aServiceName service name
    86          * @param aServiceName service name
    87 	     */
    87          */
    88 	    IMPORT_C TInt SetServiceName( const TDesC& aServiceName );
    88         IMPORT_C TInt SetServiceName( const TDesC& aServiceName );
    89 
    89 
    90 	    /**
    90         /**
    91 	     * Adds new property to this entry.
    91          * Adds new property to this entry.
    92 	     *
    92          *
    93 	     * @since S60 V3.2
    93          * @since S60 V3.2
    94 	     * @param aProperty new property pointer
    94          * @param aProperty new property pointer
    95 	     * @return KErrNone if addition succeeded, 
    95          * @return KErrNone if addition succeeded, 
    96 	     *         system wide error code otherwise.
    96          *         system wide error code otherwise.
    97 	     */
    97          */
    98 	    IMPORT_C TInt AddPropertyL( const CSPProperty& aProperty );
    98         IMPORT_C TInt AddPropertyL( const CSPProperty& aProperty );
    99 
    99 
   100 	    /**
   100         /**
   101 	     * Updates content of property in this entry.
   101          * Updates content of property in this entry.
   102 	     *
   102          *
   103 	     * @since S60 V3.2
   103          * @since S60 V3.2
   104 	     * @param aPropertyName property name
   104          * @param aPropertyName property name
   105 	     * @param aValue new TInt value
   105          * @param aValue new TInt value
   106 	     * @return KErrNone if update succeeded.
   106          * @return KErrNone if update succeeded.
   107 	     */
   107          */
   108 	    IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TInt aValue );
   108         IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TInt aValue );
   109 
   109 
   110 	    /**
   110         /**
   111 	     * Updates content of property in this entry.
   111          * Updates content of property in this entry.
   112 	     *
   112          *
   113 	     * @since S60 V3.2
   113          * @since S60 V3.2
   114 	     * @param aPropertyName property name
   114          * @param aPropertyName property name
   115 	     * @param aValue new TDesC value
   115          * @param aValue new TDesC value
   116 	     * @return KErrNone if update succeeded.
   116          * @return KErrNone if update succeeded.
   117 	     */
   117          */
   118 	    IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, const TDesC& aValue );
   118         IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, const TDesC& aValue );
   119 
   119 
   120 	    /**
   120         /**
   121 	     * Updates content of property in this entry.
   121          * Updates content of property in this entry.
   122 	     *
   122          *
   123 	     * @since S60 V3.2
   123          * @since S60 V3.2
   124 	     * @param aPropertyName property name
   124          * @param aPropertyName property name
   125 	     * @param aValue new TOnOff value
   125          * @param aValue new TOnOff value
   126 	     * @return KErrNone if update succeeded.
   126          * @return KErrNone if update succeeded.
   127 	     */
   127          */
   128 	    IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TOnOff aValue );
   128         IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TOnOff aValue );
   129 
   129 
   130 	    /**
   130         /**
   131 	     * Returns property of this entry by property name.
   131          * Returns property of this entry by property name.
   132 	     *
   132          *
   133 	     * @since S60 V3.2
   133          * @since S60 V3.2
   134 	     * @param aProperty On return, reference to requested property
   134          * @param aProperty On return, reference to requested property
   135 	     * @param aPropertyName Name of requested property
   135          * @param aPropertyName Name of requested property
   136 	     * @return error code
   136          * @return error code
   137 	     */
   137          */
   138 	    IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, 
   138         IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, 
   139 	    						   TServicePropertyName aPropertyName ) const;
   139                                    TServicePropertyName aPropertyName ) const;
   140 
   140 
   141 	    /**
   141         /**
   142 	     * Returns property of this entry by property index.
   142          * Returns property of this entry by property index.
   143 	     *
   143          *
   144 	     * @since S60 V3.2
   144          * @since S60 V3.2
   145 	     * @param aProperty On return, reference to requested property
   145          * @param aProperty On return, reference to requested property
   146 	     * @param aIndex index of requested property
   146          * @param aIndex index of requested property
   147 	     * @return error code
   147          * @return error code
   148 	     */
   148          */
   149 	    IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, 
   149         IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, 
   150 	    							TInt aIndex ) const;
   150                                     TInt aIndex ) const;
   151 
   151 
   152 	    /**
   152         /**
   153 	     * Deletes property from this entry by index.
   153          * Deletes property from this entry by index.
   154 	     *
   154          *
   155 	     * @since S60 V3.2
   155          * @since S60 V3.2
   156 	     * @param aIndex index of requested property
   156          * @param aIndex index of requested property
   157 	     * @return error code
   157          * @return error code
   158 	     */
   158          */
   159 	    IMPORT_C TInt DeleteProperty( TInt aIndex );
   159         IMPORT_C TInt DeleteProperty( TInt aIndex );
   160 
   160 
   161 	    /**
   161         /**
   162 	     * Deletes property from this entry by property name.
   162          * Deletes property from this entry by property name.
   163 	     *
   163          *
   164 	     * @since S60 V3.2
   164          * @since S60 V3.2
   165 	     * @param aProperty property name
   165          * @param aProperty property name
   166 	     * @return error code
   166          * @return error code
   167 	     */
   167          */
   168 	    IMPORT_C TInt DeleteProperty( TServicePropertyName aProperty );
   168         IMPORT_C TInt DeleteProperty( TServicePropertyName aProperty );
   169 
   169 
   170 	    /**
   170         /**
   171 	     * Returns all properties of this entry.
   171          * Returns all properties of this entry.
   172 	     *
   172          *
   173 	     * @since S60 V3.2
   173          * @since S60 V3.2
   174 	     * @return Reference to array of properties
   174          * @return Reference to array of properties
   175 	     */
   175          */
   176 	    IMPORT_C const RPropertyArray& GetAllProperties() const;
   176         IMPORT_C const RPropertyArray& GetAllProperties() const;
   177 
   177 
   178 	    /**
   178         /**
   179 	     * Returns count of properties in this entry
   179          * Returns count of properties in this entry
   180 	     *
   180          *
   181 	     * @since S60 V3.2
   181          * @since S60 V3.2
   182 	     * @return Count of properties
   182          * @return Count of properties
   183 	     */
   183          */
   184 	    IMPORT_C TInt PropertyCount() const;
   184         IMPORT_C TInt PropertyCount() const;
   185 	    
   185         
   186 	    /**
   186         /**
   187 	     * reset service entry
   187          * reset service entry
   188 	     *
   188          *
   189 	     * @since S60 V3.2
   189          * @since S60 V3.2
   190 	     * @return Count of properties
   190          * @return Count of properties
   191 	     */
   191          */
   192 	     IMPORT_C void Reset();
   192          IMPORT_C void Reset();
   193 	    
   193         
   194 
   194 
   195 	private:
   195     private:
   196 
   196 
   197 	    /**
   197         /**
   198 	    * C++ default constructor.
   198         * C++ default constructor.
   199 	    */
   199         */
   200 	    CSPEntry();
   200         CSPEntry();
   201 
   201 
   202 	    /**
   202         /**
   203 	    * By default Symbian 2nd phase constructor is private.
   203         * By default Symbian 2nd phase constructor is private.
   204 	    */
   204         */
   205 	    void ConstructL();
   205         void ConstructL();
   206 
   206 
   207 	    /**
   207         /**
   208 	     * Search index of requested property in iPropertyArray
   208          * Search index of requested property in iPropertyArray
   209 	     *
   209          *
   210 	     * @since S60 ?S60_version
   210          * @since S60 ?S60_version
   211 	     * @param aProperty
   211          * @param aProperty
   212 	     * @return Index of property or KErrNotFound
   212          * @return Index of property or KErrNotFound
   213 	     */
   213          */
   214 	    TInt SearchProperty( TServicePropertyName aProperty ) const;
   214         TInt SearchProperty( TServicePropertyName aProperty ) const;
   215 
   215 
   216 	private: // data
   216     private: // data
   217 
   217 
   218 	    /**
   218         /**
   219 	     * Id of service settings entry ( unique )
   219          * Id of service settings entry ( unique )
   220 	     */
   220          */
   221 	    TServiceId iServiceId;
   221         TServiceId iServiceId;
   222 
   222 
   223 	    /**
   223         /**
   224 	     * Name of settings entry ( unique )
   224          * Name of settings entry ( unique )
   225 	     * Own.
   225          * Own.
   226 	     */
   226          */
   227 	    RBuf iServiceName;
   227         RBuf iServiceName;
   228 
   228 
   229 	    /**
   229         /**
   230 	     * Service settings properties owned by this entry
   230          * Service settings properties owned by this entry
   231 	     * Own.
   231          * Own.
   232 	     */
   232          */
   233 	    RPropertyArray iPropertyArray;
   233         RPropertyArray iPropertyArray;
   234 
   234 
   235     };
   235     };
   236 
   236 
   237 
   237 
   238 #endif // C_SPENTRY_H
   238 #endif // C_SPENTRY_H