PageRenderTime 142ms CodeModel.GetById 80ms app.highlight 3ms RepoModel.GetById 58ms app.codeStats 0ms

/thirdparty/liblastfm2/src/ws/win/Pac.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 52 lines | 23 code | 7 blank | 22 comment | 0 complexity | 503e5f406993f7a9ff38f6a1292b913a MD5 | raw file
 1/*
 2   Copyright 2009 Last.fm Ltd. 
 3      - Primarily authored by Max Howell, Jono Cole and Doug Mansell
 4
 5   This file is part of liblastfm.
 6
 7   liblastfm is free software: you can redistribute it and/or modify
 8   it under the terms of the GNU General Public License as published by
 9   the Free Software Foundation, either version 3 of the License, or
10   (at your option) any later version.
11
12   liblastfm is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   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 liblastfm.  If not, see <http://www.gnu.org/licenses/>.
19*/
20#ifndef WS_AUTOPROXY_H
21#define WS_AUTOPROXY_H
22
23#include <QNetworkProxy>
24#include <windows.h>
25#include <winhttp.h>
26class QNetworkRequest;
27 
28namespace lastfm
29{
30    /** @brief simple wrapper to do per url automatic proxy detection 
31      * @author <doug@last.fm>
32      */
33    class Pac
34    {    
35        HINTERNET m_hSession;
36        bool m_bFailed;
37
38    public:
39        Pac();
40        ~Pac();
41
42        QNetworkProxy resolve( const QNetworkRequest& url, const wchar_t* pacUrl );
43
44        void resetFailedState() { m_bFailed = false; }
45
46    private:
47        Pac( const Pac& ); //undefined
48        Pac operator=( const Pac& ); //undefined
49    };
50}
51
52#endif