summaryrefslogtreecommitdiff
path: root/plugins/Db_autobackups/src/stdafx.h
blob: 9c84fc678ca00754e1a0e4e6b12e2001360ed6d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef _HEADERS_H
#define _HEADERS_H

#define _CRT_SECURE_NO_DEPRECATE

#include <windows.h>
#include <shlobj.h>
#include <time.h>

#include <string>
#include <vector>
#include <functional>
#include <filesystem>

namespace fs = std::filesystem;

#include <newpluginapi.h>
#include <m_clist.h>
#include <m_database.h>
#include <m_db_int.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_popup.h>
#include <m_skin.h>
#include <m_icolib.h>
#include <m_autobackups.h>
#include <m_gui.h>
#include <m_timezones.h>
#include <m_variables.h>

#include <m_folders.h>
#include <m_cloudfile.h>

#define MODULENAME "AutoBackups"

struct CMPlugin : public PLUGIN<CMPlugin>
{
	CMPlugin();

	bool bCloudFilePresent = false;
	HANDLE hevBackup;
	wchar_t folder[MAX_PATH];

	CMOption<uint8_t>	    backup_types;
	CMOption<uint16_t>	    period;
	CMOption<uint8_t>	    period_type;
	CMOption<wchar_t*> file_mask;
	CMOption<uint16_t>	    num_backups;
	CMOption<uint8_t>	    disable_progress;
	CMOption<uint8_t>	    disable_popups;
	CMOption<uint8_t>	    use_zip;
	CMOption<uint8_t>	    backup_profile;
	CMOption<uint8_t>	    use_cloudfile;
	CMOption<char*>    cloudfile_service;

	int Load() override;
};

#include "options.h"
#include "resource.h"
#include "version.h"

#define SUB_DIR L"\\AutoBackups"
#define DIR L"%miranda_userdata%"

#define ME_AUTOBACKUP_DONE "Autobackup/Done"

int  SetBackupTimer(void);
int  OptionsInit(WPARAM wParam, LPARAM lParam);
void BackupStart(wchar_t *backup_filename);
int  BackupStatus(void);

struct ZipFile
{
	std::wstring sPath;
	std::wstring sZipPath;
	__forceinline ZipFile(const std::wstring &path, const std::wstring &zpath) : sPath(path), sZipPath(zpath) {}
};

int CreateZipFile(const wchar_t *szDestPath, OBJLIST<ZipFile> &lstFiles, const std::function<bool(size_t)> &fnCallback);

extern char g_szMirVer[];

#endif