aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidextras/doc
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@digia.com>2013-09-19 12:33:56 +0200
committerChristian Stromme <christian.stromme@digia.com>2013-09-20 03:03:07 +0200
commite5d6abb31861f8e13b2348575e38daf0ca1511c3 (patch)
treea98454cb5c1a021031646587b9afcd5aaaa74823 /src/androidextras/doc
parent0ea86574a4ca430a16867d09776f76124f38d201 (diff)
Add Qt JNI API.
The QJNI API's provide an easy way to communicate with Java API's from C++. The API consists of two classes, QJNIObject which acts as a wrapper around Java classes and QJNIEnvironment which attaches the current thread to the Java VM and exposes the Java Native Interface. Change-Id: I9cdc395249de74f940b75eab9f2bd32347d5d432 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/androidextras/doc')
-rw-r--r--src/androidextras/doc/qtandroidextras.qdocconf39
-rw-r--r--src/androidextras/doc/snippets/code/src_androidextras_qjnienvironment.cpp39
-rw-r--r--src/androidextras/doc/snippets/code/src_androidextras_qjniobject.cpp70
-rw-r--r--src/androidextras/doc/src/qtandroidextras-index.qdoc40
-rw-r--r--src/androidextras/doc/src/qtandroidextras-module.qdoc37
5 files changed, 225 insertions, 0 deletions
diff --git a/src/androidextras/doc/qtandroidextras.qdocconf b/src/androidextras/doc/qtandroidextras.qdocconf
new file mode 100644
index 0000000..9e123bb
--- /dev/null
+++ b/src/androidextras/doc/qtandroidextras.qdocconf
@@ -0,0 +1,39 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = QtAndroidExtras
+description = Qt Android Extras Reference Documentation
+url = http://qt-project.org/doc/qt-$QT_VER/qtandroidextras
+version = $QT_VERSION
+
+examplesinstallpath = qtandroidextras
+
+qhp.projects = QtAndroidExtras
+
+qhp.QtAndroidExtras.file = qtandroidextras.qhp
+qhp.QtAndroidExtras.namespace = org.qt-project.qtandroidextras.$QT_VERSION_TAG
+qhp.QtAndroidExtras.virtualFolder = qtandroidextras
+qhp.QtAndroidExtras.indexTitle = Qt Android Extras
+qhp.QtAndroidExtras.indexRoot =
+
+qhp.QtAndroidExtras.filterAttributes = qtandroidextras $QT_VERSION qtrefdoc
+qhp.QtAndroidExtras.customFilters.Qt.name = QtAndroidExtras $QT_VERSION
+qhp.QtAndroidExtras.customFilters.Qt.filterAttributes = qtandroidextras $QT_VERSION
+
+qhp.QtAndroidExtras.subprojects = classes
+qhp.QtAndroidExtras.subprojects.classes.title = C++ Classes
+qhp.QtAndroidExtras.subprojects.classes.indexTitle = Qt Android Extras C++ Classes
+qhp.QtAndroidExtras.subprojects.classes.selectors = class fake:headerfile
+qhp.QtAndroidExtras.subprojects.classes.sortPages = true
+
+tagfile = ../../../doc/qtandroidextras/qtandroidextras.tags
+depends += qtcore
+headerdirs += ..
+sourcedirs += ..
+exampledirs += ../../../examples/qtandroidextras \
+ ../ \
+ snippets
+
+excludedirs += ../../../examples/widgets/doc
+imagedirs += images
+navigation.landingpage = "Qt Android Extras"
+navigation.cppclassespage = "Qt Android Extras C++ Classes"
diff --git a/src/androidextras/doc/snippets/code/src_androidextras_qjnienvironment.cpp b/src/androidextras/doc/snippets/code/src_androidextras_qjnienvironment.cpp
new file mode 100644
index 0000000..e799420
--- /dev/null
+++ b/src/androidextras/doc/snippets/code/src_androidextras_qjnienvironment.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the documentation of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:BSD$
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ ** * Redistributions of source code must retain the above copyright
+ ** notice, this list of conditions and the following disclaimer.
+ ** * Redistributions in binary form must reproduce the above copyright
+ ** notice, this list of conditions and the following disclaimer in
+ ** the documentation and/or other materials provided with the
+ ** distribution.
+ ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+ ** of its contributors may be used to endorse or promote products derived
+ ** from this software without specific prior written permission.
+ **
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
diff --git a/src/androidextras/doc/snippets/code/src_androidextras_qjniobject.cpp b/src/androidextras/doc/snippets/code/src_androidextras_qjniobject.cpp
new file mode 100644
index 0000000..1ef86fe
--- /dev/null
+++ b/src/androidextras/doc/snippets/code/src_androidextras_qjniobject.cpp
@@ -0,0 +1,70 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the documentation of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:BSD$
+ ** You may use this file under the terms of the BSD license as follows:
+ **
+ ** "Redistribution and use in source and binary forms, with or without
+ ** modification, are permitted provided that the following conditions are
+ ** met:
+ ** * Redistributions of source code must retain the above copyright
+ ** notice, this list of conditions and the following disclaimer.
+ ** * Redistributions in binary form must reproduce the above copyright
+ ** notice, this list of conditions and the following disclaimer in
+ ** the documentation and/or other materials provided with the
+ ** distribution.
+ ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+ ** of its contributors may be used to endorse or promote products derived
+ ** from this software without specific prior written permission.
+ **
+ **
+ ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+//! [Working with lists]
+QStringList getTrackTitles(const QJNIObject &album) {
+ QStringList stringList;
+ QJNIObject list = album.callObjectMethod<jobject>("getTitles",
+ "()Ljava/util/List;");
+
+ if (list.isValid()) {
+ const int size = list.callMethod<jint>("size");
+ for (int i = 0; i < size; ++i) {
+ QJNIObject title = list.callObjectMethod<jobject>("get", "(I)Ljava/lang/Object;", i);
+ stringList.append(title.toString());
+ }
+ }
+ return stringList;
+}
+//! [Working with lists]
+
+//! [QJNIObject scope]
+void function()
+{
+ QString helloString("Hello");
+ jstring myJString = 0;
+ {
+ QJNIObject string = QJNIObject::fromString(string);
+ myJString = string.object<jstring>();
+ }
+
+ // Ops! myJString is no longer valid.
+}
+//! [QJNIObject scope]
diff --git a/src/androidextras/doc/src/qtandroidextras-index.qdoc b/src/androidextras/doc/src/qtandroidextras-index.qdoc
new file mode 100644
index 0000000..823e71e
--- /dev/null
+++ b/src/androidextras/doc/src/qtandroidextras-index.qdoc
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page qtandroidextras-index.html
+ \title Qt Android Extras
+
+ \brief The Qt Android Extras module contains adittional functionality to aid development on Android.
+
+ \section1 Getting Started
+
+ \list
+
+ \endlist
+
+*/
diff --git a/src/androidextras/doc/src/qtandroidextras-module.qdoc b/src/androidextras/doc/src/qtandroidextras-module.qdoc
new file mode 100644
index 0000000..f62484e
--- /dev/null
+++ b/src/androidextras/doc/src/qtandroidextras-module.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \module QtAndroidExtras
+ \title Qt Android Extras C++ Classes
+ \brief The Qt Android Extras module contains functionality to additional functionality to aid development on Android.
+
+ \ingroup modules
+ \qtvariable androidextras
+
+ The Qt Android Extras module adds...
+*/