2 * Copyright (c) 2017 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 CtxHistory
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);
27 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_is_supported")]
28 internal static extern int IsSupported(string subject, out bool supported);
30 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_get_last_fully_charged_time")]
31 internal static extern int GetLastFullyChargedTime(out Int64 timestamp);
34 internal static partial class CtxHistoryCursor
36 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_destroy")]
37 internal static extern void Destroy(IntPtr cursor);
39 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_count")]
40 internal static extern int GetCount(IntPtr cursor, out int count);
42 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_position")]
43 internal static extern int GetPosition(IntPtr cursor, out int position);
45 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_set_position")]
46 internal static extern int SetPosition(IntPtr cursor, int position);
48 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_first")]
49 internal static extern int First(IntPtr cursor);
51 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_last")]
52 internal static extern int Last(IntPtr cursor);
54 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_next")]
55 internal static extern int Next(IntPtr cursor);
57 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_prev")]
58 internal static extern int Prev(IntPtr cursor);
60 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_int64")]
61 internal static extern int GetInt64(IntPtr cursor, string key, out Int64 value);
63 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_double")]
64 internal static extern int GetDouble(IntPtr cursor, string key, out double value);
66 [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_string")]
67 internal static extern int GetString(IntPtr cursor, string key, out string value);