40ab92da155b893e3a4e5a2ae6ee2b9fd9d57a26
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Feedback / Interop / Interop.Feedback.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 Feedback
23     {
24         internal enum FeedbackError
25         {
26             None = Tizen.Internals.Errors.ErrorCode.None,
27             OperationFailed = Tizen.Internals.Errors.ErrorCode.NotPermitted,
28             InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
29             NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice,
30             PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
31             NotInitialized = -0x00020000 | 0x12,
32         }
33
34         // Any change here might require changes in Tizen.System.FeedbackType enum
35         internal enum FeedbackType
36         {
37             Sound = 1,
38             Vibration = 2,
39         }
40
41         internal enum FeedbackFlag
42         {
43             None = 0,
44             PriorityBasedPlay = 1,
45         }
46
47         [DllImport(Libraries.Feedback, EntryPoint = "feedback_initialize")]
48         internal static extern int Initialize();
49
50         [DllImport(Libraries.Feedback, EntryPoint = "feedback_deinitialize")]
51         internal static extern int Deinitialize();
52
53         [DllImport(Libraries.Feedback, EntryPoint = "feedback_play")]
54         internal static extern int Play(int pattern);
55
56         [DllImport(Libraries.Feedback, EntryPoint = "feedback_play_type")]
57         internal static extern int PlayType(FeedbackType type, int pattern);
58
59         [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop")]
60         internal static extern int Stop();
61
62         [DllImport(Libraries.Feedback, EntryPoint = "feedback_is_supported_pattern")]
63         internal static extern int IsSupportedPattern(FeedbackType type, int pattern, out bool supported);
64
65         [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_count_of_theme_internal")]
66         internal static extern int GetCountOfThemeInternal(FeedbackType type, out uint countOfTheme);
67
68         [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_theme_id_internal")]
69         internal static extern int GetThemeIdInternal(FeedbackType type, out uint idOfTheme);
70
71         [DllImport(Libraries.Feedback, EntryPoint = "feedback_set_theme_id_internal")]
72         internal static extern int SetThemeIdInternal(FeedbackType type, uint idOfTheme);
73
74         [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop_type_internal")]
75         internal static extern int StopTypeInternal(FeedbackType type);
76
77         [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_theme_ids_internal", CallingConvention = CallingConvention.Cdecl)]
78         internal static extern int GetThemeIdsInternal(FeedbackType type, out uint coundOfTheme, out IntPtr themeIds);
79
80         [DllImport(Libraries.Feedback, EntryPoint = "feedback_play_type_with_flags_internal", CallingConvention = CallingConvention.Cdecl)]
81         internal static extern int PlayTypeWithFlagsInternal(FeedbackType type, int pattern, FeedbackFlag flag);
82     }
83 }