Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiVariant.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FUiVariant.h
20  * @brief               This is the header file for the %Variant class.
21  *
22  * This header file contains the declarations of the %Variant class.
23  */
24 #ifndef _FUI_VARIANT_H_
25 #define _FUI_VARIANT_H_
26
27 #include <FBaseDataType.h>
28 #include <FBaseObject.h>
29
30 namespace Tizen { namespace Base
31 {
32         class DateTime;
33 } }
34
35 namespace Tizen { namespace Graphics
36 {
37         class Rectangle;
38         class Dimension;
39         class Point;
40         class Color;
41         class FloatPoint;
42         class FloatRectangle;
43         class FloatDimension;
44         class FloatMatrix4;
45         class FloatPoint3;
46         class FloatVector4;
47 } }
48
49 namespace Tizen { namespace Ui
50 {
51
52 class _VariantImpl;
53
54 /**
55  * @enum                VariantType
56  *
57  * Defines the types which %Variant can hold.
58  *
59  * @since 2.0
60  */
61 enum VariantType
62 {
63         VARIANT_TYPE_NONE = 0, /**< The type for invalid variant */
64         VARIANT_TYPE_INT, /**< The @c int type */
65         VARIANT_TYPE_UINT, /**< The @c unsigned @c int type */
66         VARIANT_TYPE_BOOL, /**< The @c bool type */
67         VARIANT_TYPE_FLOAT, /**< The @c float type */
68         VARIANT_TYPE_DOUBLE, /**< The @c double type */
69         VARIANT_TYPE_LONG, /**< The @c long type */
70         VARIANT_TYPE_ULONG, /**< The @c unsigned @c long type */
71         VARIANT_TYPE_LONGLONG, /**< The @c long @c long type */
72         VARIANT_TYPE_ULONGLONG, /**< The @c unsigned @c long @c long type */
73         VARIANT_TYPE_STRING, /**< The String type */
74         VARIANT_TYPE_DATETIME, /**< The DateTime type */
75         VARIANT_TYPE_COLOR, /**< The Color type */
76         VARIANT_TYPE_POINT, /**< The Point type */
77         VARIANT_TYPE_FLOAT_POINT, /**< The FloatPoint type */
78         VARIANT_TYPE_RECTANGLE, /**< The Rectangle type */
79         VARIANT_TYPE_FLOAT_RECTANGLE, /**< The FloatRectangle type */
80         VARIANT_TYPE_DIMENSION, /**< The Dimension type */
81         VARIANT_TYPE_FLOAT_DIMENSION, /**< The FloatDimension type */
82         VARIANT_TYPE_FLOAT_MATRIX4, /**< The FloatMatrix4 type */
83         VARIANT_TYPE_FLOAT_POINT3, /**< The FloatPoint3 type @b Since: @b 2.1 */
84         VARIANT_TYPE_FLOAT_VECTOR4 /**< The FloatPoint3 type @b Since: @b 2.1 */
85 };
86
87 /**
88  * @class       Variant
89  * @brief       This class abstracts a %Variant value.
90  *
91  * @since 2.0
92  *
93  *      The %Variant class represents a %Variant type which can hold any of the basic type values.
94  *
95  */
96 class _OSP_EXPORT_ Variant
97         : public Tizen::Base::Object
98 {
99 public:
100         /**
101          * This is the default constructor for this class.
102          *
103          * @since 2.0
104          */
105         Variant(void);
106
107         /**
108          * This is the copy constructor for the %Variant class.
109          *
110          * @since 2.0
111          *
112          * @param[in]   value   A reference to the %Variant instance to copy
113          */
114         Variant(const Variant& value);
115
116         /**
117          * Initializes this instance of %Variant with the specified @c int value.
118          *
119          * @since 2.0
120          *
121          * @param[in]   value   An @c int value
122          */
123         Variant(int value);
124
125         /**
126          * Initializes this instance of %Variant with the specified @c unsigned @c int value.
127          *
128          * @since 2.0
129          *
130          * @param[in]   value   An @c unsigned @c int value
131          */
132         Variant(unsigned int value);
133
134         /**
135          * Initializes this instance of %Variant with the specified bool value.
136          *
137          * @since 2.0
138          *
139          * @param[in]   value   A bool value
140          */
141         Variant(bool value);
142
143         /**
144          * Initializes this instance of %Variant with the specified @c float value.
145          *
146          * @since 2.0
147          *
148          * @param[in]   value   A @c float value
149          */
150         Variant(float value);
151
152         /**
153          * Initializes this instance of %Variant with the specified @c double value.
154          *
155          * @since 2.0
156          *
157          * @param[in]   value   A @c double value
158          */
159         Variant(double value);
160
161         /**
162          * Initializes this instance of %Variant with the specified @c long value.
163          *
164          * @since 2.0
165          *
166          * @param[in]   value   A @c long value
167          */
168         Variant(long value);
169
170         /**
171          * Initializes this instance of %Variant with the specified @c unsigned @c long value.
172          *
173          * @since 2.0
174          *
175          * @param[in]   value   An @c unsigned @c long value
176          */
177         Variant(unsigned long value);
178
179         /**
180          * Initializes this instance of %Variant with the specified @c long @c long value.
181          *
182          * @since 2.0
183          *
184          * @param[in]   value   A @c long @c long value
185          */
186         Variant(long long value);
187
188         /**
189          * Initializes this instance of %Variant with the specified @c unsigned @c long @c long value.
190          *
191          * @since 2.0
192          *
193          * @param[in]   value   An @c unsigned @c long @c long value
194          */
195         Variant(unsigned long long value);
196
197         /**
198          * Initializes this instance of %Variant with the specified array of characters.
199          *
200          * @since 2.0
201          *
202          * @param[in]   pValue  An array of characters value
203          */
204         Variant(const char* pValue);
205
206         /**
207          * Initializes this instance of %Variant with the specified array of Unicode characters.
208          *
209          * @since 2.0
210          *
211          * @param[in]   pValue  An array of Unicode characters value
212          */
213         Variant(const wchar_t* pValue);
214
215         /**
216          * Initializes this instance of %Variant with the specified Tizen::Base::String value.
217          *
218          * @since 2.0
219          *
220          * @param[in]   value   A Tizen::Base::String value
221          */
222         Variant(const Tizen::Base::String& value);
223
224         /**
225          * Initializes this instance of %Variant with the specified Tizen::Base::DateTime value.
226          *
227          * @since 2.0
228          *
229          * @param[in]   value   A Tizen::Base::DateTime value
230          */
231         Variant(const Tizen::Base::DateTime& value);
232
233         /**
234          * Initializes this instance of %Variant with the specified Tizen::Graphics::Color value.
235          *
236          * @since 2.0
237          *
238          * @param[in]   value   A Tizen::Graphics::Color value
239          */
240         Variant(const Tizen::Graphics::Color& value);
241
242         /**
243          * Initializes this instance of %Variant with the specified Tizen::Graphics::Point value.
244          *
245          * @since 2.0
246          *
247          * @param[in]   value   A Tizen::Graphics::Point value
248          */
249         Variant(const Tizen::Graphics::Point& value);
250
251         /**
252          * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatPoint value.
253          *
254          * @since 2.0
255          *
256          * @param[in]   value   A Tizen::Graphics::FloatPoint value
257          */
258         Variant(const Tizen::Graphics::FloatPoint& value);
259
260         /**
261          * Initializes this instance of %Variant with the specified Tizen::Graphics::Rectangle value.
262          *
263          * @since 2.0
264          *
265          * @param[in]   value   A Tizen::Graphics::Rectangle value
266          */
267         Variant(const Tizen::Graphics::Rectangle& value);
268
269         /**
270          * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatRectangle value.
271          *
272          * @since 2.0
273          *
274          * @param[in]   value   A Tizen::Graphics::FloatRectangle value
275          */
276         Variant(const Tizen::Graphics::FloatRectangle& value);
277
278         /**
279          * Initializes this instance of %Variant with the specified Tizen::Graphics::Dimension value.
280          *
281          * @since 2.0
282          *
283          * @param[in]   value   A Tizen::Graphics::Dimension value
284          */
285         Variant(const Tizen::Graphics::Dimension& value);
286
287         /**
288          * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatDimension value.
289          *
290          * @since 2.0
291          *
292          * @param[in]   value   A Tizen::Graphics::FloatDimension value
293          */
294         Variant(const Tizen::Graphics::FloatDimension& value);
295
296         /**
297          * Initializes this instance of %Variant with the specified Tizen::Graphics::FloatMatrix4 value.
298          *
299          * @since 2.0
300          *
301          * @param[in]   value   A Tizen::Graphics::FloatMatrix4 value
302          */
303         Variant(const Tizen::Graphics::FloatMatrix4& value);
304
305         /**
306          * Initializes this instance of %Variant with a specified Tizen::Graphics::FloatPoint3 value.
307          *
308          * @since 2.1
309          *
310          * @param[in]    value    A Tizen::Graphics::FloatPoint3 value
311          */
312         Variant(const Tizen::Graphics::FloatPoint3& value);
313
314         /**
315          * Initializes this instance of %Variant with a specified Tizen::Graphics::FloatVector4 value.
316          *
317          * @since 2.1
318          *
319          * @param[in]    value    A Tizen::Graphics::FloatVector4 value
320          */
321         Variant(const Tizen::Graphics::FloatVector4& value);
322
323         /**
324          * This is the destructor for this class.
325          *
326          * @since 2.0
327          */
328         virtual ~Variant(void);
329
330         /**
331          * Assigns the value of the specified instance to the current instance of %Variant.
332          *
333          * @since 2.0
334          *
335          * @return              A reference to the %Variant instance
336          * @param[in]   rhs             An instance of %Variant to copy
337          */
338         Variant& operator =(const Variant& rhs);
339
340         /**
341          * Assigns the value to the current instance of %Variant.
342          *
343          * @since 2.0
344          *
345          * @return              A reference to the %Variant instance
346          * @param[in]   rhs             An @c int value
347          */
348         Variant& operator =(int rhs);
349
350         /**
351          * Assigns the value to the current instance of %Variant.
352          *
353          * @since 2.0
354          *
355          * @return              A reference to the %Variant instance
356          * @param[in]   rhs             An @c unsigned @c int value
357          *
358          */
359         Variant& operator =(unsigned int rhs);
360
361         /**
362          * Assigns the value to the current instance of %Variant.
363          *
364          * @since 2.0
365          * @return              A reference to the %Variant instance
366          * @param[in]   rhs             A @c bool value
367          *
368          */
369         Variant& operator =(bool rhs);
370
371         /**
372          * Assigns the value to the current instance of %Variant.
373          *
374          * @since 2.0
375          *
376          * @return              A reference to the %Variant instance
377          * @param[in]   rhs             A @c float value
378          *
379          */
380         Variant& operator =(float rhs);
381
382         /**
383          * Assigns the value to the current instance of %Variant.
384          *
385          * @since 2.0
386          *
387          * @return              A reference to the %Variant instance
388          * @param[in]   rhs             A @c double value
389          *
390          */
391         Variant& operator =(double rhs);
392
393         /**
394          * Assigns the value to the current instance of %Variant.
395          *
396          * @since 2.0
397          *
398          * @return              A reference to the %Variant instance
399          * @param[in]   rhs             A @c long value
400          *
401          */
402         Variant& operator =(long rhs);
403
404         /**
405          * Assigns the value to the current instance of %Variant.
406          *
407          * @since 2.0
408          *
409          * @return              A reference to the %Variant instance
410          * @param[in]   rhs             An @c unsigned @c long value
411          *
412          */
413         Variant& operator =(unsigned long rhs);
414
415         /**
416          * Assigns the value to the current instance of %Variant.
417          *
418          * @since 2.0
419          *
420          * @return              A reference to the %Variant instance
421          * @param[in]   rhs             A @c long @c long value
422          *
423          */
424         Variant& operator =(long long rhs);
425
426         /**
427          * Assigns the value to the current instance of %Variant.
428          *
429          * @since 2.0
430          * @return              A reference to the %Variant instance
431          * @param[in]   rhs             An @c unsigned @c long @c long value
432          *
433          */
434         Variant& operator =(unsigned long long rhs);
435
436         /**
437          * Assigns the value of the pointer to the current instance of %Variant.
438          *
439          * @since 2.0
440          *
441          * @return              A reference to the %Variant instance
442          * @param[in]   pRhs    A pointer to an array of characters
443          *
444          */
445         Variant& operator =(const char* pRhs);
446
447         /**
448          * Assigns the value of the pointer to the current instance of %Variant.
449          *
450          * @since 2.0
451          *
452          * @return              A reference to the %Variant instance
453          * @param[in]   pRhs    A pointer to an array of Unicode characters
454          *
455          */
456         Variant& operator =(const wchar_t* pRhs);
457
458         /**
459          * Assigns the value of the specified instance of Tizen::Base::String to the current instance of %Variant.
460          *
461          * @since 2.0
462          *
463          * @return              A reference to the %Variant instance
464          * @param[in]   rhs             An instance of Tizen::Base::String
465          */
466         Variant& operator =(const Tizen::Base::String& rhs);
467
468         /**
469          * Assigns the value of the specified instance of Tizen::Base::DateTime to the current instance of %Variant.
470          *
471          * @since 2.0
472          *
473          * @return              A reference to the %Variant instance
474          * @param[in]   rhs             An instance of Tizen::Base::DateTime
475          */
476         Variant& operator =(const Tizen::Base::DateTime& rhs);
477
478         /**
479          * Assigns the value of the specified instance of Tizen::Graphics::Color to the current instance of %Variant.
480          *
481          * @since 2.0
482          * @return              A reference to the %Variant instance
483          * @param[in]   rhs             An instance of Tizen::Graphics::Color
484          */
485         Variant& operator =(const Tizen::Graphics::Color& rhs);
486
487         /**
488          * Assigns the value of the specified instance of Tizen::Graphics::Point to the current instance of %Variant.
489          *
490          * @since 2.0
491          * @return              A reference to the %Variant instance
492          * @param[in]   rhs             An instance of Tizen::Graphics::Point
493          */
494         Variant& operator =(const Tizen::Graphics::Point& rhs);
495
496         /**
497          * Assigns the value of the specified instance of Tizen::Graphics::FloatPoint to the current instance of %Variant.
498          *
499          * @since 2.0
500          * @return              A reference to the %Variant instance
501          * @param[in]   rhs             An instance of Tizen::Graphics::FloatPoint
502          */
503         Variant& operator =(const Tizen::Graphics::FloatPoint& rhs);
504
505         /**
506          * Assigns the value of the specified instance of Tizen::Graphics::Rectangle to the current instance of %Variant.
507          *
508          * @since 2.0
509          * @return              A reference to the %Variant instance
510          * @param[in]   rhs             An instance of Tizen::Graphics::Rectangle
511          */
512         Variant& operator =(const Tizen::Graphics::Rectangle& rhs);
513
514         /**
515          * Assigns the value of the specified instance of Tizen::Graphics::FloatRectangle to the current instance of %Variant.
516          *
517          * @since 2.0
518          * @return              A reference to the %Variant instance
519          * @param[in]   rhs             An instance of Tizen::Graphics::FloatRectangle
520          */
521         Variant& operator =(const Tizen::Graphics::FloatRectangle& rhs);
522
523         /**
524          * Assigns the value of the specified instance of Tizen::Graphics::Dimension to the current instance of %Variant.
525          *
526          * @since 2.0
527          * @return              A reference to the %Variant instance
528          * @param[in]   rhs             An instance of Tizen::Graphics::Dimension
529          */
530         Variant& operator =(const Tizen::Graphics::Dimension& rhs);
531
532         /**
533          * Assigns the value of the specified instance of Tizen::Graphics::FloatDimension to the current instance of %Variant.
534          *
535          * @since 2.0
536          * @return              A reference to the %Variant instance
537          * @param[in]   rhs             An instance of Tizen::Graphics::FloatDimension
538          */
539         Variant& operator =(const Tizen::Graphics::FloatDimension& rhs);
540
541         /**
542          * Assigns the value of the specified instance of Tizen::Graphics::FloatMatrix4 to the current instance of %Variant.
543          *
544          * @since 2.0
545          * @return              A reference to the %Variant instance
546          * @param[in]   rhs             An instance of Tizen::Graphics::FloatMatrix4
547          */
548         Variant& operator =(const Tizen::Graphics::FloatMatrix4& rhs);
549
550         /**
551          * Assigns the value of a specified instance of Tizen::Graphics::FloatPoint3 to the current instance of %Variant.
552          *
553          * @since 2.1
554          * @return                                      A reference to the %Variant instance
555          * @param[in]    rhs                             An instance of Tizen::Graphics::FloatPoint3
556          */
557         Variant& operator =(const Tizen::Graphics::FloatPoint3& rhs);
558
559         /**
560          * Assigns the value of a specified instance of Tizen::Graphics::FloatVecto4 to the current instance of %Variant.
561          *
562          * @since 2.1
563          * @return                                      A reference to the %Variant instance
564          * @param[in]    rhs                             An instance of Tizen::Graphics::FloatVector4
565          */
566         Variant& operator =(const Tizen::Graphics::FloatVector4& rhs);
567
568         /**
569          * Checks whether the specified instance and current instance of %Variant have equal values.
570          *
571          * @since 2.0
572          * @return              @c true if the two instances of %Variant are equal, @n
573          *                              else @c false
574          * @param[in]   lhs             An instance of %Variant
575          * @param[in]   rhs             An instance of %Variant
576          */
577         _OSP_EXPORT_    friend bool operator ==(const Variant& lhs, const Variant& rhs);
578
579         /**
580          * Checks whether the specified instance and current instance of %Variant have different values.
581          * @since 2.0
582          *
583          * @return              @c true if the values of the two instances of %Variant are not equal, @n
584          *                              else @c false
585          * @param[in]   lhs             An instance of %Variant
586          * @param[in]   rhs             An instance of %Variant
587          *
588          */
589         _OSP_EXPORT_    friend bool operator !=(const Variant& lhs, const Variant& rhs);
590
591         /**
592          * Gets the @c signed @c int equivalent of the current instance.
593          *
594          * @since 2.0
595          *
596          * @return              The @c signed @c int equivalent of the current instance
597          * @exception   E_SUCCESS                       The method is successful.
598          * @exception   E_INVALID_OPERATION     The current variant type is not @c VARIANT_TYPE_INT.
599          * @remarks             The specific error code can be accessed using the GetLastResult() method.
600          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_INT.
601          *
602          */
603         int ToInt(void) const;
604
605         /**
606          * Gets the @c unsigned @c int equivalent of the current instance.
607          *
608          * @since 2.0
609          *
610          * @return              The @c unsigned @c int equivalent of the current instance
611          * @exception   E_SUCCESS                               The method is successful.
612          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_UINT.
613          * @remarks             The specific error code can be accessed using the GetLastResult() method.
614          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_UINT.
615          *
616          */
617         unsigned int ToUInt(void) const;
618
619         /**
620          * Gets the @c bool equivalent of the current instance.
621          *
622          * @since 2.0
623          *
624          * @return              The @c bool equivalent of the current instance
625          * @exception   E_SUCCESS                               The method is successful.
626          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_BOOL.
627          * @remarks             The specific error code can be accessed using the GetLastResult() method.
628          *                              The method returns @c false and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_BOOL.
629          *
630          */
631         bool ToBool(void) const;
632
633         /**
634          * Gets the @c float equivalent of the current instance.
635          *
636          * @since 2.0
637          *
638          * @return              The @c float equivalent of the current instance
639          * @exception   E_SUCCESS                               The method is successful.
640          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_FLOAT.
641          * @remarks             The specific error code can be accessed using the GetLastResult() method.
642          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT.
643          *
644          */
645         float ToFloat(void) const;
646
647         /**
648          * Gets the @c double equivalent of the current instance.
649          *
650          * @since 2.0
651          *
652          * @return              The @c double equivalent of the current instance
653          * @exception   E_SUCCESS                               The method is successful.
654          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_DOUBLE.
655          * @remarks             The specific error code can be accessed using the GetLastResult() method.
656          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DOUBLE.
657          *
658          */
659         double ToDouble(void) const;
660
661         /**
662          * Gets the @c signed @c long equivalent of the current instance.
663          *
664          * @since 2.0
665          *
666          * @return              The @c signed @c long equivalent of the current instance
667          * @exception   E_SUCCESS                               The method is successful.
668          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_LONG.
669          * @remarks             The specific error code can be accessed using the GetLastResult() method.
670          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_LONG.
671          *
672          */
673         long ToLong(void) const;
674
675         /**
676          * Gets the @c unsigned @c int equivalent of the current instance.
677          *
678          * @since 2.0
679          *
680          * @return              The @c unsigned @c long equivalent of the current instance
681          * @exception   E_SUCCESS                               The method is successful.
682          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_ULONG.
683          * @remarks             The specific error code can be accessed using the GetLastResult() method.
684          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_ULONG.
685          *
686          */
687         unsigned long ToULong(void) const;
688
689         /**
690          * Gets the @c signed @c long @c long equivalent of the current instance.
691          *
692          * @since 2.0
693          *
694          * @exception   E_SUCCESS                               The method is successful.
695          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_LONGLONG.
696          *
697          * @remarks             The specific error code can be accessed using the GetLastResult() method.
698          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_LONGLONG.
699          *
700          */
701         long long ToLongLong(void) const;
702
703         /**
704          * Gets the @c unsigned @c long @c long equivalent of the current instance.
705          *
706          * @since 2.0
707          *
708          * @return              The @c unsigned @c long @c long equivalent of the current instance
709          * @exception   E_SUCCESS                               The method is successful.
710          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_ULONGLONG.
711          * @remarks             The specific error code can be accessed using the GetLastResult() method.
712          *                              The method returns @c 0 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_ULONGLONG.
713          *
714          */
715         unsigned long long ToULongLong(void) const;
716
717         /**
718          * Gets the Tizen::Base::String representation of the value of the current instance.
719          *
720          * @since 2.0
721          *
722          * @return              A Tizen::Base::String representing the value of the current instance
723          * @exception   E_SUCCESS                               The method is successful.
724          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_STRING.
725          * @remarks             The specific error code can be accessed using the GetLastResult() method.
726          *                              The method returns String("") and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_STRING.
727          *
728          */
729         Tizen::Base::String ToString(void) const;
730
731         /**
732          * Gets the Tizen::Base::DateTime representation of the value of the current instance.
733          *
734          * @since 2.0
735          *
736          * @return              A Tizen::Base::DateTime representing the value of the current instance
737          * @exception   E_SUCCESS                               The method is successful.
738          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_DATETIME.
739          * @remarks             The specific error code can be accessed using the GetLastResult() method.
740          *                              The method returns DateTime and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DATETIME.
741          *
742          */
743         Tizen::Base::DateTime ToDateTime(void) const;
744
745         /**
746          * Gets the Tizen::Graphics::Color representation of the value of the current instance.
747          *
748          * @since 2.0
749          *
750          * @return              A Tizen::Graphics::Color representing the value of the current instance
751          * @exception   E_SUCCESS                               The method is successful.
752          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_COLOR.
753          * @remarks             The specific error code can be accessed using the GetLastResult() method.
754          *                              The method returns Color and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_COLOR.
755          *
756          */
757         Tizen::Graphics::Color ToColor(void) const;
758
759         /**
760          * Gets the Tizen::Graphics::Point representation of the value of the current instance.
761          *
762          * @since 2.0
763          *
764          * @return              A Tizen::Graphics::Point representing the value of the current instance
765          * @exception   E_SUCCESS                               The method is successful.
766          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_POINT.
767          * @remarks             The specific error code can be accessed using the GetLastResult() method.
768          *                              The method returns Point and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_POINT.
769          *
770          */
771         Tizen::Graphics::Point ToPoint(void) const;
772
773         /**
774          * Gets the Tizen::Graphics::FloatPoint representation of the value of the current instance.
775          *
776          * @since 2.0
777          *
778          * @return              A Tizen::Graphics::FloatPoint representing the value of the current instance
779          * @exception   E_SUCCESS                               The method is successful.
780          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_FLOAT_POINT.
781          * @remarks             The specific error code can be accessed using the GetLastResult() method.
782          *                              The method returns FloatPoint and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_POINT.
783          *
784          */
785         Tizen::Graphics::FloatPoint ToFloatPoint(void) const;
786
787         /**
788          * Gets the Tizen::Graphics::Rectangle representation of the value of the current instance.
789          *
790          * @since 2.0
791          *
792          * @return              A Tizen::Graphics::Rectangle representing the value of the current instance
793          * @exception   E_SUCCESS                               The method is successful.
794          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_RECTANGLE.
795          * @remarks             The specific error code can be accessed using the GetLastResult() method.
796          *                              The method returns Rectangle and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_RECTANGLE.
797          *
798          */
799         Tizen::Graphics::Rectangle ToRectangle(void) const;
800
801         /**
802          * Gets the Tizen::Graphics::FloatRectangle representation of the value of the current instance.
803          *
804          * @since 2.0
805          *
806          * @return              A Tizen::Graphics::FloatRectangle representing the value of the current instance
807          * @exception   E_SUCCESS                               The method is successful.
808          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_FLOAT_RECTANGLE.
809          * @remarks             The specific error code can be accessed using the GetLastResult() method.
810          *                              The method returns FloatRectangle and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_RECTANGLE.
811          *
812          */
813         Tizen::Graphics::FloatRectangle ToFloatRectangle(void) const;
814
815         /**
816          * Gets the Tizen::Graphics::Dimension representation of the value of the current instance.
817          *
818          * @since 2.0
819          *
820          * @return              A Tizen::Graphics::Dimension representing the value of the current instance
821          * @exception   E_SUCCESS                               The method is successful.
822          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_DIMENSION.
823          * @remarks             The specific error code can be accessed using the GetLastResult() method.
824          *                              The method returns Dimension and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_DIMENSION.
825          *
826          */
827         Tizen::Graphics::Dimension ToDimension(void) const;
828
829         /**
830          * Gets the Tizen::Graphics::FloatDimension representation of the value of the current instance.
831          *
832          * @since 2.0
833          *
834          * @return              A Tizen::Graphics::FloatDimension representing the value of the current instance
835          * @exception   E_SUCCESS                               The method is successful.
836          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_FLOAT_DIMENSION.
837          * @remarks             The specific error code can be accessed using the GetLastResult() method.
838          *                              The method returns FloatDimension and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_DIMENSION.
839          *
840          */
841         Tizen::Graphics::FloatDimension ToFloatDimension(void) const;
842
843         /**
844          * Gets the Tizen::Graphics::FloatMatrix4 representation of the value of the current instance.
845          *
846          * @since 2.0
847          *
848          * @return              A Tizen::Graphics::FloatMatrix4 representing the value of the current instance
849          * @exception   E_SUCCESS                               The method is successful.
850          * @exception   E_INVALID_OPERATION             The current variant type is not @c VARIANT_TYPE_FLOAT_MATRIX4.
851          * @remarks             The specific error code can be accessed using the GetLastResult() method.
852          *                              The method returns FloatMatrix4() and generates E_INVALID_OPERATION exception if the current variant type is not VARIANT_TYPE_FLOAT_MATRIX4.
853          *
854          */
855         Tizen::Graphics::FloatMatrix4 ToFloatMatrix4(void) const;
856
857         /**
858          * Gets the Tizen::Graphics::FloatPoint3 representation of the value of the current instance.
859          *
860          * @since 2.1
861          *
862          * @return              A Tizen::Graphics::FloatPoint3 representing the value of the current instance
863          * @exception    E_SUCCESS                              The method is successful.
864          * @exception    E_INVALID_OPERATION    The current variant type is not @c VARIANT_TYPE_FLOAT_POINT3.
865          * @remarks             The specific error code can be accessed using the GetLastResult() method.
866          *                              The method returns FloatPoint3 and generates @c E_INVALID_OPERATION exception if the current variant type is not @c VARIANT_TYPE_FLOAT_POINT3.
867          *
868          */
869         Tizen::Graphics::FloatPoint3 ToFloatPoint3(void) const;
870
871         /**
872          * Gets the Tizen::Graphics::FloatVector4 representation of the value of the current instance.
873          *
874          * @since 2.1
875          *
876          * @return              A Tizen::Graphics::FloatVector4 representing the value of the current instance
877          * @exception    E_SUCCESS                              The method is successful.
878          * @exception    E_INVALID_OPERATION    The current variant type is not @c VARIANT_TYPE_FLOAT_VECTOR4.
879          * @remarks             The specific error code can be accessed using the GetLastResult() method.
880          *                              The method returns FloatVector4() and generates E_INVALID_OPERATION exception if the current variant type is not VARIANT_TYPE_FLOAT_VECTOR4.
881          *
882          */
883         Tizen::Graphics::FloatVector4 ToFloatVector4(void) const;
884
885         /**
886          * Checks whether the variant is empty.
887          *
888          * @since 2.0
889          *
890          * @return              @c true if the current instance is NULL_VARIANT, @n
891          *                              else @c false
892          */
893         bool IsEmpty(void) const;
894
895         /**
896          * Gets the type of the variant.
897          *
898          * @since 2.0
899          *
900          * @return              The variant type
901          */
902         VariantType GetType(void) const;
903
904         /**
905          * Checks whether the current instance of %Variant equals the specified instance of %Variant.
906          *
907          * @since 2.0
908          *
909          * @return              @c true if the values of the current instance is equal to the value of the specified instance, @n
910          *                              else @c false
911          * @param[in]   obj             An instance of %Variant
912          * @remarks             This method overrides Tizen::Base::Object::Equals(). This method uses the values of the %Variant to compare the two instances.
913          */
914         virtual bool Equals(const Object& obj) const;
915
916         /**
917          * Gets the hash value of the current instance.
918          *
919          * @since 2.0
920          *
921          * @return              The hash value of the current instance
922          * @remarks             Two equal instances must return the same hash value. For better performance, the used hash function must generate a random distribution for all inputs.
923          */
924         virtual int GetHashCode(void) const;
925
926 public:
927         /**
928          * A constant represents a @c null value.
929          *
930          * @since 2.0
931          */
932         static const Variant NULL_VARIANT;
933
934         //
935         // This method is for internal use only.
936         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
937         //
938         // This method is prohibited. If this method is used in an application, the application can get rejected during
939         // the certification process.
940         //
941         // @since 2.0
942         //
943         const _VariantImpl* GetVariantImpl(void) const;
944
945         //
946         // This method is for internal use only.
947         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
948         //
949         // This method is prohibited. If this method is used in an application, the application can get rejected during
950         // the certification process.
951         //
952         // @since 2.0
953         //
954         _VariantImpl* GetVariantImpl(void);
955
956 private:
957         _VariantImpl* __pVariantImpl;
958 }; // Variant
959
960 } } // Tizen::Ui
961
962 #endif // _FUI_VARIANT_H_