[NUI] Change all CallingConvention to `Cdecl`
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Common / DaliEventHandler.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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.ComponentModel;
19 using System.Diagnostics.CodeAnalysis;
20 using System.Runtime.InteropServices;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
26     /// </summary>
27     /// <since_tizen> 3 </since_tizen>
28     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
29     [SuppressMessage("Microsoft.Naming",
30                      "CA1715:IdentifiersShouldHaveCorrectPrefix",
31                      Justification = "T, U, R are commonly used as generic type parameter names.")]
32     public delegate R DaliEventHandlerWithReturnType<T, U, R>(T source, U e);
33
34     /// <summary>
35     /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
36     /// </summary>
37     /// <since_tizen> 3 </since_tizen>
38     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
39     internal delegate void EventCallbackDelegateType0();
40
41     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
42     internal delegate void EventCallbackDelegateType1(IntPtr arg1);
43
44     /// <summary>
45     /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
46     /// this should be removed with EventHandler from .NET
47     /// </summary>
48     /// <since_tizen> 3 </since_tizen>
49     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
50     [SuppressMessage("Microsoft.Naming",
51                      "CA1715:IdentifiersShouldHaveCorrectPrefix",
52                      Justification = "T, U are commonly used as generic type parameter names.")]
53     public delegate void DaliEventHandler<T, U>(T source, U e);
54
55     /// <summary>
56     /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
57     /// </summary>
58     /// <since_tizen> 3 </since_tizen>
59     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
60     [SuppressMessage("Microsoft.Naming",
61                      "CA1715:IdentifiersShouldHaveCorrectPrefix",
62                      Justification = "T, U, R are commonly used as generic type parameter names.")]
63     public delegate R EventHandlerWithReturnType<T, U, R>(T source, U e);
64
65     /// <summary>
66     /// [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
67     /// </summary>
68     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
69     [EditorBrowsable(EditorBrowsableState.Never)]
70     public delegate TReturn ReturnTypeEventHandler<TSource, TEvent, TReturn>(TSource source, TEvent e);
71 }