blob: 2f383afecd46776d8adc4c0cf5b81986566649aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "core_global.h"
#include <utils/filepath.h>
#include <utils/id.h>
#include <QObject>
#include <QList>
#include <QKeySequence>
QT_BEGIN_NAMESPACE
class QSettings;
class QToolButton;
class QWidget;
QT_END_NAMESPACE
namespace Utils {
class QtcSettings;
}
namespace Core {
struct NavigationView
{
QWidget *widget;
QList<QToolButton *> dockToolBarWidgets;
};
class CORE_EXPORT INavigationWidgetFactory : public QObject
{
Q_OBJECT
public:
INavigationWidgetFactory();
~INavigationWidgetFactory() override;
static const QList<INavigationWidgetFactory *> allNavigationFactories();
void setDisplayName(const QString &displayName);
void setPriority(int priority);
void setId(Utils::Id id);
void setActivationSequence(const QKeySequence &keys);
QString displayName() const { return m_displayName ; }
int priority() const { return m_priority; }
Utils::Id id() const { return m_id; }
QKeySequence activationSequence() const;
// This design is not optimal, think about it again once we need to extend it
// It could be implemented as returning an object which has both the widget
// and the docktoolbar widgets
// Similar to how IView
virtual NavigationView createWidget() = 0;
virtual void saveSettings(Utils::QtcSettings *settings, int position, QWidget *widget);
virtual void restoreSettings(QSettings *settings, int position, QWidget *widget);
virtual void addRootPath(Utils::Id id, const QString &displayName, const QIcon &icon, const Utils::FilePath &path);
virtual void removeRootPath(Utils::Id id);
private:
QString m_displayName;
int m_priority = 0;
Utils::Id m_id;
QKeySequence m_activationSequence;
};
} // namespace Core
|