1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef TOOLBARMANAGER_H
6#define TOOLBARMANAGER_H
7
8#include <QObject>
9#include <QToolBar>
10
11class ToolBarManagerPrivate;
12class ToolBarManager : public QObject
13{
14 Q_OBJECT
15public:
16 explicit ToolBarManager(const QString &name, QObject *parent = nullptr);
17 virtual ~ToolBarManager() override;
18
19 bool addActionItem(const QString &id, QAction *action, const QString &group);
20 bool addWidgetItem(const QString &id, QWidget *widget, const QString &group);
21 bool hasOverrideActionItem(const QString &id, QAction *action, const QString &group);
22 void removeItem(const QString &id);
23 void disableItem(const QString &id, bool visible);
24 QToolBar *getToolBar() const;
25
26private:
27 ToolBarManagerPrivate *const d;
28};
29
30#endif // TOOLBARMANAGER_H
31