Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / extension.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * RDP Extensions
4  *
5  * Copyright 2010-2011 Vic Lee
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __RDP_EXTENSION_H
21 #define __RDP_EXTENSION_H
22
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/freerdp.h>
26
27 #define FREERDP_EXT_EXPORT_FUNC_NAME    "FreeRDPExtensionEntry"
28
29 typedef struct rdp_ext_plugin rdpExtPlugin;
30
31 struct rdp_ext_plugin
32 {
33         void* ext;
34         int (*init) (rdpExtPlugin* plugin, freerdp* instance);
35         int (*uninit) (rdpExtPlugin* plugin, freerdp* instance);
36 };
37
38 typedef uint32 (FREERDP_CC* PFREERDP_EXTENSION_HOOK)(rdpExtPlugin* plugin, freerdp* instance);
39
40 typedef uint32 (FREERDP_CC* PREGISTEREXTENSION)(rdpExtPlugin* plugin);
41 typedef uint32 (FREERDP_CC* PREGISTERPRECONNECTHOOK)(rdpExtPlugin* plugin, PFREERDP_EXTENSION_HOOK hook);
42 typedef uint32 (FREERDP_CC* PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin* plugin, PFREERDP_EXTENSION_HOOK hook);
43
44 struct _FREERDP_EXTENSION_ENTRY_POINTS
45 {
46         void* ext; /* Reference to internal instance */
47         PREGISTEREXTENSION pRegisterExtension;
48         PREGISTERPRECONNECTHOOK pRegisterPreConnectHook;
49         PREGISTERPOSTCONNECTHOOK pRegisterPostConnectHook;
50         void* data;
51 };
52
53 typedef struct _FREERDP_EXTENSION_ENTRY_POINTS FREERDP_EXTENSION_ENTRY_POINTS;
54 typedef FREERDP_EXTENSION_ENTRY_POINTS* PFREERDP_EXTENSION_ENTRY_POINTS;
55
56 typedef int (FREERDP_CC* PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints);
57
58 #endif /* __RDP_EXTENSION_H */
59