Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.System.MediaKey / Interop / Interop.MediaKey.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 MediaKey
23     {
24         internal enum KeyValue
25         {
26             Play,
27             Stop,
28             Pause,
29             Previous,
30             Next,
31             FastForward,
32             Rewind,
33             PlayPause,
34             Media,
35             Unknown
36         }
37
38         internal enum KeyStatus
39         {
40             Pressed,
41             Released,
42             Unknown
43         }
44
45         internal enum ErrorCode : int
46         {
47             None = Tizen.Internals.Errors.ErrorCode.None,
48             InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
49             OperationFailed = -0x02420000 | 0x01
50         }
51
52         internal delegate void EventCallback(KeyValue value, KeyStatus status, IntPtr userData);
53
54         [DllImport(Libraries.MediaKey, EntryPoint = "media_key_reserve")]
55         internal static extern ErrorCode Reserve(EventCallback callback, IntPtr userData);
56
57         [DllImport(Libraries.MediaKey, EntryPoint = "media_key_release")]
58         internal static extern ErrorCode Release();
59     }
60 }