forked from rainmeter/rainmeter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeasureWebParser.h
75 lines (63 loc) · 2.09 KB
/
MeasureWebParser.h
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
/* Copyright (C) 2015 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed with this file, You can
* obtain one at <https://www.gnu.org/licenses/gpl-2.0.html>. */
#ifndef RM_LIBRARY_MEASUREWEBPARSER_H_
#define RM_LIBRARY_MEASUREWEBPARSER_H_
#include "Measure.h"
struct ProxySetting
{
std::wstring agent;
std::wstring server;
HINTERNET handle;
ProxySetting() : handle() {}
};
class MeasureWebParser : public Measure
{
public:
MeasureWebParser(Skin* skin, const WCHAR* name);
virtual ~MeasureWebParser();
MeasureWebParser(const MeasureWebParser& other) = delete;
MeasureWebParser& operator=(MeasureWebParser other) = delete;
UINT GetTypeID() override { return TypeID<MeasureWebParser>(); }
const WCHAR* GetStringValue() override;
protected:
void ReadOptions(ConfigParser& parser, const WCHAR* section) override;
void UpdateValue() override;
void Command(const std::wstring& command) override;
private:
static unsigned __stdcall NetworkThreadProc(void* pParam);
static unsigned __stdcall NetworkDownloadThreadProc(void* pParam);
void ParseData(const BYTE* rawData, DWORD rawSize, bool utf16Data = false);
std::wstring m_Url;
std::wstring m_RegExp;
std::wstring m_ResultString;
std::wstring m_ErrorString;
std::wstring m_FinishAction;
std::wstring m_OnRegExpErrAction;
std::wstring m_OnConnectErrAction;
std::wstring m_OnDownloadErrAction;
std::wstring m_DownloadFolder;
std::wstring m_DownloadFile;
std::wstring m_DownloadedFile;
std::wstring m_DebugFileLocation;
std::wstring m_Headers;
ProxySetting m_Proxy;
HANDLE m_ThreadHandle;
HANDLE m_DlThreadHandle;
int m_Codepage;
int m_StringIndex;
int m_StringIndex2;
int m_DecodeCharacterReference;
bool m_DecodeCodePoints;
int m_Debug;
UINT m_UpdateRate;
UINT m_UpdateCounter;
bool m_Download;
bool m_ForceReload;
bool m_LogSubstringErrors;
DWORD m_InternetOpenUrlFlags;
};
#endif