Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Context / Interop / Interop.AppHistory.cs
1 /*
2  * Copyright (c) 2017 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 CtxHistory
23     {
24         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_query")]
25         internal static extern int Query(string uri, Int64 startTime, Int64 endTime, uint resultSize, out IntPtr cursor);
26
27         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_is_supported")]
28         internal static extern int IsSupported(string subject, out bool supported);
29
30         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_get_last_fully_charged_time")]
31         internal static extern int GetLastFullyChargedTime(out Int64 timestamp);
32
33     }
34     internal static partial class CtxHistoryCursor
35     {
36         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_destroy")]
37         internal static extern void Destroy(IntPtr cursor);
38
39         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_count")]
40         internal static extern int GetCount(IntPtr cursor, out int count);
41
42         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_position")]
43         internal static extern int GetPosition(IntPtr cursor, out int position);
44
45         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_set_position")]
46         internal static extern int SetPosition(IntPtr cursor, int position);
47
48         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_first")]
49         internal static extern int First(IntPtr cursor);
50
51         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_last")]
52         internal static extern int Last(IntPtr cursor);
53
54         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_next")]
55         internal static extern int Next(IntPtr cursor);
56
57         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_prev")]
58         internal static extern int Prev(IntPtr cursor);
59
60         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_int64")]
61         internal static extern int GetInt64(IntPtr cursor, string key, out Int64 value);
62
63         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_double")]
64         internal static extern int GetDouble(IntPtr cursor, string key, out double value);
65
66         [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_string")]
67         internal static extern int GetString(IntPtr cursor, string key, out string value);
68     }
69 }