[0.2.116] mm_attrs: Export API set located in mm_attrs_private.h
[platform/core/multimedia/libmm-common.git] / include / mm_attrs.h
1 /*
2  * libmm-common
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22
23
24 #ifndef __MM_ATTRS_H__
25 #define __MM_ATTRS_H__
26
27 #include <stdarg.h>
28 #include <mm_types.h>
29
30 #ifdef __cplusplus
31         extern "C" {
32 #endif
33
34
35 /**
36         @addtogroup COMMON
37         @{
38
39         * @file mm_attrs.h
40         * @version              1.0
41         * @brief                This file declares data structures and functions of attribute library.
42
43         @par
44         This part describes the APIs with respect to Multimedia Attribute Library.
45         The Attribute Library is a set of attribute. An attribute contains a value,
46         access flags and it's validation information. This document explains how to
47         manipulate an attribute in the Attribute Library.
48
49  */
50
51 /**
52  * Enumeration for attribute values types.
53  */
54 typedef enum {
55         MM_ATTRS_TYPE_INVALID = -1,        /**< Type is invalid */
56         MM_ATTRS_TYPE_INT,                 /**< Integer type attribute */
57         MM_ATTRS_TYPE_DOUBLE,               /**< Double type attribute */
58         MM_ATTRS_TYPE_STRING,              /**< UTF-8 String type attribute */
59         MM_ATTRS_TYPE_DATA,                /**< Pointer type attribute */
60         MM_ATTRS_TYPE_NUM,                 /**< Number of attribute type */
61 } MMAttrsType;
62
63 /**
64  * Enumeration for attribute validation type.
65  */
66 typedef enum {
67         MM_ATTRS_VALID_TYPE_INVALID = -1,        /**< Invalid validation type */
68         MM_ATTRS_VALID_TYPE_NONE,                /**< Do not check validity */
69         MM_ATTRS_VALID_TYPE_INT_ARRAY,           /**< validity checking type of integer array */
70         MM_ATTRS_VALID_TYPE_INT_RANGE,           /**< validity checking type of integer range */
71         MM_ATTRS_VALID_TYPE_DOUBLE_ARRAY,           /**< validity checking type of double array */
72         MM_ATTRS_VALID_TYPE_DOUBLE_RANGE,           /**< validity checking type of double range */
73 } MMAttrsValidType;
74
75 /**
76  * Enumeration for attribute access flag.
77  */
78 typedef enum {
79         MM_ATTRS_FLAG_NONE = 0,                 /**< None flag is set */
80         MM_ATTRS_FLAG_READABLE = 1 << 0,        /**< Readable */
81         MM_ATTRS_FLAG_WRITABLE = 1 << 1,        /**< Writable */
82         MM_ATTRS_FLAG_MODIFIED = 1 << 2,         /**< Modified */
83
84         MM_ATTRS_FLAG_RW = MM_ATTRS_FLAG_READABLE | MM_ATTRS_FLAG_WRITABLE,     /**< Readable and Writable */
85 } MMAttrsFlag;
86
87
88 /**
89  * Validity structure.
90  */
91 typedef struct {
92         MMAttrsType type;
93         MMAttrsFlag flag;
94         MMAttrsValidType validity_type;
95
96         /**
97          * a union that describes validity of the attribute.
98          * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
99          * the attribute can have validity.
100          */
101         union {
102                 /**
103                  * Validity structure for integer array.
104                  */
105                 struct {
106                         int *array;     /**< a pointer of array */
107                         int count;      /**< size of array */
108                         int dval;       /**< default value */
109                 } int_array;
110
111                 /**
112                  * Validity structure for integer range.
113                  */
114                 struct {
115                         int min;        /**< minimum range */
116                         int max;        /**< maximum range */
117                         int dval;       /**< default value */
118                 } int_range;
119
120                 /**
121                  * Validity structure for double array.
122                  */
123                 struct {
124                         double *array;  /**< a pointer of array */
125                         int count;      /**< size of array */
126                         double dval;    /**< default value */
127                 } double_array;
128
129                 /**
130                  * Validity structure for double range.
131                  */
132                 struct {
133                         double min;     /**< minimum range */
134                         double max;     /**< maximum range */
135                         double dval;    /**< default value */
136                 } double_range;
137         };
138 } MMAttrsInfo;
139
140 /**
141  * Value structure.
142  */
143 typedef struct {
144         MMAttrsType type;
145         int size;
146         union {
147                 int i_val;
148                 double d_val;
149                 char *s_val;
150                 void *p_val;
151         } value;
152 } MMAttrsValue;
153
154 /**
155  * Construction information structure.
156  */
157 typedef struct {
158         char *name;
159         MMAttrsType value_type;
160         int flags;
161         void *default_value;
162 } MMAttrsConstructInfo;
163
164 /**
165  * Attributes commit callback function type.
166  *
167  * @param       index   [in]    Index of attribute
168  * @param       name    [in]    Name of attribute
169  * @param       value   [in]    Value of attribute
170  * @param       user_param      [in]    User parameter
171  *
172  * @return      This callback function should return true on success, or false on failure.
173  * @see         mm_attrs_new
174  */
175 typedef bool (*mm_attrs_commit_callback) (int index, const char *name, const MMAttrsValue *value, void *user_param);
176
177 #if     __GNUC__ >= 4
178 #define __NULL_TERMINATED __attribute__((__sentinel__))
179 #else
180 #define __NULL_TERMINATED
181 #endif
182
183 /**
184  * This function is to create handle of attributes list and register the commit callback.
185  *
186  * @param       info    [in]    Attributes construction information
187  * @param       count   [in]    The number of attributes
188  * @param       name    [in]    Name of the attributes list (optional, this can be NULL)
189  * @param       callback        [in]    Commit callback (optional, this can be NULL)
190  * @param       user_param      [in]    User param of the commit callback (optional, this can be NULL)
191  * @param       attrs   [out]   Handle of attributes list
192  *
193  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
194  * @see mm_attrs_commit_all
195  * @see mm_attrs_commit
196  * @see mm_attrs_free
197  */
198 int mm_attrs_new(MMAttrsConstructInfo *info, int count, const char *name,
199                                                                 mm_attrs_commit_callback callback, void *user_param, MMHandleType *attrs);
200
201
202 /**
203  * This function releases resources and destroy the attributes handle created by mm_attrs_new.
204  *
205  * @param       attrs   [in]    Handle of attributes list
206  * @see         mm_attrs_new
207  */
208 void mm_attrs_free(MMHandleType attrs);
209
210
211 /**
212  * This function is to commit all the attributes.
213  *
214  * @param       attrs   [in]    Handle of attributes list
215  *
216  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
217  * @see         mm_attrs_new
218  * @see         mm_attrs_commit
219  */
220 int mm_attrs_commit_all(MMHandleType attrs);
221
222
223 /**
224  * This function is to commit the attribute.
225  *
226  * @param       attrs   [in]    Handle of attributes list
227  * @param       index   [in]    Index of attribute
228  *
229  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
230  * @see         mm_attrs_new
231  * @see         mm_attrs_commit_all
232  */
233 int mm_attrs_commit(MMHandleType attrs, int index);
234
235
236 /**
237  * This function is to set the integer value to the attribute by name.
238  *
239  * @param       attrs           [in]    Handle of attributes list
240  * @param       attr_name       [in]    Name of attribute
241  * @param       val                     [in]    Integer value to set
242  *
243  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
244  */
245 int mm_attrs_set_int_by_name(MMHandleType attrs, const char *attr_name, int val);
246
247
248 /**
249  * This function is to get the number of attribute in the MMAttrs.
250  *
251  * @param       attrs           [in]    Handle of attributes list
252  * @param       size            [out]   Number of attributes
253  *
254  * @return      This function returns the number of attributes in the attribute list.
255  */
256 int mm_attrs_get_size(MMHandleType attrs, int *size);
257
258
259 /**
260  * This function is to get the name of attribute at the given index.
261  *
262  * @param       attrs           [in]    Handle of attributes list
263  * @param       index           [in]    Index of attribute
264  * @param       name            [out]   Name of attribute
265  *
266  * @return      This function returns the name of attribute on success, or NULL
267  *                      on failure.
268  */
269 int mm_attrs_get_name(MMHandleType attrs, int index, char **name);
270
271
272 /**
273  * This function is to get the index of attribute at the given name.
274  *
275  * @param       attrs           [in]    Handle of attributes list
276  * @param       attr_name       [in]    Name of attribute
277  * @param       index           [out]   Index of attribute
278  *
279  * @return      This function returns the index of the attribute on success,
280  *                      or negative value on failure.
281  */
282 int mm_attrs_get_index(MMHandleType attrs, const char *attr_name, int *index);
283
284
285 /**
286  * This function is to get the integer value from the attribute by name.
287  *
288  * @param       attrs           [in]    Handle of attributes list
289  * @param       attr_name       [in]    Name of attribute
290  * @param       val                     [out]   Value of attribute
291  *
292  * @return      This function returns attribute value
293  */
294 int mm_attrs_get_int_by_name(MMHandleType attrs, const char *attr_name, int *val);
295
296
297 /**
298  * This function is to set the string to attribute by name.
299  *
300  * @param       attrs           [in]    MMAttrs handle
301  * @param       attr_name       [in]    Name of attribute
302  * @param       string          [in]    String value to set
303  *
304  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
305  */
306 int mm_attrs_set_string_by_name(MMHandleType attrs, const char *attr_name, const char *string);
307
308
309 /**
310  * This function is to get the string from the attribute by name.
311  *
312  * @param       attrs           [in]    Handle of attributes list
313  * @param       attr_name       [in]    Name of attribute
314  * @param       val                     [out]   Value of attribute
315  *
316  * @return      This function returns the string value of attribute on success,
317  *                      or NULL on failure
318  */
319 int mm_attrs_get_string_by_name(MMHandleType attrs, const char *attr_name, char **val);
320
321
322 /**
323  * This function is to set the data to the attribute by name.
324  *
325  * @param       attrs           [in]    Handle of attributes list
326  * @param       attr_name       [in]    Name of attribute
327  * @param       data            [in]    Data pointer to set
328  * @param       size            [in]    Data size to set
329  *
330  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
331  */
332 int mm_attrs_set_data_by_name(MMHandleType attrs, const char *attr_name, void *data, int size);
333
334
335 /**
336  * This function is to get the data from the attribute by name.
337  *
338  * @param       attrs           [in]    Handle of attributes list
339  * @param       attr_name       [in]    Name of attribute
340  * @param       data            [out]   Data pointer to set
341  *
342  * @return      This function returns user defined value on success, or NULL
343  *                      on failure
344  */
345 int mm_attrs_get_data_by_name(MMHandleType attrs, const char *attr_name, void **data);
346
347
348 /**
349  * This function is to retrieve type of attribute.
350  *
351  * @param       attrs           [in]    List of attributes
352  * @param       index           [in]    Index of attribute
353  * @param       attrtype        [out]   Type of attribute
354  *
355  * @return      This function returns MM_ERROR_NONE.
356  * @see         MMAttrsType
357  */
358 int mm_attrs_get_type(MMHandleType attrs, int index, MMAttrsType *attrtype);
359
360
361 /**
362  * This function is to get flags of attribute with given index.
363  *
364  * @param       attrs   [in]    List of attributes
365  * @param       index   [in]    Index of attribute
366  * @param       flags   [out]   Flags of attribute
367  *
368  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
369  * @see         MMAttrsFlag
370  */
371 int mm_attrs_get_flags(MMHandleType attrs, int index, int *flags);
372
373
374 /**
375  * This function is to get valid value type of attribute with given index.
376  *
377  * @param       attrs   [in]    List of attributes
378  * @param       index   [in]    Index of attribute
379  * @param       type    [out]   Valid value type of attribute
380  *
381  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
382  * @see         MMAttrsType
383  */
384 int mm_attrs_get_valid_type(MMHandleType attrs, int index, MMAttrsValidType *type);
385
386
387 /**
388  * This function is to get valid range of attribute with given index.
389  *
390  * @param       attrs   [in]    List of attributes
391  * @param       index   [in]    Index of attribute
392  * @param       min             [out]   Minimum value of the valid range
393  * @param       max             [out]   Maximum value of the valid range
394  *
395  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
396  */
397 int mm_attrs_get_valid_range(MMHandleType attrs, int index, int *min, int *max);
398
399
400 /**
401  * This function is to get valid array of attribute with given index.
402  *
403  * @param       attrs   [in]    List of attributes
404  * @param       index   [in]    Index of attribute
405  * @param       count   [out]   The number of array
406  * @param       array   [out]   Valid array of attribute
407  *
408  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
409  */
410 int mm_attrs_get_valid_array(MMHandleType attrs, int index, int *count,  int **array);
411
412
413 /**
414  * This function is to set integer value to attribute with given index.
415  *
416  * @param       attrs   [in]    List of attributes
417  * @param       index   [in]    Index of attribute
418  * @param       val             [in]    Integer value to set
419  *
420  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
421  * @see         mm_attrs_get_int
422  */
423 int mm_attrs_set_int(MMHandleType attrs, int index, int val);
424
425
426 /**
427  * This function is to get integer value to attribute with given index.
428  *
429  * @param       attrs   [in]    List of attributes
430  * @param       index   [in]    Index of attribute
431  * @param       val             [out]   Integer value of attribute
432  *
433  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
434  * @remarks     If type of attributes is not an integer type, the value which is returned by this function is meaningless.
435  * @see         mm_attrs_get_int
436  */
437 int mm_attrs_get_int(MMHandleType attrs, int index,  int *val);
438
439
440 /**
441  * This function is to set double value to attribute with given index.
442  *
443  * @param       attrs   [in]    List of attributes
444  * @param       index   [in]    Index of attribute
445  * @param       val             [in]    Integer value to set
446  *
447  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
448  * @see         mm_attrs_get_double
449  */
450 int mm_attrs_set_double(MMHandleType attrs, int index, double val);
451
452
453 /**
454  * This function is to set the double value to the attribute by name.
455  *
456  * @param       attrs           [in]    Handle of attributes list
457  * @param       attr_name       [in]    Name of attribute
458  * @param       val                     [in]    Integer value to set
459  *
460  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
461  */
462 int mm_attrs_set_double_by_name(MMHandleType attrs, const char *attr_name, double val);
463
464
465 /**
466  * This function is to get double value to attribute with given index.
467  *
468  * @param       attrs           [in]    List of attributes
469  * @param       index           [in]    Index of attribute
470  * @param       attrval         [out]   Double value of attribute on success, or invalid value
471  *
472  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
473  * @see         mm_attrs_set_double
474  */
475 int mm_attrs_get_double(MMHandleType attrs, int index, double *attrval);
476
477
478 /**
479  * This function is to get the double value from the attribute by name.
480  *
481  * @param       attrs           [in]    Handle of attributes list
482  * @param       attr_name       [in]    Name of attribute
483  * @param       val                     [out]   Double value to set
484  *
485  * @return      This function returns attribute value
486  */
487 int mm_attrs_get_double_by_name(MMHandleType attrs, const char *attr_name, double *val);
488
489
490 /**
491  * This function is to set string to attribute with given index.
492  *
493  * @param       attrs           [in]    Handle of attributes list
494  * @param       index           [in]    Index of attribute
495  * @param       string          [in]    String to set
496  * @param       size            [in]    Length of string to set
497  *
498  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
499  * @see         mm_attrs_get_string
500  */
501 int mm_attrs_set_string(MMHandleType attrs, int index, const char *string, int size);
502
503
504 /**
505  * This function is to get string to attribute with given index.
506  *
507  * @param       attrs           [in]    Handle of attributes list
508  * @param       index           [in]    Index of attribute
509  * @param       sval            [in]    Placeholder to output string buffer
510  * @param       size            [in]    The field contains number of characters filled in the buffer
511  *
512  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
513  * @remarks     Application would be responsible for managing/releasing the string
514  * @see         mm_attrs_set_string
515  */
516 int mm_attrs_get_string(MMHandleType attrs, int index, char **sval, int *size);
517
518
519 /**
520  * This function is to set pointer to attribute with given index.
521  *
522  * @param       attrs           [in]    Handle of attributes list
523  * @param       index           [in]    Index of attribute
524  * @param       data            [in]    Data to set
525  * @param       size            [in]    Length of input data
526  *
527  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
528  * @remarks     Data type is the reference to memory which is allocated by user. The allocated memory must be freed by user.
529  * @see         mm_attrs_get_data
530  */
531 int mm_attrs_set_data(MMHandleType attrs, int index, void *data,  int size);
532
533
534 /**
535  * This function is to get pointer to attribute with given index.
536  *
537  * @param       attrs           [in]    Handle of attributes list
538  * @param       index           [in]    Index of attribute
539  * @param       data            [out]   Placeholder to output data buffer
540  * @param       size            [out]   The field contains number of bytes filled in the buffer
541  *
542  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
543  * @remarks     Application would be responsible for managing/releasing data
544  * @see         mm_attrs_set_data
545  */
546 int mm_attrs_get_data(MMHandleType attrs, int index, void **data, int *size);
547
548
549 /**
550  * A function to get  information of the attribute
551  *
552  * @param       attrs           [in]    Handle of attributes list
553  * @param       index           [in]    Index of attribute
554  * @param       info            [out]   Information of the attribute
555  *
556  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
557  */
558 int mm_attrs_get_info(MMHandleType attrs, int index, MMAttrsInfo *info);
559
560
561 /**
562  * This function is to get array of attribute with given name.
563  *
564  * @param       attrs           [in]    Handle of attributes list
565  * @param       attr_name       [in]    Name of attribute
566  * @param       info            [out]   Information of the attribute
567  *
568  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
569  */
570 int mm_attrs_get_info_by_name(MMHandleType attrs, const char *attr_name, MMAttrsInfo *info);
571
572
573 /**
574  * Sets properties on an object.
575  *
576  * @param       attrs                           [in]    Handle of attributes list
577  * @param       err_attr_name           [out]   Name of attributes that occurs error. Free this variable after use
578  * @param       attribute_name          [in]    Name of the first property to set
579  * @param       ...                                     [in]    Value for the first property, followed optionally by more
580  *  name/value pairs, followed by %NULL
581  *
582  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
583  * @remarks     Multiple setter of attribute
584  * @see         mm_attrs_set_int, mm_attrs_set_string, ...
585  */
586 int mm_attrs_multiple_set(MMHandleType attrs,  char **err_attr_name, const char *attribute_name, ...) __NULL_TERMINATED;
587
588
589 /**
590  * Gets properties on an object.
591  *
592  * @param       attrs                           [in]    Handle of attributes list
593  * @param       err_attr_name           [out]   Name of attributes that occurs error. Free this variable after use
594  * @param       attribute_name          [in]    Name of the first property to set
595  * @param       ...                                     [in]    Value for the first property, followed optionally by more
596  *  name/value pairs, followed by %NULL
597  *
598  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
599  * @remarks     Multiple setter of attribute
600  * @see         mm_attrs_set_int, mm_attrs_set_string, ...
601  */
602 int mm_attrs_multiple_get(MMHandleType attrs,  char **err_attr_name, const char *attribute_name, ...) __NULL_TERMINATED;
603
604
605 /**
606  * Sets properties on an object with va_list param.
607  *
608  * @param       attrs                                   [in]    Handle of attributes list
609  * @param       err_attr_name                   [out]   Name of attributes that occurs error. Free this variable after use
610  * @param       attribute_name                  [in]    Name of the first property to set
611  * @param       var_args                                [in]    Variable arguments
612  *
613  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
614  * @remarks     Multiple setter of attribute
615  * @see         mm_attrs_multiple_set
616  */
617 int mm_attrs_set_valist(MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
618
619
620 /**
621  * Gets properties on an object with va_list param.
622  *
623  * @param       attrs                                   [in]    Handle of attributes list
624  * @param       err_attr_name                   [out]   Name of attributes that occurs error. Free this variable after use
625  * @param       attribute_name                  [in]    Name of the first property to set
626  * @param       var_args                                [in]    Variable arguments
627  *
628  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
629  * @remarks     Multiple setter of attribute
630  * @see         mm_attrs_multiple_get
631  */
632 int mm_attrs_get_valist(MMHandleType attrs, char **err_attr_name, const char *attribute_name, va_list var_args);
633
634
635 /**
636  * This function is to set the valid attribute type.
637  *
638  * @param       attrs   [in]    Handle of attributes list
639  * @param       index   [in]    Index of attribute
640  * @param       type    [in]    Type of attribute
641  *
642  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
643  */
644 int mm_attrs_set_valid_type(MMHandleType attrs, int index, MMAttrsValidType type);
645
646
647 /**
648  * This function is to set the valid integer range to the attribute.
649  *
650  * @param       attrs   [in]    Handle of attributes list
651  * @param       index   [in]    Index of attribute
652  * @param       min             [in]    Minimum value of the valid range
653  * @param       max             [in]    Maximum value of the valid range
654  * @param       dval    [in]    Default value
655  *
656  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
657  */
658 int mm_attrs_set_valid_range(MMHandleType attrs, int index, int min, int max, int dval);
659
660
661 /**
662  * This function is to set the valid integer array to the attribute.
663  *
664  * @param       attrs   [in]    Handle of attributes list
665  * @param       index   [in]    Index of attribute
666  * @param       array   [in]    Array contains integer values to set
667  * @param       count   [in]    The number of items in array
668  * @param       dval    [in]    Default value
669  *
670  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
671  */
672 int mm_attrs_set_valid_array(MMHandleType attrs, int index, const int *array, int count, int dval);
673
674
675 /**
676  * This function is to set the valid double range to the attribute.
677  *
678  * @param       attrs   [in]    Handle of attributes list
679  * @param       index   [in]    Index of attribute
680  * @param       min             [in]    Minimum value of the valid range
681  * @param       max             [in]    Maximum value of the valid range
682  * @param       dval    [in]    Default value
683  *
684  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
685  */
686 int mm_attrs_set_valid_double_range(MMHandleType attrs, int index, double min, double max, double dval);
687
688
689 /**
690  * This function is to set the valid double array to the attribute.
691  *
692  * @param       attrs   [in]    Handle of attributes list
693  * @param       index   [in]    Index of attribute
694  * @param       array   [in]    Array contains double values to set
695  * @param       count   [in]    The number of items in array
696  * @param       dval    [in]    Default value
697  *
698  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
699  */
700 int mm_attrs_set_valid_double_array(MMHandleType attrs, int index, const double *array, int count, double dval);
701
702
703 /**
704  * This function is to check whether the attribute is modified
705  *
706  * @param       attrs   [in]    Handle of attributes list
707  * @param       index   [in]    Index of attribute
708  * @param       modified        [out]   Modified or not (true = modified, false = not modified)
709  *
710  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
711  */
712 int mm_attrs_is_modified(MMHandleType attrs, int index, bool *modified);
713
714
715 /**
716  * This function is to set the attribute to modified
717  *
718  * @param       attrs   [in]    Handle of attributes list
719  * @param       index   [in]    Index of attribute
720  *
721  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
722  */
723 int mm_attrs_set_modified(MMHandleType attrs, int index);
724
725
726 /**
727  * This function is to set the attribute to read-only
728  *
729  * @param       attrs   [in]    Handle of attributes list
730  * @param       index   [in]    Index of attribute
731  *
732  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
733  */
734 int mm_attrs_set_readonly(MMHandleType attrs, int index);
735
736
737 /**
738  * This function is to set the attribute to disabled
739  *
740  * @param       attrs   [in]    Handle of attributes list
741  * @param       index   [in]    Index of attribute
742  *
743  * @return      This function returns MM_ERROR_NONE on success, or negative value with error code.
744  */
745 int mm_attrs_set_disabled(MMHandleType attrs, int index);
746
747
748
749 /**
750  * @}
751  */
752
753 #ifdef __cplusplus
754         }
755 #endif
756
757 #endif /* __MM_ATTRS_H__ */