2
* Remmina - The GTK+ Remote Desktop Client
3
* Copyright (C) 2010 Vic Lee
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#ifndef __REMMINA_PLUGIN_H__
22
#define __REMMINA_PLUGIN_H__
24
#include <remmina/types.h>
30
REMMINA_PLUGIN_TYPE_PROTOCOL = 0,
31
REMMINA_PLUGIN_TYPE_ENTRY = 1,
32
REMMINA_PLUGIN_TYPE_FILE = 2,
33
REMMINA_PLUGIN_TYPE_TOOL = 3
36
typedef struct _RemminaPlugin
38
RemminaPluginType type;
40
const gchar *description;
43
typedef struct _RemminaProtocolPlugin
45
RemminaPluginType type;
47
const gchar *description;
49
const gchar *icon_name;
50
const gchar *icon_name_ssh;
51
const gchar *avahi_service_type;
52
const RemminaProtocolSetting *basic_settings;
53
const RemminaProtocolSetting *advanced_settings;
54
RemminaProtocolSSHSetting ssh_setting;
56
void (* init) (RemminaProtocolWidget *gp);
57
gboolean (* open_connection) (RemminaProtocolWidget *gp);
58
gboolean (* close_connection) (RemminaProtocolWidget *gp);
59
gpointer (* query_feature) (RemminaProtocolWidget *gp, RemminaProtocolFeature feature);
60
void (* call_feature) (RemminaProtocolWidget *gp, RemminaProtocolFeature feature, const gpointer data);
61
} RemminaProtocolPlugin;
63
typedef struct _RemminaEntryPlugin
65
RemminaPluginType type;
67
const gchar *description;
69
void (* entry_func) (void);
72
typedef struct _RemminaFilePlugin
74
RemminaPluginType type;
76
const gchar *description;
78
gboolean (* import_test_func) (const gchar *from_file);
79
RemminaFile* (* import_func) (const gchar *from_file);
80
gboolean (* export_test_func) (RemminaFile *file);
81
gboolean (* export_func) (RemminaFile *file, const gchar *to_file);
82
const gchar *export_hints;
85
typedef struct _RemminaToolPlugin
87
RemminaPluginType type;
89
const gchar *description;
91
void (* exec_func) (void);
94
/* Plugin Service is a struct containing a list of function pointers,
95
* which is passed from Remmina main program to the plugin module
96
* through the plugin entry function remmina_plugin_entry() */
97
typedef struct _RemminaPluginService
99
gboolean (* register_plugin) (RemminaPlugin *plugin);
101
gint (* protocol_plugin_get_width) (RemminaProtocolWidget *gp);
102
void (* protocol_plugin_set_width) (RemminaProtocolWidget *gp, gint width);
103
gint (* protocol_plugin_get_height) (RemminaProtocolWidget *gp);
104
void (* protocol_plugin_set_height) (RemminaProtocolWidget *gp, gint height);
105
gboolean (* protocol_plugin_get_scale) (RemminaProtocolWidget *gp);
106
gboolean (* protocol_plugin_get_expand) (RemminaProtocolWidget *gp);
107
void (* protocol_plugin_set_expand) (RemminaProtocolWidget *gp, gboolean expand);
108
gboolean (* protocol_plugin_has_error) (RemminaProtocolWidget *gp);
109
void (* protocol_plugin_set_error) (RemminaProtocolWidget *gp, const gchar *fmt, ...);
110
gboolean (* protocol_plugin_is_closed) (RemminaProtocolWidget *gp);
111
RemminaFile* (* protocol_plugin_get_file) (RemminaProtocolWidget *gp);
112
void (* protocol_plugin_emit_signal) (RemminaProtocolWidget *gp, const gchar *signal_name);
113
void (* protocol_plugin_register_hostkey) (RemminaProtocolWidget *gp, GtkWidget *widget);
114
gchar* (* protocol_plugin_start_direct_tunnel) (RemminaProtocolWidget *gp, gint default_port, gboolean port_plus);
115
gboolean (* protocol_plugin_start_reverse_tunnel) (RemminaProtocolWidget *gp, gint local_port);
116
gboolean (* protocol_plugin_start_xport_tunnel) (RemminaProtocolWidget *gp, RemminaXPortTunnelInitFunc init_func);
117
void (* protocol_plugin_set_display) (RemminaProtocolWidget *gp, gint display);
118
gboolean (* protocol_plugin_close_connection) (RemminaProtocolWidget *gp);
119
gint (* protocol_plugin_init_authpwd) (RemminaProtocolWidget *gp, RemminaAuthpwdType authpwd_type);
120
gint (* protocol_plugin_init_authuserpwd) (RemminaProtocolWidget *gp);
121
gchar* (* protocol_plugin_init_get_username) (RemminaProtocolWidget *gp);
122
gchar* (* protocol_plugin_init_get_password) (RemminaProtocolWidget *gp);
123
gint (* protocol_plugin_init_authx509) (RemminaProtocolWidget *gp);
124
gchar* (* protocol_plugin_init_get_cacert) (RemminaProtocolWidget *gp);
125
gchar* (* protocol_plugin_init_get_cacrl) (RemminaProtocolWidget *gp);
126
gchar* (* protocol_plugin_init_get_clientcert) (RemminaProtocolWidget *gp);
127
gchar* (* protocol_plugin_init_get_clientkey) (RemminaProtocolWidget *gp);
128
void (* protocol_plugin_init_save_cred) (RemminaProtocolWidget *gp);
129
void (* protocol_plugin_init_show_listen) (RemminaProtocolWidget *gp, gint port);
130
void (* protocol_plugin_init_show_retry) (RemminaProtocolWidget *gp);
131
void (* protocol_plugin_init_show) (RemminaProtocolWidget *gp);
132
void (* protocol_plugin_init_hide) (RemminaProtocolWidget *gp);
133
gboolean (* protocol_plugin_ssh_exec) (RemminaProtocolWidget *gp, gboolean wait, const gchar *fmt, ...);
134
void (* protocol_plugin_chat_open) (RemminaProtocolWidget *gp, const gchar *name,
135
void(*on_send)(RemminaProtocolWidget *gp, const gchar *text),
136
void(*on_destroy)(RemminaProtocolWidget *gp));
137
void (* protocol_plugin_chat_close) (RemminaProtocolWidget *gp);
138
void (* protocol_plugin_chat_receive) (RemminaProtocolWidget *gp, const gchar *text);
140
void (* pref_set_value) (const gchar *key, const gchar *value);
141
gchar* (* pref_get_value) (const gchar *key);
142
gint (* pref_get_scale_quality) (void);
143
gint (* pref_get_sshtunnel_port) (void);
144
guint (* pref_keymap_get_keyval) (const gchar *keymap, guint keyval);
146
void (* log_print) (const gchar *text);
147
void (* log_printf) (const gchar *fmt, ...);
149
void (* ui_register) (GtkWidget *widget);
151
GtkWidget* (* open_connection) (RemminaFile *remminafile, GCallback disconnect_cb, gpointer data, guint *handler);
152
void (* get_server_port) (const gchar *server, gint defaultport, gchar **host, gint *port);
153
} RemminaPluginService;
155
/* "Prototype" of the plugin entry function */
156
typedef gboolean (*RemminaPluginEntryFunc) (RemminaPluginService *service);
160
#endif /* __REMMINA_PLUGIN_H__ */