/* * This file is a part of Winix * and is not publicly distributed * * Copyright (c) 2008-2014, Tomasz Sowa * All rights reserved. * */ #ifndef headerfile_winix_notify_notifythread #define headerfile_winix_notify_notifythread #include "core/basethread.h" #include "templatesnotify.h" #include "ezc.h" #include "core/config.h" #include "core/users.h" #include "templates/patterns.h" namespace Winix { // we have set following pointers: request, config, system (from BaseThread) class NotifyThread : public BaseThread { public: NotifyThread(); void SetConfig(Config * pconfig); void SetUsers(Users * pusers); void SetNotifyPool(NotifyPool * pool); void SetPatterns(Patterns * pat); void PatternsChanged(); private: Config * config; Users * users; NotifyPool * notify_pool; Patterns * pat_global; NotifyUserMsg msg; typedef std::list NotifyUser; NotifyUser notify_user; std::string sendmail_command; bool patterns_changed; Patterns patterns; TemplatesNotifyFunctions::NotifyStream notify_stream; Ezc::Generator generator; virtual bool Init(); virtual bool SignalReceived(); bool AddNextNotify(); virtual void Do(); void SendMail(); void SendMail(const std::wstring & email, const std::wstring & message); void SendMail(FILE * sendmail, const std::wstring & message); }; } // namespace Winix #endif