/* This file is (c) 2008-2012 Konstantin Isakov * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ #ifndef __ARTICLE_NETMGR_HH_INCLUDED__ #define __ARTICLE_NETMGR_HH_INCLUDED__ #include #if QT_VERSION >= 0x050200 // Qt 5.2+ #include #include #include #include #endif #include "dictionary.hh" #include "article_maker.hh" using std::vector; /// A custom QNetworkAccessManager version which fetches images from the /// dictionaries when requested. #if QT_VERSION >= 0x050200 // Qt 5.2+ // White lists for QWebSecurityOrigin struct SecurityWhiteList { QWebSecurityOrigin * origin; QString originUri; QSet< QPair< QString, QString > > hostsToAccess; SecurityWhiteList() : origin( 0 ) {} ~SecurityWhiteList() { swlDelete(); } SecurityWhiteList( SecurityWhiteList const & swl ) : origin( 0 ) { swlCopy( swl ); } SecurityWhiteList & operator=( SecurityWhiteList const & swl ); QWebSecurityOrigin * setOrigin( QUrl const & url ); private: void swlCopy( SecurityWhiteList const & swl ); void swlDelete(); }; typedef QMap< QString, SecurityWhiteList > Origins; // Proxy class for QNetworkReply to remove X-Frame-Options header // It allow to show websites in