Files
winix/notify/notifythread.h
Tomasz Sowa 5b8a9c0108 added: Patterns class (in templates)
ezc patterns are managed by this class
added: some work in groupitem plugin (not finished yet)
changed: ConfParser can read a string from memory now
         (need some testing yet)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@757 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-08-25 23:53:49 +00:00

67 lines
1.3 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2011, 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"
// 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<NotifyUserMsg> NotifyUser;
NotifyUser notify_user;
std::string sendmail_command;
bool patterns_changed;
Patterns patterns;
TemplatesNotifyFunctions::NotifyStream notify_stream;
Ezc::Generator<TemplatesNotifyFunctions::NotifyStream> 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);
};
#endif