diff options
author | Christian Wieninger <winni@debian.(none)> | 2007-11-11 15:40:28 +0100 |
---|---|---|
committer | Christian Wieninger <winni@debian.(none)> | 2007-11-11 15:40:28 +0100 |
commit | 8d4f8607dc1558ce73eb4c376bdbf78ddb65da83 (patch) | |
tree | d0c5dde81a36ab2e8a2edc7c1e6922556518b312 /mail.h | |
download | vdr-plugin-epgsearch-8d4f8607dc1558ce73eb4c376bdbf78ddb65da83.tar.gz vdr-plugin-epgsearch-8d4f8607dc1558ce73eb4c376bdbf78ddb65da83.tar.bz2 |
Initial commit
Diffstat (limited to 'mail.h')
-rw-r--r-- | mail.h | 106 |
1 files changed, 106 insertions, 0 deletions
@@ -0,0 +1,106 @@ +/* +Copyright (C) 2004-2007 Christian Wieninger + +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + +The author can be reached at cwieninger@gmx.de + +The project's page is at http://winni.vdr-developer.org/epgsearch +*/ + +#ifndef __EPGSEARCH_MAIL_H +#define __EPGSEARCH_MAIL_H + +#include <string> +#include <set> + +#include <vdr/thread.h> +#include <vdr/plugin.h> +#include "conflictcheck.h" + +using std::string; +using std::set; + +// --- cMailNotifier -------------------------------------------------------- +class cMailNotifier +{ + protected: + string subject; + string body; + + bool SendMailViaSendmail(); + bool SendMailViaScript(); + bool SendMail(); + bool ExecuteMailScript(string ScriptArgs); + public: + string scriptReply; + + cMailNotifier() {} + cMailNotifier(string Subject, string Body); + bool TestMailAccount(string MailAddressTo, string MailAddress, string MailServer, string AuthUser, string AuthPass); + static string LoadTemplate(const string& templtype); + static string GetTemplValue(const string& templ, const string& entry); + + static string MailCmd; +}; + +class cMailTimerNotification +{ + tEventID eventID; + tChannelID channelID; + + const cEvent* GetEvent() const; + + public: + cMailTimerNotification(tEventID EventID, tChannelID ChannelID) + : eventID(EventID), channelID(ChannelID) {} + bool operator< (const cMailTimerNotification &N) const; + string Format(const string& templ) const; +}; + +class cMailDelTimerNotification +{ + tChannelID channelID; + time_t start; + public: + string formatted; + + cMailDelTimerNotification(cTimer* t, const cEvent* pEvent, const string& templ); + bool operator< (const cMailDelTimerNotification &N) const; +}; + +class cMailUpdateNotifier : public cMailNotifier +{ + set<cMailTimerNotification> newTimers; + set<cMailTimerNotification> modTimers; + set<cMailDelTimerNotification> delTimers; + + string mailTemplate; + public: + cMailUpdateNotifier(); + void AddNewTimerNotification(tEventID EventID, tChannelID ChannelID); + void AddModTimerNotification(tEventID EventID, tChannelID ChannelID); + void AddRemoveTimerNotification(cTimer* t, const cEvent* e = NULL); + void SendUpdateNotifications(); +}; + +class cMailConflictNotifier : public cMailNotifier +{ + public: + void SendConflictNotifications(cConflictCheck& conflictcheck); +}; + +#endif |