2010-12-02 02:02:02 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2011-07-29 00:18:10 +02:00
|
|
|
* Copyright (c) 2010-2011, Tomasz Sowa
|
2010-12-02 02:02:02 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_notify_notify
|
|
|
|
#define headerfile_winix_notify_notify
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include "notifypool.h"
|
|
|
|
#include "templates/misc.h"
|
|
|
|
#include "notifythread.h"
|
|
|
|
|
|
|
|
|
|
|
|
class Request;
|
|
|
|
class Config;
|
|
|
|
class Users;
|
|
|
|
class Dirs;
|
|
|
|
class Synchro;
|
2011-07-29 00:18:10 +02:00
|
|
|
class ThreadManager;
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Notify
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Notify();
|
|
|
|
|
|
|
|
void SetSynchro(Synchro * psynchro);
|
2011-01-23 15:15:30 +01:00
|
|
|
void SetCur(Cur * pcur);
|
2010-12-02 02:02:02 +01:00
|
|
|
void SetConfig(Config * pconfig);
|
|
|
|
void SetUsers(Users * pusers);
|
|
|
|
void SetDirs(Dirs * pdirs);
|
2011-07-29 00:18:10 +02:00
|
|
|
void SetThreadManager(ThreadManager * pmanager);
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
size_t AddTemplate(const std::wstring & file_name);
|
|
|
|
void ReadTemplates();
|
|
|
|
|
|
|
|
void ItemChanged(int notify_code, const Item & item);
|
2010-12-06 01:25:46 +01:00
|
|
|
void ItemChanged(const NotifyMsg & msg);
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
Cur * cur;
|
2010-12-02 02:02:02 +01:00
|
|
|
Config * config;
|
|
|
|
Dirs * dirs;
|
|
|
|
Users * users;
|
|
|
|
Synchro * synchro;
|
2011-07-29 00:18:10 +02:00
|
|
|
ThreadManager * thread_manager;
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
NotifyThread notify_thread;
|
|
|
|
NotifyMsg msg;
|
|
|
|
NotifyPool notify_pool;
|
|
|
|
|
|
|
|
size_t notify_template_cms;
|
|
|
|
|
|
|
|
// templates file names
|
|
|
|
std::vector<std::wstring> templates_names;
|
|
|
|
|
|
|
|
// vector table [language][file]
|
|
|
|
TemplatesFunctions::Patterns patterns;
|
|
|
|
|
|
|
|
void CreateItemLink(const Item & item, std::wstring & link, std::wstring & dir_link);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|