Skip to content

Commit

Permalink
app renames for barcodescanner/barcodeinvoker to custombarcodeinvoker…
Browse files Browse the repository at this point in the history
…/custombarcodescanner

icon changes
nfcdemo update for 10.1
invokeclient/invoketarget updates
  • Loading branch information
CodeHoarder committed Apr 11, 2013
1 parent c91c1ed commit d434523
Show file tree
Hide file tree
Showing 102 changed files with 1,413 additions and 1,282 deletions.
1 change: 0 additions & 1 deletion barcodeinvoker/translations/barcodeinvoker.pro

This file was deleted.

Binary file removed barcodescanner/icon.png
Binary file not shown.
1 change: 0 additions & 1 deletion barcodescanner/translations/barcodescanner.pro

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion barcodeinvoker/.project → custombarcodeinvoker/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>barcodeinvoker</name>
<name>custombarcodeinvoker</name>
<comment></comment>
<projects>
</projects>
Expand Down
2 changes: 1 addition & 1 deletion barcodeinvoker/Makefile → custombarcodeinvoker/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QMAKE_TARGET = barcodeinvoker
QMAKE_TARGET = custombarcodeinvoker
QMAKE = $(QNX_HOST)/usr/bin/qmake
TARGET = $(QMAKE_TARGET)

Expand Down
3 changes: 3 additions & 0 deletions custombarcodeinvoker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CustomBarcodeInvoker

This app is a companion to CustomBarcodeScanner, and demonstrates how to invoke it as a card.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.bb10samples.barcodeinvoker</id>
<id>com.example.bb10samples.custombarcodeinvoker</id>

<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>barcodeinvoker</name>
<name>custombarcodeinvoker</name>

<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
Expand All @@ -46,7 +46,7 @@

<!-- Description, displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The BarcodeInvoker application</description>
<description>The Custom BarcodeInvoker application</description>

<!-- Copyright information. Optional. -->
<!-- <copyright></copyright> -->
Expand All @@ -66,21 +66,21 @@
<category>core.games</category>
<configuration id="com.qnx.qcc.toolChain.1094190268" name="Default">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7-g/barcodeinvoker" entry="true" type="Qnx/Elf">barcodeinvoker</asset>
<asset path="arm/o.le-v7-g/custombarcodeinvoker" entry="true" type="Qnx/Elf">custombarcodeinvoker</asset>
</configuration>
<configuration id="com.qnx.qcc.toolChain.969774234" name="Device-Debug">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7-g/barcodeinvoker" entry="true" type="Qnx/Elf">barcodeinvoker</asset>
<asset path="arm/o.le-v7-g/custombarcodeinvoker" entry="true" type="Qnx/Elf">custombarcodeinvoker</asset>
<entryPointType>Qnx/Elf</entryPointType>
</configuration>
<configuration id="com.qnx.qcc.toolChain.2105851718" name="Device-Release">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7/barcodeinvoker.so.1.0.0" entry="true" type="Qnx/Elf">barcodeinvoker.so</asset>
<asset path="arm/o.le-v7/custombarcodeinvoker.so.1.0.0" entry="true" type="Qnx/Elf">custombarcodeinvoker.so</asset>
<entryPointType>Qnx/Cascades</entryPointType>
</configuration>
<configuration id="com.qnx.qcc.toolChain.72645602" name="Simulator-Debug">
<platformArchitecture>x86</platformArchitecture>
<asset path="x86/o-g/barcodeinvoker" entry="true" type="Qnx/Elf">barcodeinvoker</asset>
<asset path="x86/o-g/custombarcodeinvoker" entry="true" type="Qnx/Elf">custombarcodeinvoker</asset>
</configuration>

<!-- The icon for the application, which should be 86x86. -->
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEMPLATE = app
TARGET = barcodeinvoker
TARGET = custombarcodeinvoker

CONFIG += qt warn_on debug_and_release cascades
LIBS += -lbbsystem
Expand Down
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void BarcodeInvoker::onInvokeButtonClicked() const
InvokeManager* imanager = qobject_cast<InvokeManager*>(sender());

InvokeRequest invokeRequest;
invokeRequest.setTarget("com.example.BarcodeScanner");
invokeRequest.setTarget("com.example.CustomBarcodeScanner");
invokeRequest.setAction("community.action.SCANBARCODE");

const InvokeTargetReply *invokeReply = imanager->invoke(invokeRequest);
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QMAKE_TARGET = barcodeinvoker
QMAKE_TARGET = custombarcodeinvoker
LUPDATE = $(QNX_HOST)/usr/bin/lupdate
LRELEASE = $(QNX_HOST)/usr/bin/lrelease

