1 // Copyright 2016 by Samsung Electronics, Inc.,
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
10 using System.Runtime.InteropServices;
12 internal static partial class Interop
14 internal static partial class Badge
16 internal enum ErrorCode : int
18 None = Tizen.Internals.Errors.ErrorCode.None,
19 InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
20 OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
21 PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
22 IoError = Tizen.Internals.Errors.ErrorCode.IoError,
23 FromDb = -0x01120000 | 0x01,
24 AlreadyExist = -0x01120000 | 0x02,
25 FromDbus = -0x01120000 | 0x03,
26 NotExist = -0x01120000 | 0x04,
27 ServiceNotReady = -0x01120000 | 0x05,
28 InvalidPackage = -0x01120000 | 0x06
31 internal enum Action : uint
40 internal delegate void ForeachCallback(string appId, uint count, IntPtr userData);
41 internal delegate void ChangedCallback(Action action, string appId, uint count, IntPtr userData);
43 [DllImport(Libraries.Badge, EntryPoint = "badge_add")]
44 internal static extern ErrorCode Add(string appId);
46 [DllImport(Libraries.Badge, EntryPoint = "badge_remove")]
47 internal static extern ErrorCode Remove(string appId);
49 [DllImport(Libraries.Badge, EntryPoint = "badge_set_count")]
50 internal static extern ErrorCode SetCount(string appId, uint count);
52 [DllImport(Libraries.Badge, EntryPoint = "badge_get_count")]
53 internal static extern ErrorCode GetCount(string appId, out uint count);
55 [DllImport(Libraries.Badge, EntryPoint = "badge_set_display")]
56 internal static extern ErrorCode SetDisplay(string appId, uint isDisplay);
58 [DllImport(Libraries.Badge, EntryPoint = "badge_get_display")]
59 internal static extern ErrorCode GetDisplay(string appId, out uint isDisplay);
61 [DllImport(Libraries.Badge, EntryPoint = "badge_foreach")]
62 internal static extern ErrorCode Foreach(ForeachCallback callback, IntPtr userData);
64 [DllImport(Libraries.Badge, EntryPoint = "badge_register_changed_cb")]
65 internal static extern ErrorCode SetChangedCallback(ChangedCallback callback, IntPtr userData);
67 [DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")]
68 internal static extern ErrorCode UnsetChangedCallback(ChangedCallback callback);