[System.Feedback] Add internal APIs to support multi-theme sound conf usage
[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         [DllImport(Libraries.Feedback, EntryPoint = "feedback_initialize")]
42         internal static extern int Initialize();
43
44         [DllImport(Libraries.Feedback, EntryPoint = "feedback_deinitialize")]
45         internal static extern int Deinitialize();
46
47         [DllImport(Libraries.Feedback, EntryPoint = "feedback_play")]
48         internal static extern int Play(int pattern);
49
50         [DllImport(Libraries.Feedback, EntryPoint = "feedback_play_type")]
51         internal static extern int PlayType(FeedbackType type, int pattern);
52
53         [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop")]
54         internal static extern int Stop();
55
56         [DllImport(Libraries.Feedback, EntryPoint = "feedback_is_supported_pattern")]
57         internal static extern int IsSupportedPattern(FeedbackType type, int pattern, out bool supported);
58
59         [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_count_of_theme_internal")]
60         internal static extern int GetCountOfThemeInternal(FeedbackType type, out uint countOfTheme);
61
62         [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_theme_index_internal")]
63         internal static extern int GetThemeIndexInternal(FeedbackType type, out uint indexOfTheme);
64
65         [DllImport(Libraries.Feedback, EntryPoint = "feedback_set_theme_index_internal")]
66         internal static extern int SetThemeIndexInternal(FeedbackType type, uint indexOfTheme);
67     }
68 }