39ab57317af2406fbc14ee339b2fc6e42859a321
[platform/core/csapi/nui.git] / NUISamples / NUISamples / NUISamples.Tizen / firstscreen / FocusData.cs
1 using Tizen.NUI;
2 using Tizen.NUI.UIComponents;
3 using Tizen.NUI.BaseComponents;
4 using Tizen.NUI.Constants;
5 using System;
6
7 namespace FirstScreen
8 {
9     public class FocusData
10     {
11         private string _name;                 // Name used for FocusData object (mainly to differentiate key frame animation )
12         private string _imageName;            // Image File Name (to be loaded from disk) used for ImageView used in key frame animation
13         private Position _parentOrigin;        // ParentOrigin applied to ImageView
14         private Size _initSize;            // InitSize used for key frame animation
15         private Size _targetSize;          // TargetSize used for key frame animation
16         private float _keyFrameStart;         // KeyFrameStart used for key frame animation
17         private float _keyFrameEnd;           // KeyFrameEnd used for key frame animation
18         private Direction _direction;         // Direction used for key frame animation
19         private ImageView _imageFocus;        // ImageView used in key frame animation
20
21         // Initialize FocusData used for key frame animation
22         public FocusData(string name, string imageName, Direction direction, Position parentOrigin, Size initSize,
23                          Size targetSize, float keyFrameStart, float keyFrameEnd)
24         {
25             _name = name;
26             _imageName = imageName;
27             _parentOrigin = parentOrigin;
28             _initSize = initSize;
29             _targetSize = targetSize;
30             _keyFrameStart = keyFrameStart;
31             _keyFrameEnd = keyFrameEnd;
32             _direction = direction;
33
34             _imageFocus = new ImageView(Constants.ImageResourcePath + "/focuseffect/" + _imageName); // Target
35
36             _imageFocus.ParentOrigin = _parentOrigin;
37             _imageFocus.PivotPoint = PivotPoint.Center;
38             _imageFocus.PositionUsesPivotPoint = true;
39             _imageFocus.Name = _name;
40         }
41
42         public enum Direction
43         {
44             Horizontal,
45             Vertical
46         };
47
48         public Direction FocusDirection
49         {
50             get { return _direction; }
51             set { _direction = value; }
52         }
53
54         public string Name
55         {
56             get { return _name; }
57             set { _name = value; }
58         }
59
60         public string ImageName
61         {
62             get { return _imageName; }
63             set { _imageName = value; }
64         }
65
66         public Position ParentOrigin
67         {
68             get
69             {
70                 return _parentOrigin;
71             }
72
73             set
74             {
75                 _parentOrigin = value;
76                 _imageFocus.ParentOrigin = _parentOrigin;
77             }
78         }
79
80         public Size InitSize
81         {
82             get { return _initSize; }
83             set { _initSize = value; }
84         }
85
86         public Size TargetSize
87         {
88             get { return _targetSize; }
89             set { _targetSize = value; }
90         }
91
92         public float KeyFrameStart
93         {
94             get { return _keyFrameStart; }
95             set { _keyFrameStart = value; }
96         }
97
98         public float KeyFrameEnd
99         {
100             get { return _keyFrameEnd; }
101             set { _keyFrameEnd = value; }
102         }
103
104         public ImageView ImageItem
105         {
106             get { return _imageFocus; }
107         }
108
109     }
110 }