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;
19 using Tizen.Telephony;
20 using static Tizen.Telephony.CallHandle;
23 /// The Partial Interop class.
25 internal static partial class Interop
28 /// The Call Interop class.
30 internal static partial class Call
32 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_preferred_voice_subscription")]
33 internal static extern Telephony.TelephonyError GetPreferredVoiceSubscription(IntPtr handle, out CallPreferredVoiceSubscription callSub);
35 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_call_list")]
36 internal static extern Telephony.TelephonyError GetCallList(IntPtr handle, out uint count, out IntPtr callList);
38 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_release_call_list")]
39 internal static extern Telephony.TelephonyError ReleaseCallList(uint count, IntPtr callList);
41 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_handle_id")]
42 internal static extern Telephony.TelephonyError GetHandleId(IntPtr callHandle, out uint handleId);
44 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_number")]
45 internal static extern Telephony.TelephonyError GetNumber(IntPtr callHandle, out string number);
47 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_type")]
48 internal static extern Telephony.TelephonyError GetType(IntPtr callHandle, out CallType type);
50 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_status")]
51 internal static extern Telephony.TelephonyError GetStatus(IntPtr callHandle, out CallStatus status);
53 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_direction")]
54 internal static extern Telephony.TelephonyError GetDirection(IntPtr callHandle, out CallDirection direction);
56 [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_conference_status")]
57 internal static extern Telephony.TelephonyError GetConferenceStatus(IntPtr callHandle, out bool conferenceStatus);
59 internal sealed class SafeCallList : SafeHandle
62 : base(IntPtr.Zero, true)
66 public SafeCallList(IntPtr handle, uint count)
72 public override bool IsInvalid
74 get { return this.handle == IntPtr.Zero; }
77 protected override bool ReleaseHandle()
79 ReleaseCallList(Count, this.handle);
80 this.SetHandle(IntPtr.Zero);