3a2c4e9293884a8f5d8628c2fc6ac8d25f1b6a8b
[platform/core/csapi/tizenfx.git] / NUISamples / NUISamples / NUISamples.TizenTV / 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.AnchorPoint = AnchorPoint.Center;
38             _imageFocus.Name = _name;
39         }
40
41         public enum Direction
42         {
43             Horizontal,
44             Vertical
45         };
46
47         public Direction FocusDirection
48         {
49             get { return _direction; }
50             set { _direction = value; }
51         }
52
53         public string Name
54         {
55             get { return _name; }
56             set { _name = value; }
57         }
58
59         public string ImageName
60         {
61             get { return _imageName; }
62             set { _imageName = value; }
63         }
64
65         public Position ParentOrigin
66         {
67             get
68             {
69                 return _parentOrigin;
70             }
71
72             set
73             {
74                 _parentOrigin = value;
75                 _imageFocus.ParentOrigin = _parentOrigin;
76             }
77         }
78
79         public Size InitSize
80         {
81             get { return _initSize; }
82             set { _initSize = value; }
83         }
84
85         public Size TargetSize
86         {
87             get { return _targetSize; }
88             set { _targetSize = value; }
89         }
90
91         public float KeyFrameStart
92         {
93             get { return _keyFrameStart; }
94             set { _keyFrameStart = value; }
95         }
96
97         public float KeyFrameEnd
98         {
99             get { return _keyFrameEnd; }
100             set { _keyFrameEnd = value; }
101         }
102
103         public ImageView ImageItem
104         {
105             get { return _imageFocus; }
106         }
107
108     }
109 }