2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
26 * $TOG: MailSession.hh /main/8 1999/03/26 16:52:44 mgreess $
28 * RESTRICTED CONFIDENTIAL INFORMATION:
30 * The information in this document is subject to special
31 * restrictions in a confidential disclosure agreement between
32 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
33 * document outside HP, IBM, Sun, USL, SCO, or Univel without
34 * Sun's specific written approval. This document and all copies
35 * and derivative works thereof must be returned or destroyed at
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
43 #ifndef _MAILSESSION_HH
44 #define _MAILSESSION_HH
47 #include <sys/types.h>
49 #include <DtMail/DtMail.hh>
50 #include "RoamMenuWindow.h"
55 MailSession(DtMailEnv &, XtAppContext);
58 // raises ME_NotBento, ME_AlreadyLocked, ME_OtherAssumedRole, ME_NoSuchFile
59 DtMail::MailBox *open(DtMailEnv&, const char*, DtMailCallback, void*,
60 DtMailBoolean auto_create = DTM_TRUE,
61 DtMailBoolean request_lock = DTM_TRUE,
62 DtMailBoolean auto_parse = DTM_TRUE);
64 void close(DtMailEnv&, const DtMail::MailBox*);
66 // raises ME_UnknownFormat
67 void convert(DtMailEnv&, const char*, const char*,
68 DtMailStatusCallback cb_func = NULL,
69 void *client_data = NULL);
71 // raises ME_NotBento, ME_RequestDenied
72 void copy(DtMailEnv&, DtMail::Message&, const char*);
74 int isActiveRMW(RoamMenuWindow*);
75 void activateRMW(RoamMenuWindow*);
76 void deactivateRMW(RoamMenuWindow*);
77 RoamMenuWindow *getRMW(DtMail::MailBox* mbox);
78 RoamMenuWindow *getRMW(const char* path);
79 Boolean isMboxOpen(const char* path);
80 int numDeactivatedRMW() { return _num_deactivated; }
81 DtMail::Session *session(void) { return _app_session; }
86 DtMail::MailBox *handle;
94 DtVirtArray<MailBoxItem *> _open_mailboxes;
95 static DtMail::Session *_app_session;
96 static int _num_deactivated;
98 void addToList(DtMail::MailBox*, const char*, RoamMenuWindow*);
99 int locate(const char * path);
100 int locate(const DtMail::MailBox *);
101 int locate(const RoamMenuWindow *);
103 lockCB(Tt_message, Tttk_op, const char*, uid_t, int, void*);