Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / ElmSharp / Interop / Interop.Elementary.ColorPicker.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19
20 internal static partial class Interop
21 {
22     internal static partial class Elementary
23     {
24
25         internal enum Elm_Colorselector_Mode
26         {
27             ELM_COLORSELECTOR_PALETTE = 0, /* Only color palette is displayed. */
28             ELM_COLORSELECTOR_COMPONENTS, /* Only color selector is displayed. */
29             ELM_COLORSELECTOR_BOTH, /* Both Palette and selector is displayed, default.*/
30             ELM_COLORSELECTOR_PICKER, /* Only color picker is displayed. */
31             ELM_COLORSELECTOR_ALL /* All possible color selector is displayed. */
32         };
33
34         [DllImport(Libraries.Elementary)]
35         internal static extern IntPtr elm_colorselector_add(IntPtr obj);
36
37         [DllImport(Libraries.Elementary)]
38         internal static extern void elm_colorselector_color_set(IntPtr obj, int r, int g, int b, int a);
39
40         [DllImport(Libraries.Elementary)]
41         internal static extern void elm_colorselector_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
42
43         [DllImport(Libraries.Elementary)]
44         internal static extern void elm_colorselector_palette_name_set(IntPtr obj, string name);
45
46         [DllImport(Libraries.Elementary, EntryPoint = "elm_colorselector_palette_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
47         internal static extern IntPtr _elm_colorselector_palette_name_get(IntPtr obj);
48         internal static string elm_colorselector_palette_name_get(IntPtr obj)
49         {
50             var text = _elm_colorselector_palette_name_get(obj);
51             return Marshal.PtrToStringAnsi(text);
52         }
53
54         [DllImport(Libraries.Elementary)]
55         internal static extern void elm_colorselector_mode_set(IntPtr obj, Elm_Colorselector_Mode mode);
56
57         [DllImport(Libraries.Elementary)]
58         internal static extern Elm_Colorselector_Mode elm_colorselector_mode_get(IntPtr obj);
59
60         [DllImport(Libraries.Elementary)]
61         internal static extern IntPtr elm_colorselector_palette_color_add(IntPtr obj, int r, int g, int b, int a);
62
63         [DllImport(Libraries.Elementary)]
64         internal static extern void elm_colorselector_palette_clear(IntPtr obj);
65
66         [DllImport(Libraries.Elementary)]
67         internal static extern IntPtr elm_colorselector_palette_selected_item_get(IntPtr obj);
68
69         [DllImport(Libraries.Elementary)]
70         internal static extern void elm_colorselector_palette_item_color_get(IntPtr obj, out int r, out int g, out int b, out int a);
71
72         [DllImport(Libraries.Elementary)]
73         internal static extern void elm_colorselector_palette_item_color_set(IntPtr obj, int r, int g, int b, int a);
74
75         [DllImport(Libraries.Elementary)]
76         internal static extern bool elm_colorselector_palette_item_selected_get(IntPtr obj);
77
78         [DllImport(Libraries.Elementary)]
79         internal static extern void elm_colorselector_palette_item_selected_set(IntPtr obj, bool selected);
80
81     }
82 }