1 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
2 /* Balsa E-Mail Client
3  *
4  * Copyright (C) 1997-2013 Stuart Parmenter and others,
5  *                         See the file AUTHORS for a list.
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, or (at your option)
10  * 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., 59 Temple Place - Suite 330, Boston, MA
20  * 02111-1307, USA.
21  */
22 
23 
24 #ifndef __LIBBALSA_MAILBOX_REMOTE_H__
25 #define __LIBBALSA_MAILBOX_REMOTE_H__
26 
27 #include "libbalsa.h"
28 
29 /* Imap and Pop3 are remote mailboxes
30 
31    this object doesn't do any real work.  it is abstract
32 
33      this mini-struct greatly helps in getting the server
34      from the mailbox without having a Server pointer off of
35      all mailboxes....  which arguably we might want eventually,
36      and claim that a directory is a "server", but until then...
37  */
38 #define LIBBALSA_TYPE_MAILBOX_REMOTE \
39     (libbalsa_mailbox_remote_get_type())
40 #define LIBBALSA_MAILBOX_REMOTE(obj) \
41     (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBBALSA_TYPE_MAILBOX_REMOTE, \
42                                  LibBalsaMailboxRemote))
43 #define LIBBALSA_MAILBOX_REMOTE_CLASS(klass) \
44     (G_TYPE_CHECK_CLASS_CAST ((klass), LIBBALSA_TYPE_MAILBOX, \
45                               LibBalsaMailboxRemoteClass))
46 #define LIBBALSA_IS_MAILBOX_REMOTE(obj) \
47     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBBALSA_TYPE_MAILBOX_REMOTE))
48 #define LIBBALSA_IS_MAILBOX_REMOTE_CLASS(klass) \
49     (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBBALSA_TYPE_MAILBOX_REMOTE))
50 
51 #define LIBBALSA_MAILBOX_REMOTE_SERVER(mailbox) \
52     (LIBBALSA_SERVER(LIBBALSA_MAILBOX_REMOTE(mailbox)->server))
53 
54 typedef struct _LibBalsaMailboxRemoteClass LibBalsaMailboxRemoteClass;
55 
56 struct _LibBalsaMailboxRemote {
57     LibBalsaMailbox mailbox;
58 
59     LibBalsaServer *server;
60 };
61 
62 struct _LibBalsaMailboxRemoteClass {
63     LibBalsaMailboxClass parent_class;
64 };
65 
66 GType libbalsa_mailbox_remote_get_type(void);
67 
68 void libbalsa_mailbox_remote_set_server(LibBalsaMailboxRemote* m,
69 					LibBalsaServer* s);
70 
71 #endif				/* __LIBBALSA_MAILBOX_REMOTE_H__ */
72