2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Runtime.InteropServices;
19 using Tizen.Applications;
21 internal static partial class Interop
23 internal static partial class Badge
25 internal enum Action : uint
34 internal delegate void ForeachCallback(string appId, uint count, IntPtr userData);
36 internal delegate void ChangedCallback(Action action, string appId, uint count, IntPtr userData);
38 [DllImport(Libraries.Badge, EntryPoint = "badge_add")]
39 internal static extern BadgeError Add(string appId);
41 [DllImport(Libraries.Badge, EntryPoint = "badge_remove")]
42 internal static extern BadgeError Remove(string appId);
44 [DllImport(Libraries.Badge, EntryPoint = "badge_set_count")]
45 internal static extern BadgeError SetCount(string appId, uint count);
47 [DllImport(Libraries.Badge, EntryPoint = "badge_get_count")]
48 internal static extern BadgeError GetCount(string appId, out uint count);
50 [DllImport(Libraries.Badge, EntryPoint = "badge_set_display")]
51 internal static extern BadgeError SetDisplay(string appId, uint isDisplay);
53 [DllImport(Libraries.Badge, EntryPoint = "badge_get_display")]
54 internal static extern BadgeError GetDisplay(string appId, out uint isDisplay);
56 [DllImport(Libraries.Badge, EntryPoint = "badge_foreach")]
57 internal static extern BadgeError Foreach(ForeachCallback callback, IntPtr userData);
59 [DllImport(Libraries.Badge, EntryPoint = "badge_register_changed_cb")]
60 internal static extern BadgeError SetChangedCallback(ChangedCallback callback, IntPtr userData);
62 [DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")]
63 internal static extern BadgeError UnsetChangedCallback(ChangedCallback callback);