summaryrefslogtreecommitdiffstats
path: root/libmail/addressbookopen.H
diff options
context:
space:
mode:
Diffstat (limited to 'libmail/addressbookopen.H')
-rw-r--r--libmail/addressbookopen.H49
1 files changed, 49 insertions, 0 deletions
diff --git a/libmail/addressbookopen.H b/libmail/addressbookopen.H
new file mode 100644
index 0000000..b00995c
--- /dev/null
+++ b/libmail/addressbookopen.H
@@ -0,0 +1,49 @@
+/*
+** Copyright 2002, Double Precision Inc.
+**
+** See COPYING for distribution information.
+*/
+#ifndef libmail_addressbookopen_H
+#define libmail_addressbookopen_H
+
+#include "addressbook.H"
+#include "structure.H"
+
+//
+// Open the address book, as follows:
+//
+// 1. Select the folder.
+//
+// 2. Read envelopes of all messages in the folder
+
+class mail::addressbook::Open : public mail::callback::message {
+
+ mail::ptr<mail::addressbook> addressBook;
+ mail::callback &callback;
+
+ void success(std::string successMsg);
+ void (mail::addressbook::Open::*successFunc)(std::string);
+
+ void fail(std::string failMsg);
+
+ void opened(std::string successMsg);
+ void readIndex(std::string successMsg);
+
+ void messageEnvelopeCallback(size_t messageNumber,
+ const class mail::envelope &envelope);
+
+ void reportProgress(size_t bytesCompleted,
+ size_t bytesEstimatedTotal,
+
+ size_t messagesCompleted,
+ size_t messagesEstimatedTotal);
+
+public:
+ Open(mail::addressbook *addressBookArg,
+ mail::callback &callbackArg);
+ ~Open();
+
+ void go();
+};
+
+#endif