Remmina - The GTK+ Remote Desktop Client  v1.4.33
Remmina is a remote desktop client written in GTK+, aiming to be useful for system administrators and travellers, who need to work with lots of remote computers in front of either large monitors or tiny netbooks. Remmina supports multiple network protocols in an integrated and consistent user interface. Currently RDP, VNC, NX, XDMCP and SSH are supported.
remmina_file.h
Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2009-2011 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2023 Antenore Gatta, Giovanni Panozzo
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * In addition, as a special exception, the copyright holders give
23  * permission to link the code of portions of this program with the
24  * OpenSSL library under certain conditions as described in each
25  * individual source file, and distribute linked combinations
26  * including the two.
27  * You must obey the GNU General Public License in all respects
28  * for all of the code used other than OpenSSL. * If you modify
29  * file(s) with this exception, you may extend this exception to your
30  * version of the file(s), but you are not obligated to do so. * If you
31  * do not wish to do so, delete this exception statement from your
32  * version. * If you delete this exception statement from all source
33  * files in the program, then also delete it here.
34  *
35  */
36 
37 #include <glib-object.h>
38 #include <gobject/gvaluecollector.h>
39 
40 #include "remmina/types.h"
41 
42 #pragma once
43 
44 G_BEGIN_DECLS
45 
46 struct _RemminaFile {
47  gchar * filename;
48  // @todo Add a cache file with content remminafile->filename = last_success
49  gchar * statefile;
50  GHashTable * settings;
51  GHashTable * states;
52  GHashTable * spsettings;
53  gboolean prevent_saving;
54 };
55 
67 enum {
74 };
75 
76 
77 #define TOOLBAR_OPACITY_LEVEL 8
78 #define TOOLBAR_OPACITY_MIN 0.2
79 
80 /* Create a empty .remmina file */
84 void remmina_file_set_filename(RemminaFile *remminafile, const gchar *filename);
85 void remmina_file_set_statefile(RemminaFile *remminafile);
87 const gchar *remmina_file_get_filename(RemminaFile *remminafile);
88 const gchar *remmina_file_get_statefile(RemminaFile *remminafile);
89 /* Load a new .remmina file and return the allocated RemminaFile object */
91 /* Settings get/set functions */
92 void remmina_file_set_string(RemminaFile *remminafile, const gchar *setting, const gchar *value);
93 const gchar *remmina_file_get_string(RemminaFile *remminafile, const gchar *setting);
94 gchar *remmina_file_get_secret(RemminaFile *remminafile, const gchar *setting);
95 gchar *remmina_file_format_properties(RemminaFile *remminafile, const gchar *setting);
96 void remmina_file_set_int(RemminaFile *remminafile, const gchar *setting, gint value);
97 gint remmina_file_get_int(RemminaFile *remminafile, const gchar *setting, gint default_value);
98 gdouble remmina_file_get_double(RemminaFile *remminafile, const gchar *setting, gdouble default_value);
99 void remmina_file_store_secret_plugin_password(RemminaFile *remminafile, const gchar *key, const gchar *value);
100 gboolean remmina_file_remove_key(RemminaFile *remminafile, const gchar *setting);
101 void remmina_file_set_state(RemminaFile *remminafile, const gchar *setting, const gchar *value);
102 const gchar *remmina_file_get_state(RemminaFile *remminafile, const gchar *setting);
103 void remmina_file_set_state_int(RemminaFile *remminafile, const gchar *setting, gint value);
104 gint remmina_file_get_state_int(RemminaFile *remminafile, const gchar *setting, gint default_value);
105 gdouble remmina_file_get_state_double(RemminaFile *remminafile, const gchar *setting, gdouble default_value);
106 /* Create or overwrite the .remmina file */
107 void remmina_file_save(RemminaFile *remminafile);
108 /* Free the RemminaFile object */
109 void remmina_file_free(RemminaFile *remminafile);
110 /* Duplicate a RemminaFile object */
112 /* Get the protocol icon name */
113 const gchar *remmina_file_get_icon_name(RemminaFile *remminafile);
114 /* Duplicate a temporary RemminaFile and change the protocol */
115 RemminaFile *remmina_file_dup_temp_protocol(RemminaFile *remminafile, const gchar *new_protocol);
116 /* Delete a .remmina file */
117 void remmina_file_delete(const gchar *filename);
118 /* Delete a "password" field and save into .remmina file */
119 void remmina_file_unsave_passwords(RemminaFile *remminafile);
120 /* Function used to update the atime and mtime of a given remmina file, partially
121  * taken from suckless sbase */
122 gchar *remmina_file_get_datetime(RemminaFile *remminafile);
123 /* Function used to update the atime and mtime of a given remmina file */
124 void remmina_file_touch(RemminaFile *remminafile);
125 
126 G_END_DECLS
GHashTable * spsettings
Definition: remmina_file.h:52
const gchar * remmina_file_get_statefile(RemminaFile *remminafile)
typedefG_BEGIN_DECLS struct _RemminaFile RemminaFile
Definition: types.h:44
void remmina_file_delete(const gchar *filename)
Definition: remmina_file.c:911
void remmina_file_touch(RemminaFile *remminafile)
Update the atime and mtime of a given filename.
gchar * statefile
Definition: remmina_file.h:49
GHashTable * states
Definition: remmina_file.h:51
RemminaFile * remmina_file_new(void)
Definition: remmina_file.c:93
gboolean remmina_file_remove_key(RemminaFile *remminafile, const gchar *setting)
RemminaFile * remmina_file_copy(const gchar *filename)
Definition: remmina_file.c:217
gdouble remmina_file_get_state_double(RemminaFile *remminafile, const gchar *setting, gdouble default_value)
Definition: remmina_file.c:655
RemminaFile * remmina_file_dup_temp_protocol(RemminaFile *remminafile, const gchar *new_protocol)
Definition: remmina_file.c:899
gdouble remmina_file_get_double(RemminaFile *remminafile, const gchar *setting, gdouble default_value)
Definition: remmina_file.c:629
void remmina_file_set_statefile(RemminaFile *remminafile)
Definition: remmina_file.c:189
const gchar * remmina_file_get_state(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:925
void remmina_file_state_last_success(RemminaFile *remminafile)
Definition: remmina_file.c:948
void remmina_file_set_state_int(RemminaFile *remminafile, const gchar *setting, gint value)
Definition: remmina_file.c:594
gchar * remmina_file_get_datetime(RemminaFile *remminafile)
Return the string date of the last time a Remmina state file has been modified.
void remmina_file_store_secret_plugin_password(RemminaFile *remminafile, const gchar *key, const gchar *value)
Definition: remmina_file.c:846
gboolean prevent_saving
Definition: remmina_file.h:53
gint remmina_file_get_state_int(RemminaFile *remminafile, const gchar *setting, gint default_value)
Definition: remmina_file.c:615
void remmina_file_set_filename(RemminaFile *remminafile, const gchar *filename)
Definition: remmina_file.c:182
void remmina_file_set_state(RemminaFile *remminafile, const gchar *setting, const gchar *value)
Definition: remmina_file.c:505
RemminaFile * remmina_file_dup(RemminaFile *remminafile)
Definition: remmina_file.c:865
gint remmina_file_get_int(RemminaFile *remminafile, const gchar *setting, gint default_value)
Definition: remmina_file.c:603
void remmina_file_generate_filename(RemminaFile *remminafile)
Generate a new Remmina connection profile file name.
Definition: remmina_file.c:114
void remmina_file_set_int(RemminaFile *remminafile, const gchar *setting, gint value)
Definition: remmina_file.c:585
void remmina_file_free(RemminaFile *remminafile)
Definition: remmina_file.c:709
gchar * remmina_file_format_properties(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:561
void remmina_file_save(RemminaFile *remminafile)
Definition: remmina_file.c:730
const gchar * remmina_file_get_string(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:516
void remmina_file_unsave_passwords(RemminaFile *remminafile)
Definition: remmina_file.c:978
const gchar * remmina_file_get_icon_name(RemminaFile *remminafile)
Definition: remmina_file.c:885
RemminaFile * remmina_file_load(const gchar *filename)
Definition: remmina_file.c:350
gchar * filename
Definition: remmina_file.h:47
gchar * remmina_file_get_secret(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:551
void remmina_file_set_string(RemminaFile *remminafile, const gchar *setting, const gchar *value)
Definition: remmina_file.c:469
GHashTable * settings
Definition: remmina_file.h:50
const gchar * remmina_file_get_filename(RemminaFile *remminafile)
Definition: remmina_file.c:210