25d4446d778736f9d2e03ced4e33a29b4c944e7b
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Background.cs
1 using System;
2
3 namespace ElmSharp
4 {
5     public class Background : Layout
6     {
7         public Background(EvasObject parent) : base(parent)
8         {
9         }
10
11         public override Color Color
12         {
13             //TO-DO: Consider to support alpha to elm_bg.
14             get
15             {
16                 int r;
17                 int g;
18                 int b;
19                 Interop.Elementary.elm_bg_color_get(Handle, out r, out g, out b);
20                 return new Color(r, g, b);
21             }
22             set
23             {
24                 Interop.Elementary.elm_bg_color_set(Handle, value.R, value.G, value.B);
25             }
26         }
27
28         public string File
29         {
30             get
31             {
32                 return Interop.Elementary.BackgroundFileGet(Handle);
33             }
34             set
35             {
36                 Interop.Elementary.elm_bg_file_set(Handle, value, IntPtr.Zero);
37             }
38         }
39
40         public BackgroundOptions BackgroundOption
41         {
42             get
43             {
44                 return (BackgroundOptions) Interop.Elementary.elm_bg_option_get(Handle);
45             }
46             set
47             {
48                 Interop.Elementary.elm_bg_option_set(Handle, (Interop.Elementary.BackgroundOptions) value);
49             }
50         }
51
52         internal override IntPtr CreateHandle(EvasObject parent)
53         {
54             return Interop.Elementary.elm_bg_add(parent.Handle);
55         }
56     }
57
58     public enum BackgroundOptions
59     {
60         Center,
61         Scale,
62         Stretch,
63         Tile
64     }
65 }