modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUiVariant.cpp
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  * @file                FUIVariant.cpp
19  * @brief               This is the implementation file for Variant class.
20  */
21
22 // Includes
23 #include <FUiVariant.h>
24 #include <FBaseErrors.h>
25 #include <FBaseDateTime.h>
26 #include <FBaseString.h>
27 #include <FBaseStringComparer.h>
28 #include <FGrpFloatMatrix4.h>
29 #include <FGrpRectangle.h>
30 #include <FGrpDimension.h>
31 #include <FGrpPoint.h>
32 #include <FGrpColor.h>
33 #include <FGrpFloatPoint.h>
34 #include <FGrpFloatRectangle.h>
35 #include <FGrpFloatDimension.h>
36 #include <FGrpFloatPoint3.h>
37 #include <FGrpFloatVector4.h>
38 #include <FBaseSysLog.h>
39 #include "FUi_VariantImpl.h"
40
41 using namespace Tizen::Base;
42 using namespace Tizen::Graphics;
43
44 namespace Tizen { namespace Ui
45 {
46
47 const Variant Variant::NULL_VARIANT;
48
49 Variant::Variant(void)
50         : __pVariantImpl(null)
51 {
52         __pVariantImpl = new (std::nothrow) _VariantImpl;
53         if (__pVariantImpl == null)
54         {
55                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
56         }
57 }
58
59 Variant::~Variant(void)
60 {
61         if (__pVariantImpl)
62         {
63                 __pVariantImpl->Release();
64         }
65
66         __pVariantImpl = null;
67 }
68
69 Variant::Variant(const Variant& value)
70         : __pVariantImpl(null)
71 {
72         SysAssertf(value.__pVariantImpl, "No data in rhs for copy ctor");
73         __pVariantImpl = value.__pVariantImpl;
74         __pVariantImpl->AddRef();
75 }
76
77 Variant::Variant(int value)
78         : __pVariantImpl(null)
79 {
80         __pVariantImpl = new (std::nothrow) _VariantImpl;
81         if (__pVariantImpl == null)
82         {
83                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
84         }
85         else
86         {
87                 __pVariantImpl->__type = VARIANT_TYPE_INT;
88                 __pVariantImpl->__data.valueInt = 0;
89                 __pVariantImpl->__data.valueInt = value;
90         }
91 }
92
93 Variant::Variant(unsigned int value)
94         : __pVariantImpl(null)
95 {
96         __pVariantImpl = new (std::nothrow) _VariantImpl;
97         if (__pVariantImpl == null)
98         {
99                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
100         }
101         else
102         {
103                 __pVariantImpl->__type = VARIANT_TYPE_UINT;
104                 __pVariantImpl->__data.valueUInt = 0;
105                 __pVariantImpl->__data.valueUInt = value;
106         }
107 }
108
109 Variant::Variant(bool value)
110         : __pVariantImpl(null)
111 {
112         __pVariantImpl = new (std::nothrow) _VariantImpl;
113         if (__pVariantImpl == null)
114         {
115                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
116         }
117         else
118         {
119                 __pVariantImpl->__type = VARIANT_TYPE_BOOL;
120                 __pVariantImpl->__data.valueBool = true;
121                 __pVariantImpl->__data.valueBool = value;
122         }
123 }
124
125 Variant::Variant(float value)
126         : __pVariantImpl(null)
127 {
128         __pVariantImpl = new (std::nothrow) _VariantImpl;
129         if (__pVariantImpl == null)
130         {
131                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
132         }
133         else
134         {
135                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT;
136                 __pVariantImpl->__data.valueFloat = 0;
137                 __pVariantImpl->__data.valueFloat = value;
138         }
139 }
140
141 Variant::Variant(double value)
142         : __pVariantImpl(null)
143 {
144         __pVariantImpl = new (std::nothrow) _VariantImpl;
145         if (__pVariantImpl == null)
146         {
147                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
148         }
149         else
150         {
151                 __pVariantImpl->__type = VARIANT_TYPE_DOUBLE;
152                 __pVariantImpl->__data.valueDouble = 0;
153                 __pVariantImpl->__data.valueDouble = value;
154         }
155 }
156
157 Variant::Variant(long value)
158         : __pVariantImpl(null)
159 {
160         __pVariantImpl = new (std::nothrow) _VariantImpl;
161         if (__pVariantImpl == null)
162         {
163                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
164         }
165         else
166         {
167                 __pVariantImpl->__type = VARIANT_TYPE_LONG;
168                 __pVariantImpl->__data.valueLong = 0;
169                 __pVariantImpl->__data.valueLong = value;
170         }
171 }
172
173 Variant::Variant(unsigned long value)
174         : __pVariantImpl(null)
175 {
176         __pVariantImpl = new (std::nothrow) _VariantImpl;
177         if (__pVariantImpl == null)
178         {
179                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
180         }
181         else
182         {
183                 __pVariantImpl->__type = VARIANT_TYPE_ULONG;
184                 __pVariantImpl->__data.valueULong = 0;
185                 __pVariantImpl->__data.valueULong = value;
186         }
187 }
188
189 Variant::Variant(long long value)
190         : __pVariantImpl(null)
191 {
192         __pVariantImpl = new (std::nothrow) _VariantImpl;
193         if (__pVariantImpl == null)
194         {
195                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
196         }
197         else
198         {
199                 __pVariantImpl->__type = VARIANT_TYPE_LONGLONG;
200                 __pVariantImpl->__data.valueLongLong = 0;
201                 __pVariantImpl->__data.valueLongLong = value;
202         }
203 }
204
205 Variant::Variant(unsigned long long value)
206         : __pVariantImpl(null)
207 {
208         __pVariantImpl = new (std::nothrow) _VariantImpl;
209         if (__pVariantImpl == null)
210         {
211                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
212         }
213         else
214         {
215                 __pVariantImpl->__type = VARIANT_TYPE_ULONGLONG;
216                 __pVariantImpl->__data.valueULongLong = 0;
217                 __pVariantImpl->__data.valueULongLong = value;
218         }
219 }
220
221 Variant::Variant(const char* pValue)
222         : __pVariantImpl(null)
223 {
224         __pVariantImpl = new (std::nothrow) _VariantImpl;
225         if (__pVariantImpl == null)
226         {
227                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
228         }
229         else
230         {
231                 __pVariantImpl->__type = VARIANT_TYPE_STRING;
232                 __pVariantImpl->__data.pString = null;
233                 __pVariantImpl->__data.pString = new (std::nothrow) String(pValue);
234         }
235 }
236
237 Variant::Variant(const wchar_t* pValue)
238         : __pVariantImpl(null)
239 {
240         __pVariantImpl = new (std::nothrow) _VariantImpl;
241         if (__pVariantImpl == null)
242         {
243                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
244         }
245         else
246         {
247                 __pVariantImpl->__type = VARIANT_TYPE_STRING;
248                 __pVariantImpl->__data.pString = null;
249                 __pVariantImpl->__data.pString = new (std::nothrow) String(pValue);
250         }
251 }
252
253 Variant::Variant(const String& value)
254         : __pVariantImpl(null)
255 {
256         __pVariantImpl = new (std::nothrow) _VariantImpl;
257         if (__pVariantImpl == null)
258         {
259                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
260         }
261         else
262         {
263                 __pVariantImpl->__type = VARIANT_TYPE_STRING;
264                 __pVariantImpl->__data.pString = null;
265                 __pVariantImpl->__data.pString = new (std::nothrow) String(value);
266         }
267 }
268
269 Variant::Variant(const DateTime& value)
270         : __pVariantImpl(null)
271 {
272         __pVariantImpl = new (std::nothrow) _VariantImpl;
273         if (__pVariantImpl == null)
274         {
275                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
276         }
277         else
278         {
279                 __pVariantImpl->__type = VARIANT_TYPE_DATETIME;
280                 __pVariantImpl->__data.pDateTime = null;
281                 __pVariantImpl->__data.pDateTime = new (std::nothrow) DateTime(value);
282         }
283 }
284
285 Variant::Variant(const Color& value)
286         : __pVariantImpl(null)
287 {
288         __pVariantImpl = new (std::nothrow) _VariantImpl;
289         if (__pVariantImpl == null)
290         {
291                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
292         }
293         else
294         {
295                 __pVariantImpl->__type = VARIANT_TYPE_COLOR;
296                 __pVariantImpl->__data.pColor = null;
297                 __pVariantImpl->__data.pColor = new (std::nothrow) Color(value);
298         }
299 }
300
301 Variant::Variant(const Point& value)
302         : __pVariantImpl(null)
303 {
304         __pVariantImpl = new (std::nothrow) _VariantImpl;
305         if (__pVariantImpl == null)
306         {
307                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
308         }
309         else
310         {
311                 __pVariantImpl->__type = VARIANT_TYPE_POINT;
312                 __pVariantImpl->__data.pPoint = null;
313                 __pVariantImpl->__data.pPoint = new (std::nothrow) Point(value);
314         }
315 }
316
317 Variant::Variant(const FloatPoint& value)
318         : __pVariantImpl(null)
319 {
320         __pVariantImpl = new (std::nothrow) _VariantImpl;
321         if (__pVariantImpl == null)
322         {
323                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
324         }
325         else
326         {
327                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT_POINT;
328                 __pVariantImpl->__data.pFloatPoint = null;
329                 __pVariantImpl->__data.pFloatPoint = new (std::nothrow) FloatPoint(value);
330         }
331 }
332
333 Variant::Variant(const Rectangle& value)
334         : __pVariantImpl(null)
335 {
336         __pVariantImpl = new (std::nothrow) _VariantImpl;
337         if (__pVariantImpl == null)
338         {
339                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
340         }
341         else
342         {
343                 __pVariantImpl->__type = VARIANT_TYPE_RECTANGLE;
344                 __pVariantImpl->__data.pRect = null;
345                 __pVariantImpl->__data.pRect = new (std::nothrow) Rectangle(value);
346         }
347 }
348
349 Variant::Variant(const FloatRectangle& value)
350         : __pVariantImpl(null)
351 {
352         __pVariantImpl = new (std::nothrow) _VariantImpl;
353         if (__pVariantImpl == null)
354         {
355                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
356         }
357         else
358         {
359                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT_RECTANGLE;
360                 __pVariantImpl->__data.pRectf = null;
361                 __pVariantImpl->__data.pRectf = new (std::nothrow) FloatRectangle(value);
362         }
363 }
364
365 Variant::Variant(const Dimension& value)
366         : __pVariantImpl(null)
367 {
368         __pVariantImpl = new (std::nothrow) _VariantImpl;
369         if (__pVariantImpl == null)
370         {
371                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
372         }
373         else
374         {
375                 __pVariantImpl->__type = VARIANT_TYPE_DIMENSION;
376                 __pVariantImpl->__data.pDimension = null;
377                 __pVariantImpl->__data.pDimension = new (std::nothrow) Dimension(value);
378         }
379 }
380
381 Variant::Variant(const FloatDimension& value)
382         : __pVariantImpl(null)
383 {
384         __pVariantImpl = new (std::nothrow) _VariantImpl;
385         if (__pVariantImpl == null)
386         {
387                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
388         }
389         else
390         {
391                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT_DIMENSION;
392                 __pVariantImpl->__data.pFloatDimension = null;
393                 __pVariantImpl->__data.pFloatDimension = new (std::nothrow) FloatDimension(value);
394         }
395 }
396
397 Variant::Variant(const FloatMatrix4& value)
398         : __pVariantImpl(null)
399 {
400         __pVariantImpl = new (std::nothrow) _VariantImpl;
401         if (__pVariantImpl == null)
402         {
403                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
404         }
405         else
406         {
407                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT_MATRIX4;
408                 __pVariantImpl->__data.pFloatMatrix4 = null;
409                 __pVariantImpl->__data.pFloatMatrix4 = new (std::nothrow) FloatMatrix4(value);
410         }
411 }
412
413 Variant::Variant(const Tizen::Graphics::FloatPoint3& value)
414         : __pVariantImpl(null)
415 {
416         __pVariantImpl = new (std::nothrow) _VariantImpl;
417         if (__pVariantImpl == null)
418         {
419                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
420         }
421         else
422         {
423                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT_POINT3;
424                 __pVariantImpl->__data.pFloatPoint3 = null;
425                 __pVariantImpl->__data.pFloatPoint3 = new (std::nothrow) FloatPoint3(value);
426         }
427 }
428
429 Variant::Variant(const Tizen::Graphics::FloatVector4& value)
430         : __pVariantImpl(null)
431 {
432         __pVariantImpl = new (std::nothrow) _VariantImpl;
433         if (__pVariantImpl == null)
434         {
435                 SysLogException(NID_UI, E_SYSTEM, "[E_OUT_OF_MEMORY] pImpl is null.");
436         }
437         else
438         {
439                 __pVariantImpl->__type = VARIANT_TYPE_FLOAT_VECTOR4;
440                 __pVariantImpl->__data.pFloatVector4 = null;
441                 __pVariantImpl->__data.pFloatVector4 = new (std::nothrow) FloatVector4(value);
442         }
443 }
444
445 // Assignment Operators
446 Variant&
447 Variant::operator =(const Variant& rhs)
448 {
449         if (&rhs != this)
450         {
451                 if (__pVariantImpl && rhs.__pVariantImpl && __pVariantImpl != rhs.__pVariantImpl)
452                 {
453                         __pVariantImpl->Release();
454                         __pVariantImpl = rhs.__pVariantImpl;
455                         __pVariantImpl->AddRef();
456                 }
457         }
458         return (*this);
459 }
460
461 #define CREATE_VARIANT_IMPL(type, member, value) \
462         do { \
463                 if (!__pVariantImpl || __pVariantImpl->__type != type) \
464                 { \
465                         _VariantImpl* pImpl = new (std::nothrow) _VariantImpl; \
466                         if (likely(pImpl)) \
467                         { \
468                                 pImpl->__type = type; \
469                                 pImpl->__data.member = value; \
470                                 delete __pVariantImpl; \
471                                 __pVariantImpl = pImpl; \
472                         } \
473                 } \
474                 else \
475                 { \
476                         /* __pVariantImpl != null && __pVariantImpl->__type == type */ \
477                         __pVariantImpl->__data.member = value; \
478                 } \
479         } while (0);
480
481 #define CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(type, member, value) \
482         do { \
483                 if (!__pVariantImpl || __pVariantImpl->__type != type) \
484                 { \
485                         _VariantImpl* pImpl = new (std::nothrow) _VariantImpl; \
486                         if (likely(pImpl)) \
487                         { \
488                                 pImpl->__type = type; \
489                                 pImpl->__data.member = value; \
490                                 delete __pVariantImpl; \
491                                 __pVariantImpl = pImpl; \
492                         } \
493                 } \
494                 else \
495                 { \
496                         /* __pVariantImpl != null && __pVariantImpl->__type == type */ \
497                         delete __pVariantImpl->__data.member; \
498                         __pVariantImpl->__data.member = value; \
499                 } \
500         } while (0);
501
502 Variant&
503 Variant::operator =(int rhs)
504 {
505         CREATE_VARIANT_IMPL(VARIANT_TYPE_INT, valueInt, rhs);
506
507         return (*this);
508 }
509
510 Variant&
511 Variant::operator =(unsigned int rhs)
512 {
513         CREATE_VARIANT_IMPL(VARIANT_TYPE_UINT, valueUInt, rhs);
514
515         return (*this);
516 }
517
518 Variant&
519 Variant::operator =(bool rhs)
520 {
521         CREATE_VARIANT_IMPL(VARIANT_TYPE_BOOL, valueBool, rhs);
522
523         return (*this);
524 }
525
526 Variant&
527 Variant::operator =(float rhs)
528 {
529         CREATE_VARIANT_IMPL(VARIANT_TYPE_FLOAT, valueFloat, rhs);
530
531         return (*this);
532 }
533
534 Variant&
535 Variant::operator =(double rhs)
536 {
537         CREATE_VARIANT_IMPL(VARIANT_TYPE_DOUBLE, valueDouble, rhs);
538
539         return (*this);
540 }
541
542 Variant&
543 Variant::operator =(long rhs)
544 {
545         CREATE_VARIANT_IMPL(VARIANT_TYPE_LONG, valueLong, rhs);
546
547         return (*this);
548 }
549
550 Variant&
551 Variant::operator =(unsigned long rhs)
552 {
553         CREATE_VARIANT_IMPL(VARIANT_TYPE_ULONG, valueULong, rhs);
554
555         return (*this);
556 }
557
558 Variant&
559 Variant::operator =(long long rhs)
560 {
561         CREATE_VARIANT_IMPL(VARIANT_TYPE_LONGLONG, valueLongLong, rhs);
562
563         return (*this);
564 }
565
566 Variant&
567 Variant::operator =(unsigned long long rhs)
568 {
569         CREATE_VARIANT_IMPL(VARIANT_TYPE_ULONGLONG, valueLongLong, rhs);
570
571         return (*this);
572 }
573
574 Variant&
575 Variant::operator =(const char* pRhs)
576 {
577         String* pString = new (std::nothrow) String(pRhs);
578         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_STRING, pString, pString);
579
580         return (*this);
581 }
582
583 Variant&
584 Variant::operator =(const wchar_t* pRhs)
585 {
586         String* pString = new (std::nothrow) String(pRhs);
587         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_STRING, pString, pString);
588
589         return (*this);
590 }
591
592 Variant&
593 Variant::operator =(const String& rhs)
594 {
595         String* pString = new (std::nothrow) String(rhs);
596         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_STRING, pString, pString);
597
598         return (*this);
599 }
600
601 Variant&
602 Variant::operator =(const DateTime& rhs)
603 {
604         DateTime* pDateTime = new (std::nothrow) DateTime(rhs);
605         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_DATETIME, pDateTime, pDateTime);
606
607         return (*this);
608 }
609
610 Variant&
611 Variant::operator =(const Color& rhs)
612 {
613         Color* pColor = new (std::nothrow) Color(rhs);
614         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_COLOR, pColor, pColor);
615
616         return (*this);
617 }
618
619 Variant&
620 Variant::operator =(const Point& rhs)
621 {
622         Point* pPoint = new (std::nothrow) Point(rhs);
623         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_POINT, pPoint, pPoint);
624
625         return (*this);
626 }
627
628 Variant&
629 Variant::operator =(const FloatPoint& rhs)
630 {
631         FloatPoint* pFloatPoint = new (std::nothrow) FloatPoint(rhs);
632         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_POINT, pFloatPoint, pFloatPoint);
633
634         return (*this);
635 }
636
637 Variant&
638 Variant::operator =(const Rectangle& rhs)
639 {
640         Rectangle* pRectangle = new (std::nothrow) Rectangle(rhs);
641         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_RECTANGLE, pRect, pRectangle);
642
643         return (*this);
644 }
645
646 Variant&
647 Variant::operator =(const FloatRectangle& rhs)
648 {
649         FloatRectangle* pFloatRectangle = new (std::nothrow) FloatRectangle(rhs);
650         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_RECTANGLE, pRectf, pFloatRectangle);
651
652         return (*this);
653 }
654
655 Variant&
656 Variant::operator =(const Dimension& rhs)
657 {
658
659         Dimension* pDimension = new (std::nothrow) Dimension(rhs);
660         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_DIMENSION, pDimension, pDimension);
661
662         return (*this);
663 }
664
665 Variant&
666 Variant::operator =(const FloatDimension& rhs)
667 {
668         FloatDimension* pFloatDimension = new (std::nothrow) FloatDimension(rhs);
669         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_DIMENSION, pFloatDimension, pFloatDimension);
670
671         return (*this);
672 }
673
674 Variant&
675 Variant::operator =(const FloatMatrix4& rhs)
676 {
677         FloatMatrix4* pFloatMatrix4 = new (std::nothrow) FloatMatrix4(rhs);
678         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_MATRIX4, pFloatMatrix4, pFloatMatrix4);
679
680         return (*this);
681 }
682
683 Variant&
684 Variant::operator =(const Tizen::Graphics::FloatPoint3& rhs)
685 {
686         FloatPoint3* pFloatPoint3 = new (std::nothrow) FloatPoint3(rhs);
687         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_POINT3, pFloatPoint3, pFloatPoint3);
688
689         return (*this);
690 }
691
692 Variant&
693 Variant::operator =(const Tizen::Graphics::FloatVector4& rhs)
694 {
695         FloatVector4* pFloatVector4 = new (std::nothrow) FloatVector4(rhs);
696         CREATE_VARIANT_IMPL_DELETE_PREVIOUS_VALE(VARIANT_TYPE_FLOAT_VECTOR4, pFloatVector4, pFloatVector4);
697
698         return (*this);
699 }
700
701 bool
702 operator ==(const Variant& lhs, const Variant& rhs)
703 {
704         const _VariantImpl* pLhsImpl = lhs.GetVariantImpl();
705         const _VariantImpl* pRhsImpl = rhs.GetVariantImpl();
706
707         if (pLhsImpl == null || pRhsImpl == null)
708         {
709                 return false;
710         }
711
712         if (pLhsImpl == pRhsImpl)
713         {
714                 return true;
715         }
716
717         if (pLhsImpl->__type != pRhsImpl->__type)
718         {
719                 return false;
720         }
721
722         switch (pLhsImpl->__type)
723         {
724         case VARIANT_TYPE_INT:
725                 return pLhsImpl->__data.valueInt == pRhsImpl->__data.valueInt;
726
727         case VARIANT_TYPE_UINT:
728                 return pLhsImpl->__data.valueUInt == pRhsImpl->__data.valueUInt;
729
730         case VARIANT_TYPE_BOOL:
731                 return pLhsImpl->__data.valueBool == pRhsImpl->__data.valueBool;
732
733         case VARIANT_TYPE_FLOAT:
734                 return pLhsImpl->__data.valueFloat == pRhsImpl->__data.valueFloat;
735
736         case VARIANT_TYPE_DOUBLE:
737                 return pLhsImpl->__data.valueDouble == pRhsImpl->__data.valueDouble;
738
739         case VARIANT_TYPE_LONG:
740                 return pLhsImpl->__data.valueLong == pRhsImpl->__data.valueLong;
741
742         case VARIANT_TYPE_ULONG:
743                 return pLhsImpl->__data.valueULong == pRhsImpl->__data.valueULong;
744
745         case VARIANT_TYPE_LONGLONG:
746                 return pLhsImpl->__data.valueLongLong == pRhsImpl->__data.valueLongLong;
747
748         case VARIANT_TYPE_ULONGLONG:
749                 return pLhsImpl->__data.valueULongLong == pRhsImpl->__data.valueULongLong;
750
751         case VARIANT_TYPE_STRING:
752         {
753                 if (pLhsImpl->__data.pString)
754                 {
755                         return (*pLhsImpl->__data.pString == *pRhsImpl->__data.pString);
756                 }
757                 else
758                 {
759                         return false;
760                 }
761         }
762
763         case VARIANT_TYPE_DATETIME:
764         {
765                 if (pLhsImpl->__data.pDateTime)
766                 {
767                         return *pLhsImpl->__data.pDateTime == *pRhsImpl->__data.pDateTime;
768                 }
769                 else
770                 {
771                         return false;
772                 }
773         }
774
775         case VARIANT_TYPE_COLOR:
776         {
777                 if (pLhsImpl->__data.pColor)
778                 {
779                         return *pLhsImpl->__data.pColor == *pRhsImpl->__data.pColor;
780                 }
781                 else
782                 {
783                         return false;
784                 }
785         }
786
787         case VARIANT_TYPE_POINT:
788         {
789                 if (pLhsImpl->__data.pPoint)
790                 {
791                         return *pLhsImpl->__data.pPoint == *pRhsImpl->__data.pPoint;
792                 }
793                 else
794                 {
795                         return false;
796                 }
797         }
798
799         case VARIANT_TYPE_FLOAT_POINT:
800         {
801                 if (pLhsImpl->__data.pFloatPoint)
802                 {
803                         return *pLhsImpl->__data.pFloatPoint == *pRhsImpl->__data.pFloatPoint;
804                 }
805                 else
806                 {
807                         return false;
808                 }
809         }
810
811         case VARIANT_TYPE_RECTANGLE:
812         {
813                 if (pLhsImpl->__data.pRect)
814                 {
815                         return *pLhsImpl->__data.pRect == *pRhsImpl->__data.pRect;
816                 }
817                 else
818                 {
819                         return false;
820                 }
821         }
822
823         case VARIANT_TYPE_FLOAT_RECTANGLE:
824         {
825                 if (pLhsImpl->__data.pRectf)
826                 {
827                         return *pLhsImpl->__data.pRectf == *pRhsImpl->__data.pRectf;
828                 }
829                 else
830                 {
831                         return false;
832                 }
833         }
834
835         case VARIANT_TYPE_DIMENSION:
836         {
837                 if (pLhsImpl->__data.pDimension)
838                 {
839                         return *pLhsImpl->__data.pDimension == *pRhsImpl->__data.pDimension;
840                 }
841                 else
842                 {
843                         return false;
844                 }
845         }
846
847         case VARIANT_TYPE_FLOAT_DIMENSION:
848         {
849                 if (pLhsImpl->__data.pFloatDimension)
850                 {
851                         return *pLhsImpl->__data.pFloatDimension == *pRhsImpl->__data.pFloatDimension;
852                 }
853                 else
854                 {
855                         return false;
856                 }
857         }
858
859         case VARIANT_TYPE_FLOAT_MATRIX4:
860         {
861                 if (pLhsImpl->__data.pFloatMatrix4)
862                 {
863                         return *pLhsImpl->__data.pFloatMatrix4 == *pRhsImpl->__data.pFloatMatrix4;
864                 }
865                 else
866                 {
867                         return false;
868                 }
869         }
870
871         case VARIANT_TYPE_FLOAT_POINT3:
872         {
873                 if (pLhsImpl->__data.pFloatPoint3)
874                 {
875                         return *pLhsImpl->__data.pFloatPoint3 == *pRhsImpl->__data.pFloatPoint3;
876                 }
877                 else
878                 {
879                         return false;
880                 }
881         }
882
883         case VARIANT_TYPE_FLOAT_VECTOR4:
884         {
885                 if (pLhsImpl->__data.pFloatVector4)
886                 {
887                         return *pLhsImpl->__data.pFloatVector4 == *pRhsImpl->__data.pFloatVector4;
888                 }
889                 else
890                 {
891                         return false;
892                 }
893         }
894
895         case VARIANT_TYPE_NONE:
896                 return pLhsImpl->__type == pRhsImpl->__type;
897
898         default:
899                 return false;
900         }
901
902         return false;
903 }
904
905 bool
906 operator !=(const Variant& lhs, const Variant& rhs)
907 {
908         return !(lhs == rhs);
909 }
910
911 int
912 Variant::ToInt(void) const
913 {
914         const _VariantImpl* pImpl = GetVariantImpl();
915         if (pImpl)
916         {
917                 if (!pImpl->IsSameType(VARIANT_TYPE_INT))
918                 {
919                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_INT.");
920                 }
921                 else
922                 {
923                         return pImpl->__data.valueInt;
924                 }
925         }
926
927         return 0;
928 }
929
930 unsigned int
931 Variant::ToUInt(void) const
932 {
933         const _VariantImpl* pImpl = GetVariantImpl();
934         if (pImpl)
935         {
936                 if (!pImpl->IsSameType(VARIANT_TYPE_UINT))
937                 {
938                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_UINT.");
939                 }
940                 else
941                 {
942                         return pImpl->__data.valueUInt;
943                 }
944         }
945         return 0;
946 }
947
948 bool
949 Variant::ToBool(void) const
950 {
951         const _VariantImpl* pImpl = GetVariantImpl();
952         if (pImpl)
953         {
954                 if (!pImpl->IsSameType(VARIANT_TYPE_BOOL))
955                 {
956                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_BOOL.");
957                 }
958                 else
959                 {
960                         return pImpl->__data.valueBool;
961                 }
962         }
963
964         return false;
965 }
966
967 float
968 Variant::ToFloat(void) const
969 {
970         const _VariantImpl* pImpl = GetVariantImpl();
971         if (pImpl)
972         {
973                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT))
974                 {
975                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT.");
976                 }
977                 else
978                 {
979                         return pImpl->__data.valueFloat;
980                 }
981         }
982
983         return 0;
984 }
985
986 double
987 Variant::ToDouble(void) const
988 {
989         const _VariantImpl* pImpl = GetVariantImpl();
990         if (pImpl)
991         {
992                 if (!pImpl->IsSameType(VARIANT_TYPE_DOUBLE))
993                 {
994                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_DOUBLE.");
995                 }
996                 else
997                 {
998                         return pImpl->__data.valueDouble;
999                 }
1000         }
1001
1002         return 0;
1003 }
1004
1005 long
1006 Variant::ToLong(void) const
1007 {
1008         const _VariantImpl* pImpl = GetVariantImpl();
1009         if (pImpl)
1010         {
1011                 if (!pImpl->IsSameType(VARIANT_TYPE_LONG))
1012                 {
1013                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_LONG.");
1014                 }
1015                 else
1016                 {
1017                         return pImpl->__data.valueLong;
1018                 }
1019         }
1020
1021         return 0;
1022 }
1023
1024 unsigned long
1025 Variant::ToULong(void) const
1026 {
1027         const _VariantImpl* pImpl = GetVariantImpl();
1028         if (pImpl)
1029         {
1030                 if (!pImpl->IsSameType(VARIANT_TYPE_ULONG))
1031                 {
1032                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_ULONG.");
1033                 }
1034                 else
1035                 {
1036                         return pImpl->__data.valueULong;
1037                 }
1038         }
1039
1040         return 0;
1041 }
1042
1043 long long
1044 Variant::ToLongLong(void) const
1045 {
1046         const _VariantImpl* pImpl = GetVariantImpl();
1047         if (pImpl)
1048         {
1049                 if (!pImpl->IsSameType(VARIANT_TYPE_LONGLONG))
1050                 {
1051                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_LONGLONG.");
1052                 }
1053                 else
1054                 {
1055                         return pImpl->__data.valueLongLong;
1056                 }
1057         }
1058
1059         return 0;
1060 }
1061
1062 unsigned long long
1063 Variant::ToULongLong(void) const
1064 {
1065         const _VariantImpl* pImpl = GetVariantImpl();
1066         if (pImpl)
1067         {
1068                 if (!pImpl->IsSameType(VARIANT_TYPE_ULONGLONG))
1069                 {
1070                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_ULONGLONG.");
1071                 }
1072                 else
1073                 {
1074                         return pImpl->__data.valueULongLong;
1075                 }
1076         }
1077
1078         return 0;
1079 }
1080
1081 String
1082 Variant::ToString(void) const
1083 {
1084         const _VariantImpl* pImpl = GetVariantImpl();
1085         if (pImpl)
1086         {
1087                 if (!pImpl->IsSameType(VARIANT_TYPE_STRING))
1088                 {
1089                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_STRING.");
1090                 }
1091                 else
1092                 {
1093                         return *pImpl->__data.pString;
1094                 }
1095         }
1096
1097         return String("");
1098 }
1099
1100 DateTime
1101 Variant::ToDateTime(void) const
1102 {
1103         const _VariantImpl* pImpl = GetVariantImpl();
1104         if (pImpl)
1105         {
1106                 if (!pImpl->IsSameType(VARIANT_TYPE_DATETIME))
1107                 {
1108                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_DATETIME.");
1109                 }
1110                 else
1111                 {
1112                         return *pImpl->__data.pDateTime;
1113                 }
1114         }
1115
1116         return DateTime();
1117 }
1118
1119 Color
1120 Variant::ToColor(void) const
1121 {
1122         const _VariantImpl* pImpl = GetVariantImpl();
1123         if (pImpl)
1124         {
1125                 if (!pImpl->IsSameType(VARIANT_TYPE_COLOR))
1126                 {
1127                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_COLOR.");
1128                 }
1129                 else
1130                 {
1131                         return *pImpl->__data.pColor;
1132                 }
1133         }
1134
1135         return Color();
1136 }
1137
1138 Point
1139 Variant::ToPoint(void) const
1140 {
1141         const _VariantImpl* pImpl = GetVariantImpl();
1142         if (pImpl)
1143         {
1144                 if (!pImpl->IsSameType(VARIANT_TYPE_POINT))
1145                 {
1146                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_POINT.");
1147                 }
1148                 else
1149                 {
1150                         return *pImpl->__data.pPoint;
1151                 }
1152         }
1153
1154         return Point();
1155 }
1156
1157 FloatPoint
1158 Variant::ToFloatPoint(void) const
1159 {
1160         const _VariantImpl* pImpl = GetVariantImpl();
1161         if (pImpl)
1162         {
1163                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_POINT))
1164                 {
1165                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOATPOINT.");
1166                 }
1167                 else
1168                 {
1169                         return *pImpl->__data.pFloatPoint;
1170                 }
1171         }
1172
1173         return FloatPoint();
1174 }
1175
1176 Rectangle
1177 Variant::ToRectangle(void) const
1178 {
1179         const _VariantImpl* pImpl = GetVariantImpl();
1180         if (pImpl)
1181         {
1182                 if (!pImpl->IsSameType(VARIANT_TYPE_RECTANGLE))
1183                 {
1184                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_RECTANGLE.");
1185                 }
1186                 else
1187                 {
1188                         return *pImpl->__data.pRect;
1189                 }
1190         }
1191
1192         return Rectangle();
1193 }
1194
1195 FloatRectangle
1196 Variant::ToFloatRectangle(void) const
1197 {
1198         const _VariantImpl* pImpl = GetVariantImpl();
1199         if (pImpl)
1200         {
1201                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_RECTANGLE))
1202                 {
1203                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_RECTANGLE.");
1204                 }
1205                 else
1206                 {
1207                         return *pImpl->__data.pRectf;
1208                 }
1209         }
1210
1211         return FloatRectangle();
1212 }
1213
1214 Dimension
1215 Variant::ToDimension(void) const
1216 {
1217         const _VariantImpl* pImpl = GetVariantImpl();
1218         if (pImpl)
1219         {
1220                 if (!pImpl->IsSameType(VARIANT_TYPE_DIMENSION))
1221                 {
1222                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_DIMENSION.");
1223                 }
1224                 else
1225                 {
1226                         return *pImpl->__data.pDimension;
1227                 }
1228         }
1229
1230         return Dimension();
1231 }
1232
1233 FloatDimension
1234 Variant::ToFloatDimension(void) const
1235 {
1236         const _VariantImpl* pImpl = GetVariantImpl();
1237         if (pImpl)
1238         {
1239                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_DIMENSION))
1240                 {
1241                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_DIMENSION.");
1242                 }
1243                 else
1244                 {
1245                         return *pImpl->__data.pFloatDimension;
1246                 }
1247         }
1248
1249         return FloatDimension();
1250 }
1251
1252 FloatMatrix4
1253 Variant::ToFloatMatrix4(void) const
1254 {
1255         const _VariantImpl* pImpl = GetVariantImpl();
1256         if (pImpl)
1257         {
1258                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_MATRIX4))
1259                 {
1260                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_MATRIX4.");
1261                 }
1262                 else
1263                 {
1264                         return *pImpl->__data.pFloatMatrix4;
1265                 }
1266         }
1267
1268         return FloatMatrix4();
1269 }
1270
1271 FloatPoint3
1272 Variant::ToFloatPoint3(void) const
1273 {
1274         const _VariantImpl* pImpl = GetVariantImpl();
1275         if (pImpl)
1276         {
1277                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_POINT3))
1278                 {
1279                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_POINT3.");
1280                 }
1281                 else
1282                 {
1283                         return *pImpl->__data.pFloatPoint3;
1284                 }
1285         }
1286
1287         return FloatPoint3();
1288 }
1289
1290 FloatVector4
1291 Variant::ToFloatVector4(void) const
1292 {
1293         const _VariantImpl* pImpl = GetVariantImpl();
1294         if (pImpl)
1295         {
1296                 if (!pImpl->IsSameType(VARIANT_TYPE_FLOAT_VECTOR4))
1297                 {
1298                         SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] The current variant type is not VARIANT_TYPE_FLOAT_VECTOR4.");
1299                 }
1300                 else
1301                 {
1302                         return *pImpl->__data.pFloatVector4;
1303                 }
1304         }
1305
1306         return FloatVector4();
1307 }
1308
1309 bool
1310 Variant::IsEmpty(void) const
1311 {
1312         const _VariantImpl* pImpl = GetVariantImpl();
1313         if (pImpl)
1314         {
1315                 return pImpl->__type == VARIANT_TYPE_NONE;
1316         }
1317
1318         return true;
1319 }
1320
1321 VariantType
1322 Variant::GetType() const
1323 {
1324         const _VariantImpl* pImpl = GetVariantImpl();
1325         if (pImpl)
1326         {
1327                 return pImpl->__type;
1328         }
1329
1330         return VARIANT_TYPE_NONE;
1331 }
1332
1333 bool
1334 Variant::Equals(const Object& obj) const
1335 {
1336         const Variant* pOther = dynamic_cast <const Variant*>(&obj);
1337         if (pOther == null)
1338         {
1339                 return (false);
1340         }
1341
1342         return (*this == *pOther);
1343 }
1344
1345 int
1346 Variant::GetHashCode(void) const
1347 {
1348         const _VariantImpl* pImpl = GetVariantImpl();
1349
1350         switch (pImpl->__type)
1351         {
1352         case VARIANT_TYPE_INT:
1353                 return (int) pImpl->__data.valueInt;
1354
1355         case VARIANT_TYPE_UINT:
1356                 return (int) pImpl->__data.valueUInt;
1357
1358         case VARIANT_TYPE_BOOL:
1359                 return (int) pImpl->__data.valueBool;
1360
1361         case VARIANT_TYPE_FLOAT:
1362                 return (int) pImpl->__data.valueFloat;
1363
1364         case VARIANT_TYPE_DOUBLE:
1365                 return (int) pImpl->__data.valueDouble;
1366
1367         case VARIANT_TYPE_LONG:
1368                 return (int) pImpl->__data.valueLong;
1369
1370         case VARIANT_TYPE_ULONG:
1371                 return (int) pImpl->__data.valueULong;
1372
1373         case VARIANT_TYPE_LONGLONG:
1374                 return (int) pImpl->__data.valueLongLong;
1375
1376         case VARIANT_TYPE_ULONGLONG:
1377                 return (int) pImpl->__data.valueULongLong;
1378
1379         case VARIANT_TYPE_STRING:
1380         {
1381                 if (pImpl->__data.pString)
1382                 {
1383                         return pImpl->__data.pString->GetHashCode();
1384                 }
1385                 else
1386                 {
1387                         break;
1388                 }
1389         }
1390
1391         case VARIANT_TYPE_DATETIME:
1392         {
1393                 if (pImpl->__data.pDateTime)
1394                 {
1395                         return (pImpl->__data.pDateTime)->GetHashCode();
1396                 }
1397                 else
1398                 {
1399                         break;
1400                 }
1401         }
1402
1403         case VARIANT_TYPE_COLOR:
1404         {
1405                 if (pImpl->__data.pPoint)
1406                 {
1407                         return (pImpl->__data.pColor)->GetHashCode();
1408                 }
1409                 else
1410                 {
1411                         break;
1412                 }
1413         }
1414
1415         case VARIANT_TYPE_POINT:
1416         {
1417                 if (pImpl->__data.pPoint)
1418                 {
1419                         return (pImpl->__data.pPoint)->GetHashCode();
1420                 }
1421                 else
1422                 {
1423                         break;
1424                 }
1425         }
1426
1427         case VARIANT_TYPE_FLOAT_POINT:
1428         {
1429                 if (pImpl->__data.pFloatPoint)
1430                 {
1431                         return (pImpl->__data.pFloatPoint)->GetHashCode();
1432                 }
1433                 else
1434                 {
1435                         break;
1436                 }
1437         }
1438
1439         case VARIANT_TYPE_RECTANGLE:
1440         {
1441                 if (pImpl->__data.pRect)
1442                 {
1443                         return (pImpl->__data.pRect)->GetHashCode();
1444                 }
1445                 else
1446                 {
1447                         break;
1448                 }
1449         }
1450
1451         case VARIANT_TYPE_FLOAT_RECTANGLE:
1452         {
1453                 if (pImpl->__data.pRectf)
1454                 {
1455                         return (pImpl->__data.pRectf)->GetHashCode();
1456                 }
1457                 else
1458                 {
1459                         break;
1460                 }
1461         }
1462
1463         case VARIANT_TYPE_DIMENSION:
1464         {
1465                 if (pImpl->__data.pDimension)
1466                 {
1467                         return (pImpl->__data.pDimension)->GetHashCode();
1468                 }
1469                 else
1470                 {
1471                         break;
1472                 }
1473         }
1474
1475         case VARIANT_TYPE_FLOAT_DIMENSION:
1476         {
1477                 if (pImpl->__data.pFloatDimension)
1478                 {
1479                         return (pImpl->__data.pFloatDimension)->GetHashCode();
1480                 }
1481                 else
1482                 {
1483                         break;
1484                 }
1485         }
1486
1487         case VARIANT_TYPE_FLOAT_MATRIX4:
1488         {
1489                 if (pImpl->__data.pFloatMatrix4)
1490                 {
1491                         return (pImpl->__data.pFloatMatrix4)->GetHashCode();
1492                 }
1493                 else
1494                 {
1495                         break;
1496                 }
1497         }
1498
1499         case VARIANT_TYPE_FLOAT_POINT3:
1500         {
1501                 if (pImpl->__data.pFloatPoint3)
1502                 {
1503                         return (pImpl->__data.pFloatPoint3)->GetHashCode();
1504                 }
1505                 else
1506                 {
1507                         break;
1508                 }
1509         }
1510
1511         case VARIANT_TYPE_FLOAT_VECTOR4:
1512         {
1513                 if (pImpl->__data.pFloatVector4)
1514                 {
1515                         return (pImpl->__data.pFloatVector4)->GetHashCode();
1516                 }
1517                 else
1518                 {
1519                         break;
1520                 }
1521         }
1522
1523         case VARIANT_TYPE_NONE:
1524         default:
1525                 break;
1526         }
1527
1528         return 0;
1529 }
1530
1531 const _VariantImpl*
1532 Variant::GetVariantImpl(void) const
1533 {
1534         return static_cast <const _VariantImpl*>(__pVariantImpl);
1535 }
1536
1537 _VariantImpl*
1538 Variant::GetVariantImpl(void)
1539 {
1540         return __pVariantImpl;
1541 }
1542
1543 } } //Tizen::Ui