File indexing completed on 2024-04-28 05:49:34

0001 /*
0002     SPDX-FileCopyrightText: 2022 Waqar Ahmed <waqar.17a@gmail.com>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 #pragma once
0006 
0007 #include "kateviewspace.h"
0008 
0009 #include <QPointer>
0010 
0011 class KateUrlBar : public QWidget
0012 {
0013     Q_OBJECT
0014 public:
0015     explicit KateUrlBar(KateViewSpace *parent = nullptr);
0016     void open();
0017 
0018     class KateViewManager *viewManager();
0019     class KateViewSpace *viewSpace();
0020     QIcon seperator();
0021 
0022     void updateForDocument(KTextEditor::Document *doc);
0023 
0024 private:
0025     void setupLayout();
0026 
0027     void onViewChanged(KTextEditor::View *v);
0028     class QStackedWidget *const m_stack;
0029     class UrlbarContainer *const m_urlBarView;
0030     class QLabel *const m_untitledDocLabel;
0031     class KateViewSpace *m_parentViewSpace;
0032 
0033     // document for which the url bar is currently active
0034     // might be nullptr
0035     QPointer<KTextEditor::Document> m_currentDoc;
0036 
0037 Q_SIGNALS:
0038     void openUrlRequested(const QUrl &url, Qt::KeyboardModifiers);
0039 };