80 lines
1.3 KiB
C++
Executable File
80 lines
1.3 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfilecmslunotify
|
|
#define headerfilecmslunotify
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include "notifypool.h"
|
|
#include "templates/misc.h"
|
|
#include "notifythread.h"
|
|
|
|
|
|
class Request;
|
|
class Config;
|
|
class Users;
|
|
class Dirs;
|
|
class Synchro;
|
|
|
|
|
|
class Notify
|
|
{
|
|
public:
|
|
|
|
Notify();
|
|
|
|
void SetSynchro(Synchro * psynchro);
|
|
void SetRequest(Request * prequest);
|
|
void SetConfig(Config * pconfig);
|
|
void SetUsers(Users * pusers);
|
|
void SetDirs(Dirs * pdirs);
|
|
|
|
void Init();
|
|
|
|
void StartThread();
|
|
void PrepareToStopThread();
|
|
void WaitForThread();
|
|
|
|
size_t AddTemplate(const std::wstring & file_name);
|
|
void ReadTemplates();
|
|
|
|
void ItemChanged(int notify_code, const Item & item);
|
|
void ItemChanged(const NotifyMsg & msg);
|
|
|
|
private:
|
|
|
|
Request * request;
|
|
Config * config;
|
|
Dirs * dirs;
|
|
Users * users;
|
|
Synchro * synchro;
|
|
|
|
NotifyThread notify_thread;
|
|
NotifyMsg msg;
|
|
NotifyPool notify_pool;
|
|
|
|
size_t notify_template_cms;
|
|
size_t notify_template_thread;
|
|
|
|
// 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
|