4 * $TOG: MailSession.hh /main/8 1999/03/26 16:52:44 mgreess $
6 * RESTRICTED CONFIDENTIAL INFORMATION:
8 * The information in this document is subject to special
9 * restrictions in a confidential disclosure agreement between
10 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
11 * document outside HP, IBM, Sun, USL, SCO, or Univel without
12 * Sun's specific written approval. This document and all copies
13 * and derivative works thereof must be returned or destroyed at
16 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
21 #ifndef _MAILSESSION_HH
22 #define _MAILSESSION_HH
25 #include <sys/types.h>
27 #include <DtMail/DtMail.hh>
28 #include "RoamMenuWindow.h"
33 MailSession(DtMailEnv &, XtAppContext);
36 // raises ME_NotBento, ME_AlreadyLocked, ME_OtherAssumedRole, ME_NoSuchFile
37 DtMail::MailBox *open(DtMailEnv&, const char*, DtMailCallback, void*,
38 DtMailBoolean auto_create = DTM_TRUE,
39 DtMailBoolean request_lock = DTM_TRUE,
40 DtMailBoolean auto_parse = DTM_TRUE);
42 void close(DtMailEnv&, const DtMail::MailBox*);
44 // raises ME_UnknownFormat
45 void convert(DtMailEnv&, const char*, const char*,
46 DtMailStatusCallback cb_func = NULL,
47 void *client_data = NULL);
49 // raises ME_NotBento, ME_RequestDenied
50 void copy(DtMailEnv&, DtMail::Message&, const char*);
52 int isActiveRMW(RoamMenuWindow*);
53 void activateRMW(RoamMenuWindow*);
54 void deactivateRMW(RoamMenuWindow*);
55 RoamMenuWindow *getRMW(DtMail::MailBox* mbox);
56 RoamMenuWindow *getRMW(const char* path);
57 Boolean isMboxOpen(const char* path);
58 int numDeactivatedRMW() { return _num_deactivated; }
59 DtMail::Session *session(void) { return _app_session; }
64 DtMail::MailBox *handle;
72 DtVirtArray<MailBoxItem *> _open_mailboxes;
73 static DtMail::Session *_app_session;
74 static int _num_deactivated;
76 void addToList(DtMail::MailBox*, const char*, RoamMenuWindow*);
77 int locate(const char * path);
78 int locate(const DtMail::MailBox *);
79 int locate(const RoamMenuWindow *);
81 lockCB(Tt_message, Tttk_op, const char*, uid_t, int, void*);