~vanvugt/+junk/remmina-ppa

« back to all changes in this revision

Viewing changes to include/remmina/plugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2010-07-11 23:40:47 UTC
  • mfrom: (1.2.1 upstream) (8.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100711234047-id2bdu1gb59e34n4
* New upstream release.
* debian/control:
  - Bump Standards-Version to 3.9.0, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Remmina - The GTK+ Remote Desktop Client
 
3
 * Copyright (C) 2010 Vic Lee 
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 */
 
20
 
 
21
#ifndef __REMMINA_PLUGIN_H__
 
22
#define __REMMINA_PLUGIN_H__
 
23
 
 
24
#include <remmina/types.h>
 
25
 
 
26
G_BEGIN_DECLS
 
27
 
 
28
typedef enum
 
29
{
 
30
    REMMINA_PLUGIN_TYPE_PROTOCOL = 0,
 
31
    REMMINA_PLUGIN_TYPE_ENTRY = 1,
 
32
    REMMINA_PLUGIN_TYPE_FILE = 2,
 
33
    REMMINA_PLUGIN_TYPE_TOOL = 3
 
34
} RemminaPluginType;
 
35
 
 
36
typedef struct _RemminaPlugin
 
37
{
 
38
    RemminaPluginType type;
 
39
    const gchar *name;
 
40
    const gchar *description;
 
41
} RemminaPlugin;
 
42
 
 
43
typedef struct _RemminaProtocolPlugin
 
44
{
 
45
    RemminaPluginType type;
 
46
    const gchar *name;
 
47
    const gchar *description;
 
48
 
 
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;
 
55
 
 
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;
 
62
 
 
63
typedef struct _RemminaEntryPlugin
 
64
{
 
65
    RemminaPluginType type;
 
66
    const gchar *name;
 
67
    const gchar *description;
 
68
 
 
69
    void (* entry_func) (void);
 
70
} RemminaEntryPlugin;
 
71
 
 
72
typedef struct _RemminaFilePlugin
 
73
{
 
74
    RemminaPluginType type;
 
75
    const gchar *name;
 
76
    const gchar *description;
 
77
 
 
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;
 
83
} RemminaFilePlugin;
 
84
 
 
85
typedef struct _RemminaToolPlugin
 
86
{
 
87
    RemminaPluginType type;
 
88
    const gchar *name;
 
89
    const gchar *description;
 
90
 
 
91
    void (* exec_func) (void);
 
92
} RemminaToolPlugin;
 
93
 
 
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
 
98
{
 
99
    gboolean     (* register_plugin)                      (RemminaPlugin *plugin);
 
100
 
 
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);
 
139
 
 
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);
 
145
 
 
146
    void         (* log_print)                            (const gchar *text);
 
147
    void         (* log_printf)                           (const gchar *fmt, ...);
 
148
 
 
149
    void         (* ui_register)                          (GtkWidget *widget);
 
150
 
 
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;
 
154
 
 
155
/* "Prototype" of the plugin entry function */
 
156
typedef gboolean (*RemminaPluginEntryFunc) (RemminaPluginService *service);
 
157
 
 
158
G_END_DECLS
 
159
 
 
160
#endif /* __REMMINA_PLUGIN_H__ */
 
161