2011-03-03 18:29:20 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-08 10:39:41 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
2011-03-03 18:29:20 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-03-02 16:57:41 +01:00
|
|
|
#ifndef LOCATIONBAR_H
|
|
|
|
#define LOCATIONBAR_H
|
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2011-03-02 16:57:41 +01:00
|
|
|
#include "lineedit.h"
|
|
|
|
|
2014-03-15 23:22:35 +01:00
|
|
|
class QStringListModel;
|
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
class BrowserWindow;
|
2011-03-02 16:57:41 +01:00
|
|
|
class LocationCompleter;
|
|
|
|
class ClickableLabel;
|
2012-01-21 20:27:45 +01:00
|
|
|
class TabbedWebView;
|
2014-02-09 12:22:49 +01:00
|
|
|
class BookmarksIcon;
|
2011-12-17 14:26:34 +01:00
|
|
|
class SiteIcon;
|
2011-12-27 18:50:52 +01:00
|
|
|
class GoIcon;
|
|
|
|
class RssIcon;
|
2013-02-08 18:44:26 +01:00
|
|
|
class AutoFillIcon;
|
2014-03-19 21:27:43 +01:00
|
|
|
class LoadRequest;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2014-02-19 22:12:32 +01:00
|
|
|
class QUPZILLA_EXPORT LocationBar : public LineEdit
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
2011-07-11 20:30:49 +02:00
|
|
|
Q_OBJECT
|
2011-09-11 19:15:06 +02:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
public:
|
2014-02-19 22:07:21 +01:00
|
|
|
explicit LocationBar(BrowserWindow* window);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2014-03-15 23:22:35 +01:00
|
|
|
TabbedWebView* webView() const;
|
2012-08-24 20:53:53 +02:00
|
|
|
void setWebView(TabbedWebView* view);
|
2011-12-15 17:43:06 +01:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
public slots:
|
2012-04-22 17:09:43 +02:00
|
|
|
void setText(const QString &text);
|
2014-03-15 23:22:35 +01:00
|
|
|
void showUrl(const QUrl &url);
|
2011-03-03 14:25:02 +01:00
|
|
|
|
|
|
|
private slots:
|
2014-03-16 12:11:24 +01:00
|
|
|
void textEditted();
|
|
|
|
void requestLoadUrl();
|
2013-02-10 12:28:53 +01:00
|
|
|
void pasteAndGo();
|
|
|
|
|
2014-03-16 12:11:24 +01:00
|
|
|
void updateSiteIcon();
|
2011-11-06 12:05:16 +01:00
|
|
|
void updatePlaceHolderText();
|
2014-03-16 12:11:24 +01:00
|
|
|
|
|
|
|
void setPrivacyState(bool state);
|
|
|
|
void setRssIconVisible(bool state);
|
|
|
|
void setGoIconVisible(bool state);
|
|
|
|
|
2014-03-15 19:36:03 +01:00
|
|
|
void showCompletion(const QString &completion);
|
2014-03-15 23:22:35 +01:00
|
|
|
void showDomainCompletion(const QString &completion);
|
2014-03-01 13:02:57 +01:00
|
|
|
void clearCompletion();
|
2011-11-06 12:05:16 +01:00
|
|
|
|
2014-03-16 12:11:24 +01:00
|
|
|
void loadStarted();
|
|
|
|
void loadProgress(int progress);
|
|
|
|
void loadFinished();
|
2012-08-24 20:53:53 +02:00
|
|
|
void hideProgress();
|
|
|
|
|
2014-03-09 12:49:45 +01:00
|
|
|
void loadSettings();
|
2012-09-19 10:08:30 +02:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
private:
|
2012-09-19 10:08:30 +02:00
|
|
|
enum ProgressStyle {
|
|
|
|
ProgressFilled,
|
|
|
|
ProgressBottom,
|
|
|
|
ProgressTop
|
|
|
|
};
|
|
|
|
|
2012-01-21 19:26:47 +01:00
|
|
|
void contextMenuEvent(QContextMenuEvent* event);
|
2014-03-15 23:22:35 +01:00
|
|
|
void showEvent(QShowEvent* event);
|
2012-09-06 10:53:37 +02:00
|
|
|
void focusInEvent(QFocusEvent* event);
|
|
|
|
void focusOutEvent(QFocusEvent* event);
|
2011-03-17 17:03:04 +01:00
|
|
|
void keyPressEvent(QKeyEvent* event);
|
2012-01-18 16:52:30 +01:00
|
|
|
void keyReleaseEvent(QKeyEvent* event);
|
2011-03-17 17:03:04 +01:00
|
|
|
void dropEvent(QDropEvent* event);
|
2014-03-16 13:06:38 +01:00
|
|
|
void paintEvent(QPaintEvent* event);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2014-03-19 21:27:43 +01:00
|
|
|
LoadRequest createLoadRequest() const;
|
2012-09-06 10:53:37 +02:00
|
|
|
QString convertUrlToText(const QUrl &url) const;
|
2014-03-15 23:22:35 +01:00
|
|
|
void refreshTextFormat();
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2014-03-01 13:02:57 +01:00
|
|
|
LocationCompleter* m_completer;
|
2014-03-15 23:22:35 +01:00
|
|
|
QStringListModel* m_domainCompleterModel;
|
2012-04-22 17:09:43 +02:00
|
|
|
|
2014-02-09 12:22:49 +01:00
|
|
|
BookmarksIcon* m_bookmarkIcon;
|
2011-12-27 18:50:52 +01:00
|
|
|
GoIcon* m_goIcon;
|
|
|
|
RssIcon* m_rssIcon;
|
2011-12-17 14:26:34 +01:00
|
|
|
SiteIcon* m_siteIcon;
|
2013-02-08 18:44:26 +01:00
|
|
|
AutoFillIcon* m_autofillIcon;
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
BrowserWindow* m_window;
|
2012-01-21 20:27:45 +01:00
|
|
|
TabbedWebView* m_webView;
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-01-21 19:26:47 +01:00
|
|
|
QAction* m_pasteAndGoAction;
|
|
|
|
QAction* m_clearAction;
|
|
|
|
|
2014-03-16 13:06:38 +01:00
|
|
|
bool m_rssIconVisible;
|
2012-01-18 16:52:30 +01:00
|
|
|
bool m_holdingAlt;
|
2012-09-02 15:19:12 +02:00
|
|
|
|
2012-08-24 20:53:53 +02:00
|
|
|
int m_loadProgress;
|
2012-09-19 10:08:30 +02:00
|
|
|
bool m_progressVisible;
|
|
|
|
ProgressStyle m_progressStyle;
|
|
|
|
QColor m_progressColor;
|
2011-03-02 16:57:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LOCATIONBAR_H
|