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