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