File: server-config.h

package info (click to toggle)
balsa 2.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,576 kB
  • sloc: ansic: 99,871; xml: 4,934; makefile: 769; sh: 185; awk: 60; python: 34
file content (128 lines) | stat: -rw-r--r-- 4,923 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
/* Balsa E-Mail Client
 *
 * Copyright (C) 1997-2018 Stuart Parmenter and others,
 *                         See the file AUTHORS for a list.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <https://www.gnu.org/licenses/>.
 */

#ifndef LIBBALSA_SERVER_CONFIG_H_
#define LIBBALSA_SERVER_CONFIG_H_


#include <gtk/gtk.h>
#include "server.h"


#ifndef BALSA_VERSION
# error "Include config.h before this file."
#endif


#define LIBBALSA_TYPE_SERVER_CFG (libbalsa_server_cfg_get_type())

G_DECLARE_FINAL_TYPE(LibBalsaServerCfg,
                     libbalsa_server_cfg,
                     LIBBALSA,
                     SERVER_CFG,
                     GtkNotebook)


/** @brief Create a new server configuration widget
 * @param server server data, must not be NULL
 * @param name name, may be NULL
 * @return a newly allocated and populated server configuration notebook widget
 */
LibBalsaServerCfg *libbalsa_server_cfg_new(LibBalsaServer *server,
										   const gchar    *name)
	G_GNUC_WARN_UNUSED_RESULT;

/** @brief Check if the server configuration is valid
 * @param server_cfg server configuration widget
 * @return TRUE if the configuration is valid, i.e. all mandatory fields are filled in
 */
gboolean libbalsa_server_cfg_valid(LibBalsaServerCfg *server_cfg);

/** @brief Add a custom widget to the server configuration
 * @param server_cfg server configuration widget
 * @param basic TRUE to append the widget to the @em Basic or FALSE to the @em Advanced page
 * @param label widget label, must not be NULL
 * @param widget widget to append, must not be NULL
 */
void libbalsa_server_cfg_add_item(LibBalsaServerCfg *server_cfg,
								  gboolean           basic,
								  const gchar       *label,
								  GtkWidget         *widget);

/** @brief Add custom widgets to the server configuration
 * @param server_cfg server configuration widget
 * @param basic TRUE to append the widget to the @em Basic or FALSE to the @em Advanced page
 * @param left widget in the left grid column, must not be NULL
 * @param right widget in the right grid column, may be NULL if the left widget shall span over both grid columns
 */
void libbalsa_server_cfg_add_row(LibBalsaServerCfg *server_cfg,
								 gboolean           basic,
								 GtkWidget         *left,
								 GtkWidget         *right);

/** @brief Add a custom check box to the server configuration
 * @param server_cfg server configuration widget
 * @param basic TRUE to append the widget to the @em Basic or FALSE to the @em Advanced page
 * @param label widget label, must not be NULL
 * @param initval initial check box value
 * @param callback callback function for the @em toggled signal, may be NULL
 * @param cb_data data to pass to the callback
 * @return a new GtkCheckButton
 */
GtkWidget *libbalsa_server_cfg_add_check(LibBalsaServerCfg *server_cfg,
							      	     gboolean           basic,
										 const gchar       *label,
										 gboolean 			initval,
										 GCallback			callback,
										 gpointer			cb_data)
	G_GNUC_WARN_UNUSED_RESULT;

/** @brief Add a custom entry to the server configuration
 * @param server_cfg server configuration widget
 * @param basic TRUE to append the widget to the @em Basic or FALSE to the @em Advanced page
 * @param label widget label, must not be NULL
 * @param initval initial entry value, may be NULL
 * @param callback callback function for the @em changed signal, may be NULL
 * @param cb_data data to pass to the callback
 * @return a new GtkEntry
 */
GtkWidget *libbalsa_server_cfg_add_entry(LibBalsaServerCfg *server_cfg,
							      	     gboolean           basic,
										 const gchar       *label,
										 const gchar       *initval,
										 GCallback			callback,
										 gpointer			cb_data)
	G_GNUC_WARN_UNUSED_RESULT;

/** @brief Get the name of the server configuration
 * @param server_cfg server configuration widget
 * @return the name entered in the <em>Descriptive Name</em> GtkEntry
 */
const gchar *libbalsa_server_cfg_get_name(LibBalsaServerCfg *server_cfg);

/** @brief Get the server configuration
 * @param server_cfg server configuration widget
 * @param server server data, must not be NULL
 */
void libbalsa_server_cfg_assign_server(LibBalsaServerCfg *server_cfg,
									   LibBalsaServer    *server);


#endif /* LIBBALSA_SERVER_CONFIG_H_ */