1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 11:02:19 +01:00
falkonOfficial/src/lib/navigation/locationbar.h

115 lines
3.0 KiB
C
Raw Normal View History

2011-03-03 18:29:20 +01:00
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2016 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
#include "qzcommon.h"
2011-03-02 16:57:41 +01:00
#include "lineedit.h"
class QStringListModel;
class BrowserWindow;
2011-03-02 16:57:41 +01:00
class LocationCompleter;
class ClickableLabel;
class TabbedWebView;
class BookmarksIcon;
class SiteIcon;
class GoIcon;
class AutoFillIcon;
class LoadRequest;
class QUPZILLA_EXPORT LocationBar : public LineEdit
2011-03-02 16:57:41 +01:00
{
Q_OBJECT
2011-03-02 16:57:41 +01:00
public:
explicit LocationBar(BrowserWindow* window);
2011-03-02 16:57:41 +01:00
TabbedWebView* webView() const;
void setWebView(TabbedWebView* view);
static QString convertUrlToText(const QUrl &url);
2011-03-02 16:57:41 +01:00
public slots:
void setText(const QString &text);
void showUrl(const QUrl &url);
private slots:
void textEdited(const QString &text);
void requestLoadUrl();
void pasteAndGo();
void updateSiteIcon();
void updatePlaceHolderText();
void setPrivacyState(bool state);
void setGoIconVisible(bool state);
void showCompletion(const QString &completion);
void showDomainCompletion(const QString &completion);
void clearCompletion();
void loadStarted();
void loadProgress(int progress);
void loadFinished();
void hideProgress();
void loadSettings();
2011-03-02 16:57:41 +01:00
private:
enum ProgressStyle {
ProgressFilled,
ProgressBottom,
ProgressTop
};
2012-01-21 19:26:47 +01:00
void contextMenuEvent(QContextMenuEvent* event);
void showEvent(QShowEvent* event);
void focusInEvent(QFocusEvent* event);
void focusOutEvent(QFocusEvent* event);
2011-03-17 17:03:04 +01:00
void keyPressEvent(QKeyEvent* event);
void dropEvent(QDropEvent* event);
void paintEvent(QPaintEvent* event);
2011-03-02 16:57:41 +01:00
LoadRequest createLoadRequest() const;
void refreshTextFormat();
2011-03-02 16:57:41 +01:00
LocationCompleter* m_completer;
QStringListModel* m_domainCompleterModel;
BookmarksIcon* m_bookmarkIcon;
GoIcon* m_goIcon;
SiteIcon* m_siteIcon;
AutoFillIcon* m_autofillIcon;
2011-03-02 16:57:41 +01:00
BrowserWindow* m_window;
TabbedWebView* m_webView;
2011-03-02 16:57:41 +01:00
bool m_holdingAlt;
int m_oldTextLength;
int m_currentTextLength;
int m_loadProgress;
bool m_progressVisible;
ProgressStyle m_progressStyle;
QColor m_progressColor;
QTimer *m_progressTimer;
2011-03-02 16:57:41 +01:00
};
#endif // LOCATIONBAR_H