2
* xfce4-mailwatch-plugin - a mail notification applet for the xfce4 panel
3
* Copyright (c) 2005 Brian Tarricone <bjt23@cornell.edu>
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 ONLY.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Library General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
#ifndef __MAILWATCH_UTILS_H__
20
#define __MAILWATCH_UTILS_H__
26
#ifdef HAVE_SYS_TYPES_H
27
#include <sys/types.h>
30
#ifdef HAVE_SYS_SOCKET_H
31
#include <sys/socket.h>
38
#ifdef HAVE_NETINET_IN_H
39
#include <netinet/in.h>
44
#ifdef HAVE_SSL_SUPPORT
45
#include <gnutls/gnutls.h>
48
#define TRACE cd_message
58
} XfceMailwatchAuthType;
63
gboolean gnutls_inited;
64
#ifdef HAVE_SSL_SUPPORT
65
gnutls_session_t gt_session;
66
gnutls_certificate_credentials_t gt_creds;
68
} XfceMailwatchSecurityInfo;
70
gboolean xfce_mailwatch_net_get_sockaddr(const gchar *host, const gchar *service, struct addrinfo *hints, struct sockaddr_in *addr, GError **error);
71
gboolean xfce_mailwatch_net_negotiate_tls(gint sockfd, XfceMailwatchSecurityInfo *security_info, const gchar *host, GError **error);
72
gssize xfce_mailwatch_net_send(gint sockfd, XfceMailwatchSecurityInfo *security_info, const gchar *buf, GError **error);
73
gssize xfce_mailwatch_net_recv(gint sockfd, XfceMailwatchSecurityInfo *security_info, gchar *buf, gsize len, GError **error);
74
void xfce_mailwatch_net_tls_teardown(XfceMailwatchSecurityInfo *security_info);
76
GtkWidget *xfce_mailwatch_custom_button_new(const gchar *text, const gchar *icon);
77
GtkWidget *xfce_mailwatch_create_framebox(const gchar *title, GtkWidget **frame_bin);
79
void xfce_textdomain (const gchar *package, const gchar *localedir, const gchar *encoding);
81
gint xfce_mailwatch_base64_encode(const guint8 *data, gint size, gchar **str);