Visual example, NUIApplication, Size/Position
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / VisualMaps.cs
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved\r
2 // PROPRIETARY/CONFIDENTIAL \r
3 // This software is the confidential and proprietary\r
4 // information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall\r
5 // not disclose such Confidential Information and shall use it only in\r
6 // accordance with the terms of the license agreement you entered into with\r
7 // SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the\r
8 // suitability of the software, either express or implied, including but not\r
9 // limited to the implied warranties of merchantability, fitness for a\r
10 // particular purpose, or non-infringement. SAMSUNG shall not be liable for any\r
11 // damages suffered by licensee as a result of using, modifying or distributing\r
12 // this software or its derivatives.\r
13 \r
14 // Copyright (c) 2017 Samsung Electronics Co., Ltd.\r
15 //\r
16 // Licensed under the Apache License, Version 2.0 (the "License");\r
17 // you may not use this file except in compliance with the License.\r
18 // You may obtain a copy of the License at\r
19 //\r
20 // http://www.apache.org/licenses/LICENSE-2.0\r
21 //\r
22 // Unless required by applicable law or agreed to in writing, software\r
23 // distributed under the License is distributed on an "AS IS" BASIS,\r
24 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
25 // See the License for the specific language governing permissions and\r
26 // limitations under the License.\r
27 //\r
28 \r
29 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts\r
30 // Some have been manually changed\r
31 \r
32 namespace Tizen.NUI\r
33 {\r
34     using System;\r
35 \r
36     public class ImageVisualMap\r
37     {\r
38         public ImageVisualMap()\r
39         {\r
40         }\r
41 \r
42         private string _url = "";\r
43         private FittingModeType _fittingMode = FittingModeType.ShrinkToFit;\r
44         private SamplingModeType _samplingMode = SamplingModeType.BOX;\r
45         private float _depthIndex = 0.0f;\r
46         /* the following properties should be done also.        \r
47         public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH;\r
48         public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT;\r
49         public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING;\r
50         public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY;\r
51         public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA;\r
52         public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U;\r
53         public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V;\r
54         */\r
55         private PropertyMap _outputMap;\r
56 \r
57 \r
58         public string URL\r
59         {\r
60             get\r
61             {\r
62                 return _url;\r
63             }\r
64             set\r
65             {\r
66                 _url = value;\r
67             }\r
68         }\r
69 \r
70         public FittingModeType FittingMode\r
71         {\r
72             get\r
73             {\r
74                 return _fittingMode;\r
75             }\r
76             set\r
77             {\r
78                 _fittingMode = value;\r
79             }\r
80         }\r
81         public SamplingModeType SamplingMode\r
82         {\r
83             get\r
84             {\r
85                 return _samplingMode;\r
86             }\r
87             set\r
88             {\r
89                 _samplingMode = value;\r
90             }\r
91         }\r
92         public float DepthIndex\r
93         {\r
94             get\r
95             {\r
96                 return _depthIndex;\r
97             }\r
98             set\r
99             {\r
100                 _depthIndex = value;\r
101             }\r
102         }\r
103 \r
104         public PropertyMap OutputMap\r
105         {\r
106             get\r
107             {\r
108                 ComposingPropertyMap();\r
109                 return _outputMap;\r
110             }\r
111         }\r
112 \r
113         private void ComposingPropertyMap()\r
114         {\r
115             if (_url != "")\r
116             {\r
117                 _outputMap = new PropertyMap(); ;\r
118                 _outputMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Image));\r
119                 _outputMap.Add(Tizen.NUI.Constants.ImageVisualProperty.URL, new PropertyValue(_url));\r
120                 _outputMap.Add(Tizen.NUI.Constants.ImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode));\r
121                 _outputMap.Add(Tizen.NUI.Constants.ImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode));\r
122                 //more PropertyMap should be added\r
123             }\r
124         }\r
125     }\r
126 \r
127     public class TextVisualMap\r
128     {\r
129         public TextVisualMap()\r
130         {\r
131         }\r
132 \r
133         private string _text = "";\r
134         private Color _textColor = Color.Black;\r
135         private float _pointSize = 0.0f;\r
136         private float _depthIndex = 0.0f;\r
137         /* the following properties should be done also.        \r
138         public static readonly int FontFamily = NDalic.TEXT_VISUAL_FONT_FAMILY;\r
139         public static readonly int FontStyle = NDalic.TEXT_VISUAL_FONT_STYLE;\r
140         public static readonly int MultiLine = NDalic.TEXT_VISUAL_MULTI_LINE;\r
141         public static readonly int HorizontalAlignment = NDalic.TEXT_VISUAL_HORIZONTAL_ALIGNMENT;\r
142         public static readonly int VerticalAlignment = NDalic.TEXT_VISUAL_VERTICAL_ALIGNMENT;\r
143         public static readonly int EnableMarkup = NDalic.TEXT_VISUAL_ENABLE_MARKUP;\r
144         */\r
145         private PropertyMap _outputMap;\r
146 \r
147         public string Text\r
148         {\r
149             get\r
150             {\r
151                 return _text;\r
152             }\r
153             set\r
154             {\r
155                 _text = value;\r
156             }\r
157         }\r
158 \r
159         public Color TextColor\r
160         {\r
161             get\r
162             {\r
163                 return _textColor;\r
164             }\r
165             set\r
166             {\r
167                 _textColor = value;\r
168             }\r
169         }\r
170         public float PointSize\r
171         {\r
172             get\r
173             {\r
174                 return _pointSize;\r
175             }\r
176             set\r
177             {\r
178                 _pointSize = value;\r
179             }\r
180         }\r
181         public float DepthIndex\r
182         {\r
183             get\r
184             {\r
185                 return _depthIndex;\r
186             }\r
187             set\r
188             {\r
189                 _depthIndex = value;\r
190             }\r
191         }\r
192 \r
193         public PropertyMap OutputMap\r
194         {\r
195             get\r
196             {\r
197                 ComposingPropertyMap();\r
198                 return _outputMap;\r
199             }\r
200         }\r
201 \r
202         private void ComposingPropertyMap()\r
203         {\r
204             if (_text != "" && _pointSize != 0)\r
205             {\r
206                 Tizen.Log.Debug("NUI", "p1 !!!!!");\r
207                 _outputMap = new PropertyMap(); ;\r
208                 _outputMap.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Text));\r
209                 _outputMap.Add(Tizen.NUI.Constants.TextVisualProperty.Text, new PropertyValue(_text));\r
210                 _outputMap.Add(Tizen.NUI.Constants.TextVisualProperty.TextColor, new PropertyValue(_textColor));\r
211                 _outputMap.Add(Tizen.NUI.Constants.TextVisualProperty.PointSize, new PropertyValue(_pointSize));\r
212                 //more PropertyMap should be added\r
213             }\r
214         }\r
215     }\r
216 \r
217 }\r