summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/src/qandroidplatformmenu.h
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2013-03-04 10:16:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-05 08:31:23 +0100
commit97fcf3bc987a18f32233fea550eb4a5a22e2b822 (patch)
tree31d75557fdc4a525af8f5053db514066c63bd1bd /src/plugins/platforms/android/src/qandroidplatformmenu.h
parent1b582d64eb6d13e60a02ebc40956302a4864eb6c (diff)
Introducing the Qt Android port
Based on the Necessitas project by Bogdan Vatra. Contributors to the Qt5 project: BogDan Vatra <bogdan@kde.org> Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> hjk <hjk121@nokiamail.com> Oswald Buddenhagen <oswald.buddenhagen@digia.com> Paul Olav Tvete <paul.tvete@digia.com> Robin Burchell <robin+qt@viroteck.net> Samuel Rødal <samuel.rodal@digia.com> Yoann Lopes <yoann.lopes@digia.com> The full history of the Qt5 port can be found in refs/old-heads/android, SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/src/qandroidplatformmenu.h')
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformmenu.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/src/qandroidplatformmenu.h b/src/plugins/platforms/android/src/qandroidplatformmenu.h
new file mode 100644
index 0000000000..20236cb636
--- /dev/null
+++ b/src/plugins/platforms/android/src/qandroidplatformmenu.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QANDROIDPLATFORMMENU_H
+#define QANDROIDPLATFORMMENU_H
+
+#include <qpa/qplatformmenu.h>
+#include <qvector.h>
+#include <qmutex.h>
+
+class QAndroidPlatformMenuItem;
+class QAndroidPlatformMenu: public QPlatformMenu
+{
+public:
+ typedef QVector<QAndroidPlatformMenuItem *> PlatformMenuItemsType;
+
+public:
+ QAndroidPlatformMenu();
+ ~QAndroidPlatformMenu();
+
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before);
+ void removeMenuItem(QPlatformMenuItem *menuItem);
+ void syncMenuItem(QPlatformMenuItem *menuItem);
+ void syncSeparatorsCollapsible(bool enable);
+
+ void setTag(quintptr tag);
+ quintptr tag() const;
+ void setText(const QString &text);
+ QString text() const;
+ void setIcon(const QIcon &icon);
+ QIcon icon() const;
+ void setEnabled(bool enabled);
+ bool isEnabled() const;
+ void setVisible(bool visible);
+ bool isVisible() const;
+
+ QPlatformMenuItem *menuItemAt(int position) const;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const;
+
+ PlatformMenuItemsType menuItems() const;
+ QMutex *menuItemsMutex();
+
+private:
+ PlatformMenuItemsType m_menuItems;
+ quintptr m_tag;
+ QString m_text;
+ QIcon m_icon;
+ bool m_enabled;
+ bool m_isVisible;
+ QMutex m_menuItemsMutex;
+};
+
+#endif // QANDROIDPLATFORMMENU_H