Expand Down
1 change: 1 addition & 0 deletions custombarcodeinvoker/translations/custombarcodeinvoker.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include (../custombarcodeinvoker.pro)
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion barcodescanner/.project → custombarcodescanner/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>barcodescanner</name>
<name>custombarcodescanner</name>
<comment></comment>
<projects>
</projects>
Expand Down
2 changes: 1 addition & 1 deletion barcodescanner/Makefile → custombarcodescanner/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QMAKE_TARGET = barcodescanner
QMAKE_TARGET = custombarcodescanner
QMAKE = $(QNX_HOST)/usr/bin/qmake
TARGET = $(QMAKE_TARGET)

Expand Down
12 changes: 12 additions & 0 deletions custombarcodescanner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CustomBarcodeScanner

This is a custom barcode scanner that demonstrates how to process the preview frames from the camera. If you just want to scan barcodes, you probably want to take a look at the BarcodeReader sample, which walks you through using the built-in BarcodeDetector component.

This app demonstrates:
1) How to create a custom component (BarcodeDecoder)
2) How to process preview frames from the camera
3) How to use the ZXing library
4) How to act as a Card
5) How to use the Camera.

The BarcodeInvoker app demonstrates how to invoke this app as a card.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.bb10samples.barcodescanner</id>
<id>com.example.bb10samples.custombarcodescanner</id>

<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>barcodescanner</name>
<name>custombarcodescanner</name>

<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
Expand All @@ -47,7 +47,7 @@

<!-- Description, displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The Barcode Scanner sample application</description>
<description>The Custom Barcode Scanner sample application</description>

<!-- Copyright information. Optional. -->
<!-- <copyright></copyright> -->
Expand All @@ -67,21 +67,21 @@
<!-- The category where the application appears. Either core.games or core.media. -->
<configuration id="com.qnx.qcc.toolChain.1876973329" name="Default">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7-g/barcodescanner" entry="true" type="Qnx/Elf">barcodescanner</asset>
<asset path="arm/o.le-v7-g/custombarcodescanner" entry="true" type="Qnx/Elf">custombarcodescanner</asset>
</configuration>
<configuration id="com.qnx.qcc.toolChain.340460845" name="Device-Debug">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7-g/barcodescanner" entry="true" type="Qnx/Elf">barcodescanner</asset>
<asset path="arm/o.le-v7-g/custombarcodescanner" entry="true" type="Qnx/Elf">custombarcodescanner</asset>
<entryPointType>Qnx/Elf</entryPointType>
</configuration>
<configuration id="com.qnx.qcc.toolChain.1248298131" name="Device-Release">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="arm/o.le-v7/barcodescanner.so.1.0.0" entry="true" type="Qnx/Elf">barcodescanner.so</asset>
<asset path="arm/o.le-v7/custombarcodescanner.so.1.0.0" entry="true" type="Qnx/Elf">custombarcodescanner.so</asset>
<entryPointType>Qnx/Cascades</entryPointType>
</configuration>
<configuration id="com.qnx.qcc.toolChain.210271983" name="Simulator-Debug">
<platformArchitecture>x86</platformArchitecture>
<asset path="x86/o-g/barcodescanner" entry="true" type="Qnx/Elf">barcodescanner</asset>
<asset path="x86/o-g/custombarcodescanner" entry="true" type="Qnx/Elf">custombarcodescanner</asset>
</configuration>

<!-- The icon for the application, which should be 86x86. -->
Expand All @@ -106,8 +106,8 @@
<permission>access_internet</permission>
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>

<invoke-target id="com.example.BarcodeScanner">
<invoke-target-name>Barcode Scanner</invoke-target-name>
<invoke-target id="com.example.CustomBarcodeScanner">
<invoke-target-name>Custom Barcode Scanner</invoke-target-name>
<!-- <icon><image>assets/images/icon.png</image></icon> -->
<type>card.previewer</type>
<filter>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEMPLATE = app
TARGET = barcodescanner
TARGET = custombarcodescanner

CONFIG += qt warn_on debug_and_release cascades
LIBS += -lcamapi -lscreen -lbbsystem -lbbcascadesmultimedia -lzxing -lbbmultimedia -lmmrndclient -lasound
Expand Down
File renamed without changes.
Binary file added custombarcodescanner/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
QMAKE_TARGET = barcodescanner
QMAKE_TARGET = custombarcodescanner
LUPDATE = $(QNX_HOST)/usr/bin/lupdate
LRELEASE = $(QNX_HOST)/usr/bin/lrelease

