File: identity.h

package info (click to toggle)
balsa 2.3.13-3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 16,032 kB
  • ctags: 7,261
  • sloc: ansic: 79,348; sh: 8,731; xml: 4,721; makefile: 485; awk: 60
file content (152 lines) | stat: -rw-r--r-- 5,567 bytes parent folder | download | duplicates (2)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
/* Balsa E-Mail Client
 * Copyright (C) 1997-2001 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
 * 02111-1307, USA.
 */


#ifndef __LIBBALSA_IDENTITY_H__
#define __LIBBALSA_IDENTITY_H__

#include "config.h"

#include <gtk/gtk.h>
#include <gmime/internet-address.h>

#if ENABLE_ESMTP
#include "smtp-server.h"
#endif

#ifdef __cpluscplus
extern "C" 
{
#endif /* __cplusplus */

    GType libbalsa_identity_get_type(void);

#define LIBBALSA_TYPE_IDENTITY \
    (libbalsa_identity_get_type ())
#define LIBBALSA_IDENTITY(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST (obj, LIBBALSA_TYPE_IDENTITY, \
                                 LibBalsaIdentity))
#define LIBBALSA_IDENTITY_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST (klass, LIBBALSA_TYPE_IDENTITY, \
                              LibBalsaIdentityClass))
#define LIBBALSA_IS_IDENTITY(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE (obj, LIBBALSA_TYPE_IDENTITY))
#define LIBBALSA_IS_IDENTITY_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE (klass, LIBBALSA_TYPE_IDENTITY))

    typedef struct _LibBalsaIdentity LibBalsaIdentity;
    typedef struct _LibBalsaIdentityClass LibBalsaIdentityClass;
    
    
    struct _LibBalsaIdentity 
    {
        GObject object;
        
        gchar* identity_name;
        
        InternetAddress *ia;
        gchar* replyto;
        gchar* domain;
        gchar* bcc;
        gchar* reply_string;
        gchar* forward_string;

        gchar* signature_path;
        gboolean sig_executable;
	gboolean sig_sending;
        gboolean sig_whenforward;
        gboolean sig_whenreply;
        gboolean sig_separator;
        gboolean sig_prepend;
        gchar *face;
        gchar *x_face;

#ifdef HAVE_GPGME
	gboolean gpg_sign;
	gboolean gpg_encrypt;
	gboolean always_trust;
	gint crypt_protocol;
#endif
#if ENABLE_ESMTP
	LibBalsaSmtpServer *smtp_server;
#endif                          /* ENABLE_ESMTP */
    };

    struct _LibBalsaIdentityClass 
    {
        GObjectClass parent_class;
    };


/* Function prototypes */
    GObject* libbalsa_identity_new(void);
    GObject* libbalsa_identity_new_with_name(const gchar* ident_name);
    
    void libbalsa_identity_set_identity_name(LibBalsaIdentity*, const gchar*);
    void libbalsa_identity_set_address(LibBalsaIdentity*, InternetAddress*);
    void libbalsa_identity_set_replyto(LibBalsaIdentity*, const gchar*);
    void libbalsa_identity_set_domain(LibBalsaIdentity*, const gchar*);
    void libbalsa_identity_set_bcc(LibBalsaIdentity*, const gchar*);
    void libbalsa_identity_set_reply_string(LibBalsaIdentity* , const gchar*);
    void libbalsa_identity_set_forward_string(LibBalsaIdentity*, const gchar*);
    void libbalsa_identity_set_signature_path(LibBalsaIdentity*, const gchar*);
    void libbalsa_identity_set_sig_executable(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_sig_sending(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_sig_whenforward(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_sig_whenreply(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_sig_separator(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_sig_prepend(LibBalsaIdentity*, gboolean);
#if ENABLE_ESMTP
    void libbalsa_identity_set_smtp_server(LibBalsaIdentity * ident,
                                           LibBalsaSmtpServer *
                                           smtp_server);
#endif                          /* ENABLE_ESMTP */

#ifdef HAVE_GPGME
    void libbalsa_identity_set_gpg_sign(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_gpg_encrypt(LibBalsaIdentity*, gboolean);
    void libbalsa_identity_set_crypt_protocol(LibBalsaIdentity* ident, gint);
#endif

    void libbalsa_identity_config_dialog(GtkWindow * parent,
                                         GList ** identities,
                                         LibBalsaIdentity ** current,
#if ENABLE_ESMTP
					 GSList * smtp_servers,
#endif                          /* ENABLE_ESMTP */
                                         void (*changed_cb)(gpointer));

    typedef void (*LibBalsaIdentityCallback) (gpointer data,
                                              LibBalsaIdentity * identity);
    void libbalsa_identity_select_dialog(GtkWindow * parent,
                                         const gchar * prompt,
                                         GList * identities,
                                         LibBalsaIdentity * initial_id,
                                         LibBalsaIdentityCallback update,
                                         gpointer data);

    LibBalsaIdentity* libbalsa_identity_new_config(const gchar* name);
    void libbalsa_identity_save(LibBalsaIdentity* id, const gchar* prefix);

#ifdef __cplusplus
}
#endif
#endif /* __LIBBALSA_IDENTITY_H__ */