2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include <ubuntutoolkitglobal.h>
24
#include <QQmlParserStatus>
26
class QPlatformMenuBar;
31
class UBUNTUTOOLKIT_EXPORT MenuBar : public QObject, public QQmlParserStatus
34
Q_INTERFACES(QQmlParserStatus)
36
Q_PROPERTY(QQmlListProperty<UT_PREPEND_NAMESPACE(Menu)> menus READ menus NOTIFY menusChanged FINAL)
37
Q_CLASSINFO("DefaultProperty", "menus")
40
explicit MenuBar(QObject *parent = 0);
43
Q_INVOKABLE void appendMenu(Menu *menu);
44
Q_INVOKABLE void insertMenu(int index, Menu *menu);
45
Q_INVOKABLE void removeMenu(Menu *menu);
47
QQmlListProperty<Menu> menus();
49
QPlatformMenuBar *platformMenuBar() const;
51
void classBegin() Q_DECL_OVERRIDE;
52
void componentComplete() Q_DECL_OVERRIDE;
58
Q_DISABLE_COPY(MenuBar)
59
Q_DECLARE_PRIVATE(MenuBar)
60
QScopedPointer<MenuBarPrivate> d_ptr;