Expand Down
1 change: 1 addition & 0 deletions custombarcodescanner/translations/custombarcodescanner.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include (../custombarcodescanner.pro)
File renamed without changes.
18 changes: 9 additions & 9 deletions docs/barcodeinvoker.qdoc → docs/custombarcodeinvoker.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
****************************************************************************/

/*!
\page barcodeinvoker
\example barcodeinvoker
\title Barcode Invoker Example
\page custombarcodeinvoker
\example custombarcodeinvoker
\title Custom Barcode Invoker Example

\section1 Description

The Barcode Invoker example allows the user to scan barcodes via a Card through the
The Custom Barcode Invoker example allows the user to scan barcodes via a Card through the
\c InvokeManager by issuing scan requests.

\image barcodeinvoker-example.png
\image barcodeinvoker-example1.png
\image custombarcodeinvoker-example.png
\image custombarcodeinvoker-example1.png

\section1 Overview
In this example we'll learn how to use the \c InvokeManager class to issue barcode scanning requests
Expand All @@ -40,20 +40,20 @@
The simplistic UI of this sample application consists of a \c Button to issue requests, and a \c Label
to display the request results.

\snippet barcodeinvoker/assets/main.qml 0
\snippet custombarcodeinvoker/assets/main.qml 0

When the \c Button is clicked, the request is sent and the barcodescanner card is invoked and transitions over
the parent to begin barcode scanning. Once the barcode is read and decoded, the card sends a cardDone() signal to
the requesting parent, transitions off screen and is pooled to await subsequent invokation requests. The Label's
text property is bound to the BarcodeInvoker barcode property, which gets updated when barcodeChanged() signal
is emited.

\snippet barcodeinvoker/src/BarcodeInvoker.cpp 0
\snippet custombarcodeinvoker/src/BarcodeInvoker.cpp 0

Constructor initializes \c InvokeManager and hooks into the signal/slot mechanism to receive childCardDone() signals
from the invoked Card.

\snippet barcodeinvoker/src/BarcodeInvoker.cpp 1
\snippet custombarcodeinvoker/src/BarcodeInvoker.cpp 1

The onInvokeButtonClicked() method creates \c InvokeRequest and invokes the request via \c InvokeManager. Once the card
finishes processing the onChildCardDone() is invoked and sets the barcode textual data from the result, which than emits
Expand Down
28 changes: 14 additions & 14 deletions docs/barcodescanner.qdoc → docs/custombarcodescanner.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
****************************************************************************/

