~ubuntu-sdk-team/ubuntu-ui-toolkit/quickWindowRootItem

« back to all changes in this revision

Viewing changes to src/Ubuntu/UbuntuToolkit/menubar_p.h

  • Committer: Zoltán Balogh
  • Date: 2016-08-25 10:40:27 UTC
  • mfrom: (1000.106.29 uitk.menu)
  • Revision ID: zoltan@bakter.hu-20160825104027-btda2xrbsbgx581z
API for MenuBar, Menus, MenuItem & MenuSeparator https://code.launchpad.net/~nick-dedekind/ubuntu-ui-toolkit/menus/+merge/297922

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2016 Canonical Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef MENUBAR_P_H
 
19
#define MENUBAR_P_H
 
20
 
 
21
#include "menu_p.h"
 
22
#include <ubuntutoolkitglobal.h>
 
23
 
 
24
#include <QQmlParserStatus>
 
25
 
 
26
class QPlatformMenuBar;
 
27
 
 
28
UT_NAMESPACE_BEGIN
 
29
 
 
30
class MenuBarPrivate;
 
31
class UBUNTUTOOLKIT_EXPORT MenuBar : public QObject, public QQmlParserStatus
 
32
{
 
33
    Q_OBJECT
 
34
    Q_INTERFACES(QQmlParserStatus)
 
35
 
 
36
    Q_PROPERTY(QQmlListProperty<UT_PREPEND_NAMESPACE(Menu)> menus READ menus NOTIFY menusChanged FINAL)
 
37
    Q_CLASSINFO("DefaultProperty", "menus")
 
38
 
 
39
public:
 
40
    explicit MenuBar(QObject *parent = 0);
 
41
    ~MenuBar();
 
42
 
 
43
    Q_INVOKABLE void appendMenu(Menu *menu);
 
44
    Q_INVOKABLE void insertMenu(int index, Menu *menu);
 
45
    Q_INVOKABLE void removeMenu(Menu *menu);
 
46
 
 
47
    QQmlListProperty<Menu> menus();
 
48
 
 
49
    QPlatformMenuBar *platformMenuBar() const;
 
50
 
 
51
    void classBegin() Q_DECL_OVERRIDE;
 
52
    void componentComplete() Q_DECL_OVERRIDE;
 
53
 
 
54
Q_SIGNALS:
 
55
    void menusChanged();
 
56
 
 
57
private:
 
58
    Q_DISABLE_COPY(MenuBar)
 
59
    Q_DECLARE_PRIVATE(MenuBar)
 
60
    QScopedPointer<MenuBarPrivate> d_ptr;
 
61
};
 
62
 
 
63
UT_NAMESPACE_END
 
64
 
 
65
#endif // MENUBAR_P_H