summaryrefslogtreecommitdiff
path: root/plugins/Exchange/src/emails.h
diff options
context:
space:
mode:
authorMaciej Wycik <makar@poczta.of.pl>2013-06-03 11:17:43 +0000
committerMaciej Wycik <makar@poczta.of.pl>2013-06-03 11:17:43 +0000
commit9f631693a3094124ac7f34f1fa34008116ba6afc (patch)
tree903692d7b9132a6000d5865cdddcea88fdf8378a /plugins/Exchange/src/emails.h
parentde9cbaa3b7e815a2a95e894e796196bf5629543d (diff)
based on IM 0.0.3.4 Exchange plugin
+Unicode support git-svn-id: http://svn.miranda-ng.org/main/trunk@4870 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Exchange/src/emails.h')
-rw-r--r--plugins/Exchange/src/emails.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/plugins/Exchange/src/emails.h b/plugins/Exchange/src/emails.h
new file mode 100644
index 0000000000..24f63ab233
--- /dev/null
+++ b/plugins/Exchange/src/emails.h
@@ -0,0 +1,96 @@
+/*
+Exchange notifier plugin for Miranda IM
+
+Copyright © 2006 Cristian Libotean, Attila Vajda
+
+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
+of the License, 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 M_EXCHANGE_EMAILS_H
+#define M_EXCHANGE_EMAILS_H
+
+//define if you want to test only the miranda part, and not the exchange one.
+//#define NO_EXCHANGE_TEST
+
+#include "commonheaders.h"
+
+#ifndef NO_EXCHANGE_TEST
+#include "MirandaExchange.h"
+#endif
+
+#define MAX_EXCHANGE_CONNECT_RETRIES 15
+
+struct TEmailHeader{
+ int cbSize;
+ DWORD flags; //flags
+ TCHAR *szSender; //pointer to string that receives the sender name
+ int cSender; //size of szSender buffer
+ TCHAR *szSubject; //pointer to string that receives the email subject
+ int cSubject; //size of szSubject buffer
+ char *emailID;
+};
+
+#ifndef NO_EXCHANGE_TEST
+class CExchangeServer: public CMirandaExchange{
+#else
+class CExchangeServer{
+#endif
+ protected:
+ int bConnected; //are we connected
+ int cConnections; //number of connection attempts
+ int bTryConnect;
+
+ int DoConnect(TCHAR *user, TCHAR *password, TCHAR *server, int port);
+ int DoDisconnect();
+
+ public:
+ CExchangeServer();
+ ~CExchangeServer();
+
+ int Connect(int bRestartCounter = 0);
+ int Disconnect();
+ int Reconnect();
+
+ int IsConnected();
+ int IsServerAvailable();
+
+ /*
+ Returns the number of unread emails.
+ */
+ int GetUnreadEmailsCount();
+ /*
+ iUnreadEmail - the index of the unread email, 0 = the oldest unread email, <count> = the newest unread email.
+ emailInfo - will be filled with the relevant info (sender and subject). cbSize will be set before the call to the function; the caller also has to allocate memory for the sender and subject
+ */
+ int GetEmailHeader(int iUnreadEmail, TEmailHeader *emailInfo);
+
+ /*
+ */
+ int MarkEmailAsRead(TCHAR *emailID);
+
+ int OpenMessage(TCHAR *emailID);
+
+ int Check(int bNoEmailsNotify = FALSE);
+};
+
+extern CExchangeServer &exchangeServer;
+
+int ShowMessage(TCHAR *message, int cUnreadEmails);
+int ShowPopupMessage(TCHAR *title, TCHAR *message, int cUnreadEmails);
+int ShowMessageBoxMessage(TCHAR *title, TCHAR *message, int cUnreadEmails);
+
+int ShowEmailsWindow(int cUnreadEmails);
+
+#endif //M_EXCHANGE_EMAILS_H