/*!
\page barcodescanner
\example barcodescanner
\title Barcode Scanner Example
\page custombarcodescanner
\example custombarcodescanner
\title Custom Barcode Scanner Example

\section1 Description

The Barcode Scanner example allows the user to scan a QR Code with the camera and
The Custom Barcode Scanner example allows the user to scan a QR Code with the camera and
view the decoded textual representation.

\image barcodescanner-example.png
\image barcodescanner-example1.png
\image custombarcodescanner-example.png
\image custombarcodescanner-example1.png

\section1 Overview
In this example we'll learn how to use the \c Camera and the build in ZXing barcode decoding
Expand All @@ -40,17 +40,17 @@
The UI of this sample application consists of the custom \c Camera control and a \c Label, which shows
a preview of the current camera viewport and uses the \c Label to display decoded barcode data.

\snippet barcodescanner/assets/main.qml 0
\snippet custombarcodescanner/assets/main.qml 0

The BarcodeDecoder custom control shows the video stream that is currently provided by the camera viewport.
It configures and opens the \c Camera upon its creation.

\snippet barcodescanner/assets/main.qml 1
\snippet custombarcodescanner/assets/main.qml 1

This \c Label is used to display the required action and the resulting decoded barcode data after a successful
barcode scan has been performed.

\snippet barcodescanner/src/BarcodeDecoder.cpp 0
\snippet custombarcodescanner/src/BarcodeDecoder.cpp 0

The constructor initializes the member variables. It creates and configures the \c Camera using \c CameraSettings and connects
its methods to the signals/slots mechanism. It initializes the reader for decoding barcodes from an image, and invokes
Expand All @@ -59,30 +59,30 @@
If the open() call was successful, the cameraOpened() signal is emitted, which we react to in the cameraOpened()
signal handler.

\snippet barcodescanner/src/BarcodeDecoder.cpp 1
\snippet custombarcodescanner/src/BarcodeDecoder.cpp 1

This method is invoked when a preview frame buffer is available with data. Using ZXing classes to convert the buffer into
a BinaryBitmap, which in turn is used with the reader to decode the barcode and save the results. After barcode decoding is
successful, it emits the newBarcodeDetected() signal with the textual data as parameter.

\snippet barcodescanner/src/BarcodeDecoder.cpp 2
\snippet custombarcodescanner/src/BarcodeDecoder.cpp 2

This method is invoked when the \c Camera is opened. It adds unsigned char buffers to store the data from the preview frame
and connects to the signal/slots mechanism to recieve previewFrameAvailable() signals. Before the method returns it starts
the view finder, which begins streaming preview frames upon its success and emits previewFrameAvailable() signals.

\snippet barcodescanner/src/BarcodeDecoder.cpp 3
\snippet custombarcodescanner/src/BarcodeDecoder.cpp 3

These are control methods to start/stop view finder streaming and clearing of the barcode data variable.

\snippet barcodescanner/src/BarcodeScannerApp.cpp 0
\snippet custombarcodescanner/src/BarcodeScannerApp.cpp 0

The constructor initializes various member variables. It creates a \c MediaPlayer for playing sounds upon barcode detection and
intializes a \c InvokeManager to deal with invoke requests when the sample is launched as a card by the "barcodeinvoker" sample.
Here it distinguishes how it was launched and sets the appropriate member variables to dictate its behaviour as an application
or as a card.

\snippet barcodescanner/src/BarcodeScannerApp.cpp 1
\snippet custombarcodescanner/src/BarcodeScannerApp.cpp 1

This method is invoked when a newBarcodeDetected() signal is received from the BarcodeDecoder class. It plays a sound upon receiving
the data. If the sample was launched as a Card, a \c CardDoneMessage is generated and sent as response to the parent of this Card.
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified docs/images/invokeclient-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/invokeclient-example1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/invokeclient-example2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/invoketarget-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/invoketarget-example1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/invoketarget-example2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 3 additions & 21 deletions docs/invokeclient.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,11 @@

\snippet invokeclient/assets/main.qml 0

The 'actions' property of the main page contains the two \c{ActionItem}s to invoke an application
or query for possible candidates. Whenever the user triggers one of these actions, the invoke() or query()
The 'actions' property of the main page contains \c{ActionItem}s to invoke an application, platform invoke or
query for possible candidates. Whenever the user triggers one of these actions, the invoke() or query()
method of the \c App object is called. These methods assemble a corresponding request and pass it
to the bb::system::InvokeManager class, which will do the actual work.

Additionally the 'actions' property contains three \c{InvokeActionItem}s, which are specialized \c{ActionItem}s
that trigger an invocation according to their configuration. In this example we add a general action to invoke
the best matching application to open data with the mime type 'image/png', and two actions to invoke the specific
applications 'invoketarget1' and 'invoketarget2'.

\snippet invokeclient/assets/main.qml 1

To configure the parameters of the query request, the main page contains various input fields, e.g. for the
Expand All @@ -74,23 +69,10 @@

\snippet invokeclient/assets/main.qml 3

The main page also contains instances of the \c QueryResultSheet and \c ErrorDialog in its 'attachedObjects' property.
The main page also contains instances of the \c QueryResultSheet in its 'attachedObjects' property.

\snippet invokeclient/assets/main.qml 4

The \c ErrorDialog object is implemented in ErrorDialog.qml and inherits from the \c Dialog class to provide the
functionality of a modal dialog. The error dialog is shown whenever an invocation operation reports some kind of error.
For this, the \c App object provides the property 'errorMessage', which is bound against the 'text' property of
the central \c Label inside the error dialog.

\snippet invokeclient/assets/ErrorDialog.qml 0

To open the dialog whenever an error occurs, the custom JavaScript function handleErrorMessage() is bound against the
errorMessageChanged() signal of the \c App object after the UI has been created.
Inside this function the error dialog is opened if the current error message is not empty.

\snippet invokeclient/assets/ErrorDialog.qml 1

The \c QueryResultSheet object is implemented in QueryResultSheet.qml and inherits from the \c Sheet class to provide
the functionality of a modal sheet. The result sheet is shown whenever a target query has finished successfully, which
is signaled by the \c App object via the emission of the queryFinished() signal. For this reason that signal is connected
Expand Down
Loading

0 comments on commit d434523

Please sign in to comment.