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;
20 internal static partial class Interop
22 internal static partial class Feedback
24 internal enum FeedbackError
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,
34 // Any change here might require changes in Tizen.System.FeedbackType enum
35 internal enum FeedbackType
41 internal enum FeedbackFlag
44 PriorityBasedPlay = 1,
47 [DllImport(Libraries.Feedback, EntryPoint = "feedback_initialize")]
48 internal static extern int Initialize();
50 [DllImport(Libraries.Feedback, EntryPoint = "feedback_deinitialize")]
51 internal static extern int Deinitialize();
53 [DllImport(Libraries.Feedback, EntryPoint = "feedback_play")]
54 internal static extern int Play(int pattern);
56 [DllImport(Libraries.Feedback, EntryPoint = "feedback_play_type")]
57 internal static extern int PlayType(FeedbackType type, int pattern);
59 [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop")]
60 internal static extern int Stop();
62 [DllImport(Libraries.Feedback, EntryPoint = "feedback_is_supported_pattern")]
63 internal static extern int IsSupportedPattern(FeedbackType type, int pattern, out bool supported);
65 [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_count_of_theme_internal")]
66 internal static extern int GetCountOfThemeInternal(FeedbackType type, out uint countOfTheme);
68 [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_theme_id_internal")]
69 internal static extern int GetThemeIdInternal(FeedbackType type, out uint idOfTheme);
71 [DllImport(Libraries.Feedback, EntryPoint = "feedback_set_theme_id_internal")]
72 internal static extern int SetThemeIdInternal(FeedbackType type, uint idOfTheme);
74 [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop_type_internal")]
75 internal static extern int StopTypeInternal(FeedbackType type);
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);
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);