Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Applications.Badge / Interop / Interop.Badge.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 using Tizen.Applications;
20
21 internal static partial class Interop
22 {
23     internal static partial class Badge
24     {
25         internal enum Action : uint
26         {
27             Create = 0,
28             Remove,
29             Update,
30             ChangedDisplay,
31             ServiceReady
32         }
33
34         internal delegate void ForeachCallback(string appId, uint count, IntPtr userData);
35
36         internal delegate void ChangedCallback(Action action, string appId, uint count, IntPtr userData);
37
38         [DllImport(Libraries.Badge, EntryPoint = "badge_add")]
39         internal static extern BadgeError Add(string appId);
40
41         [DllImport(Libraries.Badge, EntryPoint = "badge_remove")]
42         internal static extern BadgeError Remove(string appId);
43
44         [DllImport(Libraries.Badge, EntryPoint = "badge_set_count")]
45         internal static extern BadgeError SetCount(string appId, uint count);
46
47         [DllImport(Libraries.Badge, EntryPoint = "badge_get_count")]
48         internal static extern BadgeError GetCount(string appId, out uint count);
49
50         [DllImport(Libraries.Badge, EntryPoint = "badge_set_display")]
51         internal static extern BadgeError SetDisplay(string appId, uint isDisplay);
52
53         [DllImport(Libraries.Badge, EntryPoint = "badge_get_display")]
54         internal static extern BadgeError GetDisplay(string appId, out uint isDisplay);
55
56         [DllImport(Libraries.Badge, EntryPoint = "badge_foreach")]
57         internal static extern BadgeError Foreach(ForeachCallback callback, IntPtr userData);
58
59         [DllImport(Libraries.Badge, EntryPoint = "badge_register_changed_cb")]
60         internal static extern BadgeError SetChangedCallback(ChangedCallback callback, IntPtr userData);
61
62         [DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")]
63         internal static extern BadgeError UnsetChangedCallback(ChangedCallback callback);
64     }
65 }