summaryrefslogblamecommitdiffstats
path: root/src/slxbrowser.h
blob: ba95f6b1b7efc8e9c94538912ba03ce6a24e52f5 (plain) (tree)
1
2
3
4
5
6
7
8
9








                      
              


                    



                        
                       

                             
                                         
                 

  
                                     


                

                                             
                                             







                                                                               
                                

        
                                  
                         
                          
                          



                                    
                             


                             



                          
#ifndef SLXBROWSER_H_
#define SLXBROWSER_H_

#include <QMainWindow>
#include <QList>
#include <QSslError>
#include <QTimer>

class QNetworkReply;
class WebView;
class QProgressBar;
class QNetworkReply;

struct BrowserSettings
{
	QString url;
	bool fullscreen;
	bool maximized;
	bool ignoreSslErrors;
	int reloadInterval;
	QStringList blackList, whiteList;
	int zoom;
};

class SlxBrowser : public QMainWindow
{
	Q_OBJECT
public:
	SlxBrowser(BrowserSettings settings);
	virtual ~SlxBrowser();
	void activity() { _activity = true; }

private slots:
	void loadStarted();
	void loadFinished(bool ok);
	void loadProgress(int progress);
	void sslErrors(QNetworkReply * reply, const QList<QSslError> & errors);
	void requestFinished(QNetworkReply *reply);
	void reloadInitial();
	void maybeTriggerBack();

private:
	BrowserSettings _settings;
    bool _unsupportedUri;
	bool _blockedSite;
	WebView *_browser;
	QProgressBar *_progress;
	QTimer _reset;
	QList<QSslError> _sslErrors;
	QString _normalError;
	qint64 _lastPageLoad;
	bool _activity;
	qint64 _lastActivity;
	bool _pageValid;
};

#endif /* SLXBROWSER_H_ */