2010-12-02 02:02:02 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_notify_notifypool
|
|
|
|
#define headerfile_winix_notify_notifypool
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
#include <list>
|
|
|
|
#include <string>
|
|
|
|
#include "templates/locale.h"
|
|
|
|
|
|
|
|
|
2011-01-26 13:45:38 +01:00
|
|
|
#define WINIX_NOTIFY_CODE_ADD 1
|
|
|
|
#define WINIX_NOTIFY_CODE_EDIT 2
|
|
|
|
#define WINIX_NOTIFY_CODE_DELETE 4
|
|
|
|
#define WINIX_NOTIFY_CODE_REPLY 8
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-06 01:25:46 +01:00
|
|
|
// additional codes, use it of your own
|
|
|
|
// you should prepare NotifyMsg structure and use it with ItemChanged method of notify object
|
2011-01-26 13:45:38 +01:00
|
|
|
/* temporarily not used
|
2010-12-06 01:25:46 +01:00
|
|
|
#define WINIX_NOTIFY_CODE_USER1 1024
|
|
|
|
#define WINIX_NOTIFY_CODE_USER2 2048
|
|
|
|
#define WINIX_NOTIFY_CODE_USER3 4096
|
|
|
|
#define WINIX_NOTIFY_CODE_USER4 8192
|
|
|
|
#define WINIX_NOTIFY_CODE_USER5 16384
|
|
|
|
#define WINIX_NOTIFY_CODE_USER6 32768
|
|
|
|
#define WINIX_NOTIFY_CODE_USER7 65536
|
|
|
|
#define WINIX_NOTIFY_CODE_USER8 131072
|
2011-01-26 13:45:38 +01:00
|
|
|
*/
|
2010-12-06 01:25:46 +01:00
|
|
|
|
2010-12-02 02:02:02 +01:00
|
|
|
|
|
|
|
struct NotifyMsg
|
|
|
|
{
|
|
|
|
int code;
|
|
|
|
std::wstring item_link; // link to a file or a dir (can be the same as dir_link if the item is a directory)
|
|
|
|
std::wstring dir_link; // link to a dir
|
|
|
|
size_t template_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// used by the second thread (and its templates)
|
|
|
|
struct NotifyUserMsg
|
|
|
|
{
|
|
|
|
std::wstring name;
|
|
|
|
std::wstring email;
|
2011-02-24 18:06:12 +01:00
|
|
|
size_t lang;
|
2010-12-02 02:02:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NotifyPool
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
bool Empty() const;
|
|
|
|
size_t Size() const;
|
|
|
|
|
|
|
|
NotifyMsg & GetFirst();
|
|
|
|
void DeleteFirst();
|
|
|
|
void Add(const NotifyMsg & msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
std::list<NotifyMsg> notify_pool;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|