MiKTeX 26.5-next
A scalable TeX distribution
Loading...
Searching...
No Matches
WebSession.h
1/* WebSession.h: -*- C++ -*-
2
3 Copyright (C) 2001-2019 Christian Schenk
4
5 This file is part of MiKTeX Package Manager.
6
7 MiKTeX Package Manager is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2, or
10 (at your option) any later version.
11
12 MiKTeX Package Manager is distributed in the hope that it will be
13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with MiKTeX Package Manager; if not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22#if !defined(F6B44E9392E34710903AB2F8D335A1FA)
23#define F6B44E9392E34710903AB2F8D335A1FA
24
25#include <memory>
26#include <string>
27#include <unordered_map>
28
29#include "WebFile.h"
30
31MPM_INTERNAL_BEGIN_NAMESPACE;
32
33class MIKTEXNOVTABLE IProgressNotify_
34{
35public:
36 virtual void OnProgress() = 0;
37};
38
39class MIKTEXNOVTABLE WebSession
40{
41public:
42 virtual ~WebSession() = 0;
43
44public:
45 virtual std::unique_ptr<WebFile> OpenUrl(const std::string& url) = 0;
46
47public:
48 virtual std::unique_ptr<WebFile> OpenUrl(const std::string& url, const std::unordered_map<std::string, std::string>& formData) = 0;
49
50public:
51 virtual void SetCustomHeaders(const std::unordered_map<std::string, std::string>& headers) = 0;
52
53public:
54 virtual void Dispose() = 0;
55
56public:
57 static std::shared_ptr<WebSession> Create(IProgressNotify_* pIProgressNotify);
58};
59
60MPM_INTERNAL_END_NAMESPACE;
61
62#endif
Definition WebSession.h:40