url.hh (910B)
1 #ifndef __GUCK__BROWSER__STATUSBAR__URL__GUARD__ 2 #define __GUCK__BROWSER__STATUSBAR__URL__GUARD__ 3 4 #include "textbase.hh" 5 6 #include <QWidget> 7 #include <QUrl> 8 9 10 enum class urltype_t 11 { 12 success, 13 success_https, 14 error, 15 warn, 16 hover, 17 normal 18 }; 19 20 class url_t : public textbase_t 21 { 22 Q_OBJECT 23 24 public: 25 url_t(QWidget& parent) 26 : textbase_t(parent), 27 m_parent(parent), 28 m_hover(""), 29 m_loaded("https://deurzen.net"), 30 m_type(urltype_t::normal), 31 m_status(urltype_t::normal) 32 { 33 update(); 34 } 35 36 void update(); 37 void on_tab_change(QUrl); 38 39 protected slots: 40 void on_status_change(); 41 void on_set_loaded(QUrl); 42 void on_set_hover(std::string&); 43 44 private: 45 QWidget& m_parent; 46 47 QUrl m_hover; 48 QUrl m_loaded; 49 50 urltype_t m_type; 51 urltype_t m_status; 52 53 }; 54 55 #endif//__GUCK__BROWSER__STATUSBAR__URL__GUARD__