diff --git a/BBM Carousel/.cproject b/BBM Carousel/.cproject
new file mode 100644
index 0000000..8e03611
--- /dev/null
+++ b/BBM Carousel/.cproject
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BBM Carousel/.project b/BBM Carousel/.project
new file mode 100644
index 0000000..23c9c87
--- /dev/null
+++ b/BBM Carousel/.project
@@ -0,0 +1,91 @@
+
+
+ carousel
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+
+
+ ?name?
+
+
+
+ org.eclipse.cdt.make.core.append_environment
+ true
+
+
+ org.eclipse.cdt.make.core.autoBuildTarget
+ Device-Debug
+
+
+ org.eclipse.cdt.make.core.buildArguments
+
+
+
+ org.eclipse.cdt.make.core.buildCommand
+ make
+
+
+ org.eclipse.cdt.make.core.cleanBuildTarget
+ clean
+
+
+ org.eclipse.cdt.make.core.contents
+ org.eclipse.cdt.make.core.activeConfigSettings
+
+
+ org.eclipse.cdt.make.core.enableAutoBuild
+ true
+
+
+ org.eclipse.cdt.make.core.enableCleanBuild
+ true
+
+
+ org.eclipse.cdt.make.core.enableFullBuild
+ true
+
+
+ org.eclipse.cdt.make.core.fullBuildTarget
+ Device-Debug
+
+
+ org.eclipse.cdt.make.core.stopOnError
+ true
+
+
+ org.eclipse.cdt.make.core.useDefaultBuildCmd
+ true
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+ com.rim.tad.tools.qml.core.qmlFileBuilder
+
+
+
+
+ com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder
+
+
+
+
+
+ com.rim.tad.tools.wst.jsdt.core.jsNature
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ com.qnx.tools.ide.bbt.core.bbtnature
+ org.eclipse.cdt.core.ccnature
+ com.rim.tad.tools.qml.core.qmlNature
+
+
diff --git a/BBM Carousel/LICENSE b/BBM Carousel/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/BBM Carousel/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/BBM Carousel/Makefile b/BBM Carousel/Makefile
new file mode 100644
index 0000000..e0fbb32
--- /dev/null
+++ b/BBM Carousel/Makefile
@@ -0,0 +1,35 @@
+QMAKE_TARGET = carousel
+QMAKE = $(QNX_HOST)/usr/bin/qmake
+TARGET = $(QMAKE_TARGET)
+
+
+all: Makefile $(QMAKE_TARGET)
+
+clean:
+ $(MAKE) -C ./arm -f Makefile sureclean
+ $(MAKE) -C ./x86 -f Makefile sureclean
+
+
+Makefile: FORCE
+ $(QMAKE) -spec unsupported/blackberry-armv7le-qcc -o arm/Makefile $(QMAKE_TARGET).pro CONFIG+=device
+ $(QMAKE) -spec unsupported/blackberry-x86-qcc -o x86/Makefile $(QMAKE_TARGET).pro CONFIG+=simulator
+ $(MAKE) -C ./translations -f Makefile update release
+
+FORCE:
+
+$(QMAKE_TARGET): device simulator
+
+device:
+ $(MAKE) -C ./arm -f Makefile all
+
+Device-Debug: Makefile
+ $(MAKE) -C ./arm -f Makefile debug
+
+Device-Release: Makefile
+ $(MAKE) -C ./arm -f Makefile release
+
+simulator:
+ $(MAKE) -C ./x86 -f Makefile all
+
+Simulator-Debug: Makefile
+ $(MAKE) -C ./x86 -f Makefile debug
diff --git a/BBM Carousel/assets/.assets.index b/BBM Carousel/assets/.assets.index
new file mode 100644
index 0000000..565b77b
--- /dev/null
+++ b/BBM Carousel/assets/.assets.index
@@ -0,0 +1,14 @@
+1
+12
+Carousel.qml
+CarouselItem.qml
+images/bbmInvite.png
+images/bbmInvokeIcon.png
+images/bbmShareImage.png
+images/bbmShareImageGrp.png
+images/bbmShareText.png
+images/bbmShareTextGrp.png
+images/bg.png
+images/pSmall.png
+main.qml
+SwipeHandler.qml
diff --git a/BBM Carousel/assets/Carousel.qml b/BBM Carousel/assets/Carousel.qml
new file mode 100644
index 0000000..38be995
--- /dev/null
+++ b/BBM Carousel/assets/Carousel.qml
@@ -0,0 +1,184 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+import bb.system 1.0
+
+Container {
+ id: root
+ property int angle: 0
+ property int baseAngle: 0
+ property double offsetValue: 0
+ property variant centeredControl: 0
+ property double releaseSpeed: 0
+ property double momentumSpeed: 0
+ layout: DockLayout {
+ }
+ horizontalAlignment: HorizontalAlignment.Fill
+ verticalAlignment: VerticalAlignment.Fill
+ Container {
+ horizontalAlignment: HorizontalAlignment.Fill
+ verticalAlignment: VerticalAlignment.Fill
+ id: carouselContainer
+ layout: AbsoluteLayout {
+ }
+
+ //each of the carousel items are set up here (properties, background images applied, etc)
+ CarouselItem {
+ id: bbmInvite
+ objectName: "bbmInvite"
+ centered: true
+ angle: root.angle + root.baseAngle
+ imgFileName: "images/bbmInvite.png"
+ // use one item to trigger sort
+ onDepthChanged: {
+ root.sort()
+ }
+ }
+ CarouselItem {
+ id: bbmShareText
+ objectName: "bbmShareText"
+ angle: root.angle + root.baseAngle
+ imgFileName: "images/bbmShareText.png"
+ }
+ CarouselItem {
+ id: bbmShareTextGrp
+ objectName: "bbmShareTextGrp"
+ angle: root.angle + root.baseAngle
+ imgFileName: "images/bbmShareTextGrp.png"
+ }
+ CarouselItem {
+ id: bbmShareImage
+ objectName: "bbmShareImage"
+ angle: root.angle + root.baseAngle
+ imgFileName: "images/bbmShareImage.png"
+ }
+ CarouselItem {
+ id: bbmShareImageGroup
+ objectName: "bbmShareImageGrp"
+ angle: root.angle + root.baseAngle
+ imgFileName: "images/bbmShareImageGrp.png"
+ }
+ // CarouselItem {
+// id: my5
+// angle: root.angle + root.baseAngle
+// imgFileName: "images/bg5.png"
+// }
+
+ }
+ onCreationCompleted: {
+
+ root.offsetValue = 360 / (carouselContainer.controls.length)
+ var currentOffset = 0
+ for (var i = 0; i < carouselContainer.controls.length; i ++) {
+ carouselContainer.controls[i].angleOffset = currentOffset
+ currentOffset += root.offsetValue;
+
+ // myCarouselToast.body = carouselContainer.controls[i].objectName;
+ // myCarouselToast.show();
+
+ navigationPane.imageCenter = carouselContainer.controls[i].objectName;
+
+ }
+ root.centeredControl = carouselContainer.controls[0]
+
+ //set the main variant for the image that is centered
+ //navigationPane.imageCenter = carouselContainer.controls[0].objectName;
+
+ sort();
+ }
+ function sort() {
+ //Bubblesort the carousel items
+ var n = carouselContainer.controls.length
+ var swopped
+ do {
+ swopped = false
+ for (var i = 0; i < n - 1; ++ i) {
+ // a larger depth value means the pic should be on top, i.e. move towards the end of the list of items in the container.
+ if (carouselContainer.controls[i].depth > carouselContainer.controls[i + 1].depth) {
+ carouselContainer.swap(i, i + 1)
+ swopped = true
+ }
+ }
+ } while (swopped)
+
+
+ }
+ onAngleChanged: {
+ sort();
+ root.centeredControl.centered = false;
+ }
+ onBaseAngleChanged: {
+ sort();
+ }
+ function snapToItem() {
+ if (root.baseAngle % root.offsetValue != 0) {
+ snapToItemAnimation.startValue = root.baseAngle
+ snapToItemAnimation.duration = 300
+
+ // snap in the directon the user is scrolling to avoid unsmooth snapping
+ if (root.releaseSpeed < 0) {
+ snapToItemAnimation.endValue = Math.floor(root.baseAngle / root.offsetValue) * root.offsetValue
+ } else if (root.releaseSpeed > 0) {
+ snapToItemAnimation.endValue = Math.ceil(root.baseAngle / root.offsetValue) * root.offsetValue
+ } else {
+ snapToItemAnimation.endValue = Math.round(root.baseAngle / root.offsetValue) * root.offsetValue
+ }
+
+ // Calculate the duration of the snap if we are snapping from a momentum scroll
+ if (root.momentumSpeed != 0) {
+ var dist = Math.abs(snapToItemAnimation.endValue - snapToItemAnimation.startValue)
+ snapToItemAnimation.duration = Math.abs(dist / root.momentumSpeed)
+ }
+ snapToItemAnimation.start()
+
+ // Set the new centered object
+ for (var i = 0; i < carouselContainer.controls.length; i ++) {
+ if (carouselContainer.controls[i].angleOffset == Math.abs(360 - snapToItemAnimation.endValue) % 360) {
+ root.centeredControl.centered = false;
+ root.centeredControl = carouselContainer.controls[i];
+
+ navigationPane.imageCenter = carouselContainer.controls[i].objectName;
+
+ root.centeredControl.centered = true;
+ }
+ }
+ }
+ }
+ attachedObjects: [
+ // QPropertyAnimation should be used with care since it is a client side animation that will
+ // spam the server with messages for every update.
+ QPropertyAnimation {
+ id: snapToItemAnimation
+ startValue: 0
+ endValue: 360
+ duration: 300
+ easingCurve: app.getEase() // TODO:: expose this correctly
+ targetObject: root
+ propertyName: app.getBytes("baseAngle") // TODO:: workaround since we need the QByteArray of the property name
+ onFinished: {
+ root.baseAngle = root.baseAngle % 360
+ }
+ },
+ SystemToast {
+ id: myCarouselToast
+ property bool state
+ body: ""
+ onFinished: {
+
+ }
+ }
+ ]
+}
diff --git a/BBM Carousel/assets/CarouselItem.qml b/BBM Carousel/assets/CarouselItem.qml
new file mode 100644
index 0000000..aaf3148
--- /dev/null
+++ b/BBM Carousel/assets/CarouselItem.qml
@@ -0,0 +1,70 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+
+Container {
+ id: itemRoot
+ property int angle: 0
+ property int angleOffset: 0
+ property bool centered: false
+ property alias image: theImage.imageSource
+ property string imgFileName: ""
+ onImgFileNameChanged: {
+ theImage.image = app.createMirrorImage(imgFileName)
+ }
+ preferredWidth: 426
+ preferredHeight: 280 + 280 * 0.25 + 2
+ translationX: 427 + 410 * Math.cos((itemRoot.angle + itemRoot.angleOffset + 90) * (Math.PI / 180))
+ translationY: 130 + 220 * Math.sin((itemRoot.angle + itemRoot.angleOffset + 90) * (Math.PI / 180))
+ attachedObjects: [
+ ImplicitAnimationController {
+ propertyName: "translationX"
+ enabled: false
+ },
+ ImplicitAnimationController {
+ propertyName: "translationY"
+ enabled: false
+ },
+ ImplicitAnimationController {
+ propertyName: "scaleX"
+ enabled: false
+ },
+ ImplicitAnimationController {
+ propertyName: "scaleY"
+ enabled: false
+ }
+ ]
+ property double scaleFactor: 1 - 0.55 * Math.sin((itemRoot.angle + itemRoot.angleOffset + 180 + 90) * (Math.PI / 180))
+ // value pening between 0.0 (background) and 2.0 (foreground)
+ property double depth: 1 + Math.cos((itemRoot.angle + itemRoot.angleOffset) * (Math.PI / 180))
+ scaleX: scaleFactor
+ scaleY: scaleFactor
+ layout: DockLayout {
+ }
+ ImageView {
+ id: theImage
+ horizontalAlignment: HorizontalAlignment.Fill
+ verticalAlignment: VerticalAlignment.Fill
+ scalingMethod: ScalingMethod.AspectFill
+ opacity: (itemRoot.depth * 0.375) + 0.25
+ attachedObjects: [
+ ImplicitAnimationController {
+ propertyName: "opacity"
+ enabled: false
+ }
+ ]
+ }
+}
diff --git a/BBM Carousel/assets/SwipeHandler.qml b/BBM Carousel/assets/SwipeHandler.qml
new file mode 100644
index 0000000..5d4e036
--- /dev/null
+++ b/BBM Carousel/assets/SwipeHandler.qml
@@ -0,0 +1,161 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+import utils 1.0
+import bb.system 1.0
+import Dialog.Alert 1.0
+
+Container {
+ id: swipeHandler
+ objectName: "swipeHandler"
+ property double dragOffset: 0
+ property double momentumOffset: 0
+ property double speed
+ property double endSpeed
+ property double touchDownX
+ property double touchDownY
+ property variant startTime
+ property double timeConstant
+ property bool decelerationStarted
+ signal scrollingStart()
+ signal momentumScrollingEnd()
+ signal dragScrollingEnd()
+ onTouch: {
+ if (event.isDown()) {
+ scrollingStart();
+ touchDownX = event.windowX;
+ touchDownY = event.windowY;
+ startTime = Date.now()
+ dragOffset = 0
+ if (decelerationStarted == true) {
+ timer.stop();
+ decelerationStarted = false
+ }
+
+ } else if (event.isMove()) {
+ dragOffset = touchDownX - event.windowX
+ } else if (event.isUp()) {
+ dragOffset = touchDownX - event.windowX
+ var diffTime = Date.now() - startTime
+ speed = dragOffset / diffTime;
+ if (Math.abs(dragOffset) > 125 && Math.abs(speed) > 1) {
+ decelerationStarted = true
+ timeConstant = 3000 / 6;
+ timer.t = 0;
+ timer.start()
+ scrollingStart()
+ momentumOffset = 0
+ } else if (Math.abs(dragOffset) < 44) {
+
+ if(navigationPane.imageCenter == "bbmInvite"){
+
+ app.invokeBBMInvite();
+
+ } else if (navigationPane.imageCenter == "bbmShareText") {
+
+ app.invokeBBMShareText();
+
+ } else if (navigationPane.imageCenter == "bbmShareTextGrp"){
+
+ app.invokeBBMShareTextGrp();
+
+ } else if (navigationPane.imageCenter == "bbmShareImage"){
+
+ app.invokeBBMShareImage();
+
+ } else if (navigationPane.imageCenter == "bbmShareImageGrp") {
+
+ app.invokeBBMShareImageGrp();
+
+ } else {
+
+ alertDialog.show();
+
+ }
+ dragScrollingEnd();
+
+ } else {
+ dragScrollingEnd();
+ }
+ }
+ }
+
+
+
+ attachedObjects: [
+ QTimer {
+ id: timer
+ property double t: 0
+ property double prevOffset: 0
+ interval: 16
+ onTimeout: {
+ var delta = speed * Math.exp(- t / timeConstant);
+ prevOffset = momentumOffset
+ if (t < 1000) {
+ momentumOffset = momentumOffset + 2 * delta;
+ } else {
+ momentumOffset = momentumOffset - delta;
+ }
+ t = t + 16;
+ if (Math.abs(momentumOffset - prevOffset) < 3) {
+ endSpeed = delta / 16
+ speed = 0;
+ timer.stop();
+ decelerationStarted = false
+ momentumScrollingEnd()
+ }
+ }
+ },
+ ComponentDefinition {
+ id: goToNDA
+ source: "NDAPage.qml"
+ },
+ ComponentDefinition {
+ id: goToBreak
+ source: "BreakPage.qml"
+ },
+ ComponentDefinition {
+ id: goToInstall
+ source: "InstallPage.qml"
+ },
+
+ SystemToast {
+ id: myFutureToast
+ property bool state
+ body: "Are there additional Quick Links you would like added? \r\r Just let us know!"
+ onFinished: {
+
+ }
+ },
+ AlertDialog {
+ id: alertDialog
+ cancelButton: true
+ okButton: true
+ alertMessage: "If you're seeing this error, RUN! \r\r "
+ titleText: "WARNING!!!!"
+ onOk: {
+ // navigationPane.pop();
+ }
+ onCancel: {
+ //
+ }
+ onCustomButton: {
+ //
+ }
+ }
+
+ ]
+}
diff --git a/BBM Carousel/assets/images/bbmInvite.png b/BBM Carousel/assets/images/bbmInvite.png
new file mode 100644
index 0000000..7a7143e
Binary files /dev/null and b/BBM Carousel/assets/images/bbmInvite.png differ
diff --git a/BBM Carousel/assets/images/bbmShareImage.png b/BBM Carousel/assets/images/bbmShareImage.png
new file mode 100644
index 0000000..4ab87a9
Binary files /dev/null and b/BBM Carousel/assets/images/bbmShareImage.png differ
diff --git a/BBM Carousel/assets/images/bbmShareImageGrp.png b/BBM Carousel/assets/images/bbmShareImageGrp.png
new file mode 100644
index 0000000..85da11e
Binary files /dev/null and b/BBM Carousel/assets/images/bbmShareImageGrp.png differ
diff --git a/BBM Carousel/assets/images/bbmShareText.png b/BBM Carousel/assets/images/bbmShareText.png
new file mode 100644
index 0000000..7ca5e09
Binary files /dev/null and b/BBM Carousel/assets/images/bbmShareText.png differ
diff --git a/BBM Carousel/assets/images/bbmShareTextGrp.png b/BBM Carousel/assets/images/bbmShareTextGrp.png
new file mode 100644
index 0000000..b1f3524
Binary files /dev/null and b/BBM Carousel/assets/images/bbmShareTextGrp.png differ
diff --git a/BBM Carousel/assets/images/bg.png b/BBM Carousel/assets/images/bg.png
new file mode 100644
index 0000000..ed26dfb
Binary files /dev/null and b/BBM Carousel/assets/images/bg.png differ
diff --git a/BBM Carousel/assets/images/pSmall.png b/BBM Carousel/assets/images/pSmall.png
new file mode 100644
index 0000000..4aef42d
Binary files /dev/null and b/BBM Carousel/assets/images/pSmall.png differ
diff --git a/BBM Carousel/assets/main.qml b/BBM Carousel/assets/main.qml
new file mode 100644
index 0000000..dafee20
--- /dev/null
+++ b/BBM Carousel/assets/main.qml
@@ -0,0 +1,68 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import bb.cascades 1.0
+
+NavigationPane {
+ id: navigationPane
+ property variant imageCenter
+ Page {
+ Container {
+ background: back.imagePaint
+ attachedObjects: [
+ ImagePaintDefinition {
+ id: back
+ repeatPattern: RepeatPattern.Fill
+ imageSource: "asset:///images/bg.png"
+ }
+ ]
+ layout: DockLayout {
+ }
+ Carousel {
+ id: carousel
+ }
+ SwipeHandler {
+ verticalAlignment: VerticalAlignment.Fill
+ horizontalAlignment: HorizontalAlignment.Fill
+ property int dragScrollSpeed: 1200 // Lower value gives higher scroll speed
+ property int momentumScrollSpeed: 300 // Lower value gives higher scroll speed
+ onDragOffsetChanged: {
+ carousel.angle = (dragOffset / dragScrollSpeed) * 180
+ }
+ onMomentumOffsetChanged: {
+ carousel.angle = (momentumOffset / momentumScrollSpeed) * 180
+ }
+ onScrollingStart: {
+ carousel.baseAngle += carousel.angle;
+ carousel.angle = 0;
+ }
+ onDragScrollingEnd: {
+ carousel.releaseSpeed = speed;
+ carousel.momentumSpeed = 0;
+ carousel.baseAngle += carousel.angle;
+ carousel.angle = 0;
+ carousel.snapToItem();
+ }
+ onMomentumScrollingEnd: {
+ carousel.baseAngle += carousel.angle;
+ carousel.angle = 0;
+ carousel.releaseSpeed = endSpeed
+ carousel.momentumSpeed = endSpeed
+ carousel.snapToItem();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/BBM Carousel/bar-descriptor.xml b/BBM Carousel/bar-descriptor.xml
new file mode 100644
index 0000000..3dd1761
--- /dev/null
+++ b/BBM Carousel/bar-descriptor.xml
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+ com.bb.esam.carouselbbm
+
+
+
+
+ 1.0.1
+
+
+ 5
+
+
+
+
+
+
+
+
+
+
+ mauwhite
+ gYAAgOq-U6VE7igmNLH7UibXuTc
+
+
+
+
+
+ landscape
+ false
+ none
+ false
+
+
+ dark
+ Using the weblinks sample provided by ODB for flare. This app calls Q_INVOKABLE methods in c++ These methods invoke certain BBM features using invocation framework only! (BBM registration in work perimeter is blocked in OS 10.1)
+ Carousel BBM
+
+ bbmInvokeIcon.png
+
+
+
+
+ armle-v7
+ carousel
+
+
+ armle-v7
+ carousel
+
+
+ armle-v7
+ carousel
+
+
+ x86
+ carousel
+
+
+
+
+ icon.png
+ assets
+
+
+
+
+
+ bbmInvokeIcon.png
+
+
+ run_native
+ bbm_connect
+
+
+
diff --git a/BBM Carousel/carousel.pro b/BBM Carousel/carousel.pro
new file mode 100644
index 0000000..b105ad7
--- /dev/null
+++ b/BBM Carousel/carousel.pro
@@ -0,0 +1,52 @@
+TEMPLATE = app
+TARGET = carousel
+
+CONFIG += qt warn_on debug_and_release cascades mobility
+LIBS += -lbbsystem -lbbdata -lbbpim
+MOBILITY += sensors
+
+INCLUDEPATH += ../src
+SOURCES += ../src/*.cpp
+HEADERS += ../src/*.hpp ../src/*.h
+
+lupdate_inclusion {
+ SOURCES += ../assets/*.qml
+}
+
+device {
+ CONFIG(release, debug|release) {
+ DESTDIR = o.le-v7
+ }
+ CONFIG(debug, debug|release) {
+ DESTDIR = o.le-v7-g
+ }
+}
+
+simulator {
+ CONFIG(release, debug|release) {
+ DESTDIR = o
+ }
+ CONFIG(debug, debug|release) {
+ DESTDIR = o-g
+ }
+}
+
+OBJECTS_DIR = $${DESTDIR}/.obj
+MOC_DIR = $${DESTDIR}/.moc
+RCC_DIR = $${DESTDIR}/.rcc
+UI_DIR = $${DESTDIR}/.ui
+
+suredelete.target = sureclean
+suredelete.commands = $(DEL_FILE) $${MOC_DIR}/*; $(DEL_FILE) $${RCC_DIR}/*; $(DEL_FILE) $${UI_DIR}/*
+suredelete.depends = distclean
+
+QMAKE_EXTRA_TARGETS += suredelete
+
+TRANSLATIONS = \
+ $${TARGET}_en_GB.ts \
+ $${TARGET}_fr.ts \
+ $${TARGET}_it.ts \
+ $${TARGET}_de.ts \
+ $${TARGET}_es.ts \
+ $${TARGET}.ts
+
diff --git a/BBM Carousel/config.pri b/BBM Carousel/config.pri
new file mode 100644
index 0000000..4d0d1e7
--- /dev/null
+++ b/BBM Carousel/config.pri
@@ -0,0 +1,102 @@
+# Auto-generated by IDE. Any changes made by user will be lost!
+BASEDIR = $$quote($$_PRO_FILE_PWD_)
+
+device {
+ CONFIG(debug, debug|release) {
+ INCLUDEPATH += $$quote(${QNX_TARGET}/usr/include/cpp) \
+ $$quote(${QNX_TARGET}/usr/include/qt4) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/embedded) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/c) \
+ $$quote(${QNX_TARGET}/../target-override/usr/include) \
+ $$quote(${QNX_TARGET}/usr/include/qt4/QtCore)
+
+ DEPENDPATH += $$quote(${QNX_TARGET}/usr/include/cpp) \
+ $$quote(${QNX_TARGET}/usr/include/qt4) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/embedded) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/c) \
+ $$quote(${QNX_TARGET}/../target-override/usr/include) \
+ $$quote(${QNX_TARGET}/usr/include/qt4/QtCore)
+
+ SOURCES += $$quote($$BASEDIR/src/AlertDialog.cpp) \
+ $$quote($$BASEDIR/src/Carousel.cpp) \
+ $$quote($$BASEDIR/src/Dialog.cpp) \
+ $$quote($$BASEDIR/src/main.cpp)
+
+ HEADERS += $$quote($$BASEDIR/src/AlertDialog.hpp) \
+ $$quote($$BASEDIR/src/Carousel.hpp) \
+ $$quote($$BASEDIR/src/Dialog.hpp)
+ }
+
+ CONFIG(release, debug|release) {
+ INCLUDEPATH += $$quote(${QNX_TARGET}/usr/include/cpp) \
+ $$quote(${QNX_TARGET}/usr/include/qt4) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/embedded) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/c) \
+ $$quote(${QNX_TARGET}/../target-override/usr/include) \
+ $$quote(${QNX_TARGET}/usr/include/qt4/QtCore)
+
+ DEPENDPATH += $$quote(${QNX_TARGET}/usr/include/cpp) \
+ $$quote(${QNX_TARGET}/usr/include/qt4) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/embedded) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/c) \
+ $$quote(${QNX_TARGET}/../target-override/usr/include) \
+ $$quote(${QNX_TARGET}/usr/include/qt4/QtCore)
+
+ SOURCES += $$quote($$BASEDIR/src/AlertDialog.cpp) \
+ $$quote($$BASEDIR/src/Carousel.cpp) \
+ $$quote($$BASEDIR/src/Dialog.cpp) \
+ $$quote($$BASEDIR/src/main.cpp)
+
+ HEADERS += $$quote($$BASEDIR/src/AlertDialog.hpp) \
+ $$quote($$BASEDIR/src/Carousel.hpp) \
+ $$quote($$BASEDIR/src/Dialog.hpp)
+ }
+}
+
+simulator {
+ CONFIG(debug, debug|release) {
+ INCLUDEPATH += $$quote(${QNX_TARGET}/usr/include/cpp) \
+ $$quote(${QNX_TARGET}/usr/include/qt4) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/embedded) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/c) \
+ $$quote(${QNX_TARGET}/../target-override/usr/include) \
+ $$quote(${QNX_TARGET}/usr/include/qt4/QtCore)
+
+ DEPENDPATH += $$quote(${QNX_TARGET}/usr/include/cpp) \
+ $$quote(${QNX_TARGET}/usr/include/qt4) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/embedded) \
+ $$quote(${QNX_TARGET}/usr/include/cpp/c) \
+ $$quote(${QNX_TARGET}/../target-override/usr/include) \
+ $$quote(${QNX_TARGET}/usr/include/qt4/QtCore)
+
+ SOURCES += $$quote($$BASEDIR/src/AlertDialog.cpp) \
+ $$quote($$BASEDIR/src/Carousel.cpp) \
+ $$quote($$BASEDIR/src/Dialog.cpp) \
+ $$quote($$BASEDIR/src/main.cpp)
+
+ HEADERS += $$quote($$BASEDIR/src/AlertDialog.hpp) \
+ $$quote($$BASEDIR/src/Carousel.hpp) \
+ $$quote($$BASEDIR/src/Dialog.hpp)
+ }
+}
+
+INCLUDEPATH += $$quote($$BASEDIR/src)
+
+lupdate_inclusion {
+ SOURCES += $$quote($$BASEDIR/../src/*.c) \
+ $$quote($$BASEDIR/../src/*.c++) \
+ $$quote($$BASEDIR/../src/*.cc) \
+ $$quote($$BASEDIR/../src/*.cpp) \
+ $$quote($$BASEDIR/../src/*.cxx) \
+ $$quote($$BASEDIR/../assets/*.qml) \
+ $$quote($$BASEDIR/../assets/*.js) \
+ $$quote($$BASEDIR/../assets/*.qs)
+
+ HEADERS += $$quote($$BASEDIR/../src/*.h) \
+ $$quote($$BASEDIR/../src/*.h++) \
+ $$quote($$BASEDIR/../src/*.hh) \
+ $$quote($$BASEDIR/../src/*.hpp) \
+ $$quote($$BASEDIR/../src/*.hxx)
+}
+
+TRANSLATIONS = $$quote($${TARGET}.ts)
diff --git a/BBM Carousel/device-assets.xml b/BBM Carousel/device-assets.xml
new file mode 100644
index 0000000..f90448b
--- /dev/null
+++ b/BBM Carousel/device-assets.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/BBM Carousel/icon.png b/BBM Carousel/icon.png
new file mode 100644
index 0000000..23bbd1e
Binary files /dev/null and b/BBM Carousel/icon.png differ
diff --git a/BBM Carousel/readme.md b/BBM Carousel/readme.md
new file mode 100644
index 0000000..502c26e
--- /dev/null
+++ b/BBM Carousel/readme.md
@@ -0,0 +1,59 @@
+# BBM Carousel
+
+The BBM Carousel example allows the developer to invoke BlackBerry Messenger(BBM)
+using the [Invocation Framework] (https://developer.blackberry.com/cascades/documentation/device_platform/invocation/invocation_framework.html). For devices running 10.1 that are also [BlackBerry Balance] (http://us.blackberry.com/business/software/blackberry-balance.html?lpos=us:bb:search:Business&lid=us:bb:search:Business:BlackBerry-Balance-Technology#tab-1) enabled, the work perimeter only allows for a limited set of BBM features to be invokable. This sample implements those features:
+
+- Invite a user to chat
+- Share text to an individual contact
+- Share text to a group
+- Share an image to an individual contact
+- Share an image to a group
+
+The implementation for the invocation of the aforementioned features are in the Carousel.cpp file.
+
+The sample was built using the "bbjamcarousel" example located [here] (https://github.com/blackberry/Cascades-Community-Samples/tree/master/stumpers/bbjamcarousel)
+
+The sample code for this application is Open Source under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html)
+
+**Special Thanks**
+
+- [Johan Larsby] (https://github.com/jlarsby) the author of that "bbjamcarousel" sample
+- [Rich Balsewich] (https://twitter.com/OnlineODB) for modifying the "bbjamcarousel" sample and providing the implementation framework to tie in the BBM invocation code to
+
+**Applies To**
+
+* [BlackBerry 10 Cascades SDK](http://developer.blackberry.com/cascades/)
+* This sample has been tested using the 10.1.0.1020 SDK
+
+
+**Requirements:**
+
+1. BlackBerry 10 Native SDK
+2. BlackBerry 10 smartphone to test
+3. If you intend to test in Corporate Perimeter, you will need a BlackBerry Device Service Server or access to one. (optional)
+
+
+##Running the example:
+
+1. Clone the Sample repository.
+2. Launch BlackBerry 10 Native SDK, and from the File menu, select Import.
+3. Expand General, and select Existing Projects into Workspace. Click Next.
+4. Browse to the location of your sample directory, and then click OK.
+5. The sample project should display in the Projects section.
+ Click Finish to import the project into your workspace.
+6. In the Project Explorer pane, Right-click the project (for example BBM Carousel)
+ and select Build Project.
+7. In the Project Explorer pane, Right-click the project (for example BBM Carousel)
+ and select Run As > BlackBerry C/C++ Application.
+8. The application will now install and launch on your device. If not, check that your environment is set up correctly [here] (http://developer.blackberry.com/cascades/documentation/getting_started/setting_up.html)
+
+##Running the example in corporate perimeter
+**Steps apply to BlackBerry Balance Enabled devices**
+
+1. Build, sign, and export the project (Create the .bar file)
+2. Add it to the BlackBerry Device Server.
+3. Add it to a software configuration.
+2. Apply the software configuration to the user account you are testing with. [BlackBerry Device Service Documentation](http://docs.blackberry.com/en/admin/subcategories/?userType=2&category=BlackBerry+Device+Service)
+
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/BBM Carousel/src/AlertDialog.cpp b/BBM Carousel/src/AlertDialog.cpp
new file mode 100644
index 0000000..f74e703
--- /dev/null
+++ b/BBM Carousel/src/AlertDialog.cpp
@@ -0,0 +1,122 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "AlertDialog.hpp"
+#include
+#include
+
+AlertDialog::AlertDialog(QObject* parent)
+ : Dialog(parent)
+ , m_alertMessage("")
+{
+}
+
+AlertDialog::~AlertDialog()
+{
+}
+
+QString AlertDialog::getAlertMessage() const
+{
+ return m_alertMessage;
+}
+
+void AlertDialog::setAlertMessage(QString const& value)
+{
+ m_alertMessage = value;
+}
+
+void AlertDialog::run()
+{
+ bps_initialize();
+
+ //request all dialog events
+ dialog_request_events(0);
+ if (dialog_create_alert(&m_dialog) != BPS_SUCCESS)
+ {
+ qDebug() << "Failed to create alert dialog.";
+ emit cancel();
+ return;
+ }
+
+ //set the alert message
+ if (!m_alertMessage.trimmed().isEmpty() && dialog_set_alert_message_text(m_dialog, m_alertMessage.toAscii()) != BPS_SUCCESS)
+ {
+ qDebug() << "Failed to set alert dialog message text.";
+ destroyDialog();
+ emit cancel();
+ return;
+ }
+
+ if (!setTitle())
+ {
+ destroyDialog();
+ emit cancel();
+ return;
+ }
+
+ if (!addButtons())
+ {
+ destroyDialog();
+ emit cancel();
+ return;
+ }
+
+ if (!showDialog())
+ {
+ qDebug() << "Failed to show alert dialog.";
+ destroyDialog();
+ emit cancel();
+ return;
+ }
+
+ bool shutdown = false;
+ while (!shutdown)
+ {
+ bps_event_t* event = NULL;
+
+ // -1 means that the function waits for an event before returning
+ bps_get_event(&event, -1);
+
+ if (event)
+ {
+ if (bps_event_get_domain(event) == dialog_get_domain())
+ {
+ int selectedIndex = dialog_event_get_selected_index(event);
+ const char* label = dialog_event_get_selected_label(event);
+ const char* context = dialog_event_get_selected_context(event);
+
+ if (label != NULL && context != NULL)
+ {
+ if (QString::compare(context, getCancelButtonContext()) == 0)
+ {
+ emit cancel();
+ }
+ else if (QString::compare(context, getOkButtonContext()) == 0)
+ {
+ emit ok();
+ }
+ else
+ {
+ emit customButton(selectedIndex, label, context);
+ }
+ }
+
+ qDebug() << "Got alert dialog click";
+ shutdown = true;
+ }
+ }
+ }
+ destroyDialog();
+}
diff --git a/BBM Carousel/src/AlertDialog.hpp b/BBM Carousel/src/AlertDialog.hpp
new file mode 100644
index 0000000..44fa48b
--- /dev/null
+++ b/BBM Carousel/src/AlertDialog.hpp
@@ -0,0 +1,57 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ALERTDIALOG_HPP_
+#define ALERTDIALOG_HPP_
+
+#include "Dialog.hpp"
+
+/*
+ * An alert dialog is a simple dialog that displays title, message
+ * and buttons.
+ */
+class AlertDialog : public Dialog
+{
+ Q_OBJECT
+
+ /*
+ * QML exposed property for the alert message
+ */
+ Q_PROPERTY(QString alertMessage READ getAlertMessage WRITE setAlertMessage)
+public:
+ /*
+ * Ctor & Dtor
+ */
+ AlertDialog(QObject* parent = 0);
+ virtual ~AlertDialog();
+
+public:
+ /*
+ * Getter and Setter for alert message
+ */
+ QString getAlertMessage() const;
+ void setAlertMessage(QString const& value);
+
+protected:
+ /*
+ * Implements the run loop. The dialog stays open until a button is clicked.
+ */
+ virtual void run();
+
+protected:
+ QString m_alertMessage;
+};
+
+#endif /* ALERTDIALOG_HPP_ */
diff --git a/BBM Carousel/src/Carousel.cpp b/BBM Carousel/src/Carousel.cpp
new file mode 100644
index 0000000..ea590ac
--- /dev/null
+++ b/BBM Carousel/src/Carousel.cpp
@@ -0,0 +1,349 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+#include
+#include "Carousel.hpp"
+#include "Dialog.hpp"
+
+using namespace bb::cascades;
+using namespace bb::system;
+
+Carousel::Carousel(bb::cascades::Application *app) :
+ QObject(app)
+{
+ qmlRegisterType("utils", 1, 0, "QTimer");
+ qmlRegisterType("bb.cascades", 1, 0,
+ "QPropertyAnimation");
+ // create scene document from main.qml asset
+ // set parent to created document to ensure it exists for the whole application lifetime
+ QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
+
+ qml->setContextProperty("app", this);
+
+ // create root object for the UI
+ AbstractPane *root = qml->createRootObject();
+ // set created root object as a scene
+ app->setScene(root);
+}
+
+// Getting the byte array of the string
+QByteArray Carousel::getBytes(QString str)
+{
+ return str.toAscii();
+}
+
+// We only want the OutCubic easing-curve, try others, dare you!
+QEasingCurve Carousel::getEase()
+{
+ return QEasingCurve::OutCubic;
+}
+
+// This function is needed by the mirroring algo.
+static bb::cascades::Image fromQImage(const QImage &origQImage,
+ const QImage &mirroredQImage)
+{
+
+ bb::ImageData imageData(bb::PixelFormat::RGBA_Premultiplied,
+ origQImage.width(), (origQImage.height() * 1.25) + 2);
+ int y = 0;
+
+ unsigned char *dstLine = imageData.pixels();
+
+ for (y = 0; y < origQImage.height(); y++)
+ {
+ unsigned char * dst = dstLine;
+ for (int x = 0; x < imageData.width(); x++)
+ {
+ QRgb srcPixel = origQImage.pixel(x, y);
+
+ *dst++ = qRed(srcPixel) * qAlpha(srcPixel) / 255;
+ *dst++ = qGreen(srcPixel) * qAlpha(srcPixel) / 255;
+ *dst++ = qBlue(srcPixel) * qAlpha(srcPixel) / 255;
+ *dst++ = qAlpha(srcPixel);
+ }
+ dstLine += imageData.bytesPerLine();
+ }
+
+ for (; y < origQImage.height() + 2; y++)
+ {
+ unsigned char * dst = dstLine;
+ for (int x = 0; x < imageData.width(); x++)
+ {
+ *dst++ = 0;
+ *dst++ = 0;
+ *dst++ = 0;
+ *dst++ = 0;
+ }
+ dstLine += imageData.bytesPerLine();
+ }
+
+ for (; y < imageData.height(); y++)
+ {
+ unsigned char * dst = dstLine;
+ for (int x = 0; x < imageData.width(); x++)
+ {
+ QRgb srcPixel = mirroredQImage.pixel(x, (y - 2 - origQImage.height()));
+ *dst++ = qRed(srcPixel);
+ *dst++ = qGreen(srcPixel);
+ *dst++ = qBlue(srcPixel);
+ *dst++ = qAlpha(srcPixel);
+
+ }
+ dstLine += imageData.bytesPerLine();
+ }
+
+ return Image(imageData);
+
+}
+
+// Let's not have all the images mirrored, let's do that in code, and some alpha on them as well
+QVariant Carousel::createMirrorImage(QString inputFName)
+{
+
+ if (inputFName.isEmpty())
+ return QVariant::fromValue(0);
+
+ char buff[1024];
+ QString prefix = QString(getcwd(buff, 1024));
+ inputFName = prefix + "/app/native/assets/" + inputFName;
+
+ QImage inputQImage(inputFName);
+ QImage mirrored_part = inputQImage.mirrored(false, true);
+ QPoint start(0, 0);
+ QPoint end(0, mirrored_part.height());
+ QLinearGradient gradient(start, end);
+
+ gradient.setColorAt(0.0, Qt::gray);
+ gradient.setColorAt(0.22, Qt::black);
+ gradient.setColorAt(1.0, Qt::black);
+ QImage mask = mirrored_part;
+ QPainter painter(&mask);
+ painter.fillRect(mirrored_part.rect(), gradient);
+ painter.end();
+
+ mirrored_part.setAlphaChannel(mask);
+ bb::cascades::Image mirrored_image = fromQImage(inputQImage, mirrored_part);
+ return QVariant::fromValue(mirrored_image);
+
+}
+
+//Invite a user, via the BBM pin to chat over BBM
+void Carousel::invokeBBMInvite()
+{
+ InvokeManager invokeManager;
+ InvokeRequest request;
+
+ // Who do we want to send the invoke request to?
+ request.setTarget("sys.bbm.sharehandler");
+
+ // What do we want the target application to do with it?
+ request.setAction("bb.action.BBMCHAT");
+
+ // Where is the data?
+ request.setUri(QUrl("pin:2AB00000"));
+
+ InvokeTargetReply *reply = invokeManager.invoke(request);
+}
+
+//Share text to individual contact over BBM, contact picker will be displayed and BBM contact can be selected
+void Carousel::invokeBBMShareText()
+{
+ InvokeManager invokeManager;
+ InvokeRequest request;
+
+ QString text = "Sharing this text over BBM :-)";
+ QByteArray data = text.toAscii();
+
+ // Who do we want to send the invoke request to?
+ request.setTarget("sys.bbm.sharehandler");
+
+ // What do we want the target application to do with it?
+ request.setAction("bb.action.SHARE");
+
+ // What are we sending?
+ request.setMimeType("text/plain");
+
+ // Where is the data?
+ request.setData(data);
+
+ InvokeTargetReply *reply = invokeManager.invoke(request);
+}
+
+//Share text to group over BBM, group picker will be displayed and BBM group can be selected
+void Carousel::invokeBBMShareTextGrp()
+{
+ InvokeManager invokeManager;
+ InvokeRequest request;
+
+ QString text = "Group share of this text :-)";
+ QByteArray data = text.toAscii();
+
+
+ // Who do we want to send the invoke request to?
+ request.setTarget("sys.bbgroups.sharehandler");
+
+ // What do we want the target application to do with it?
+ request.setAction("bb.action.SHARE");
+
+ // What are we sending?
+ request.setMimeType("text/plain");
+
+ // Where is the data?
+ request.setData(data);
+
+ InvokeTargetReply *reply = invokeManager.invoke(request);
+}
+
+//Share an image to an individual contact over BBM, contact picker will be displayed and BBM contact can be selected
+void Carousel::invokeBBMShareImage()
+{
+ InvokeManager invokeManager;
+ InvokeRequest request;
+
+ // Who do we want to send the invoke request to?
+ request.setTarget("sys.bbm.sharehandler");
+
+ // What do we want the target application to do with it?
+ request.setAction("bb.action.SHARE");
+
+ //where is the data
+ request.setUri ("file:" + QDir::currentPath() + "/app/native/assets/images/pSmall.png");
+
+ InvokeTargetReply *invokeReply = invokeManager.invoke(request);
+
+ if(invokeReply) {
+ invokeReply->setParent(this);
+ connect(invokeReply, SIGNAL(finished()), this, SLOT(onInvokeResult()));
+ _invokeTargetReply = invokeReply;
+ }
+}
+
+//Share an image to a group over BBM, contact picker will be displayed and BBM group can be selected
+void Carousel::invokeBBMShareImageGrp()
+{
+ InvokeManager invokeManager;
+ InvokeRequest request;
+
+ // Who do we want to send the invoke request to?
+ request.setTarget("sys.bbgroups.sharehandler");
+
+ // What do we want the target application to do with it?
+ request.setAction("bb.action.SHARE");
+
+ //where is the data
+ request.setUri ("file:" + QDir::currentPath() + "/app/native/assets/images/pSmall.png");
+
+ InvokeTargetReply *invokeReply = invokeManager.invoke(request);
+
+ if(invokeReply) {
+ invokeReply->setParent(this);
+ connect(invokeReply, SIGNAL(finished()), this, SLOT(onInvokeResult()));
+ _invokeTargetReply = invokeReply;
+ }
+}
+
+//SLOT to handle the result of the invocation request
+void Carousel::onInvokeResult()
+{
+
+ // Check for errors
+ switch(_invokeTargetReply->error()) {
+ // Invocation could not find the target
+ // did we use the right target ID?
+ case InvokeReplyError::NoTarget: {
+ //out << "invokeFinished(): Error: no target" << endl;
+ //alertDialog.show()
+ showDialog(QString("invokeFinished(): Error: no target"));
+ break;
+ }
+ // There was a problem with the invoke request
+ // did we set all the values correctly?
+ case InvokeReplyError::BadRequest: {
+ //cout << "invokeFinished(): Error: bad request" << endl;
+ showDialog(QString("invokeFinished(): Error: bad sssrequest"));
+
+ break;
+ }
+ // Something went completely
+ // wrong inside the invocation request
+ // Find an alternate route :(
+ case InvokeReplyError::Internal: {
+ //cout << "invokeFinished(): Error: internal" << endl;
+ showDialog(QString("invokeFinished(): Error: internal"));
+ break;
+ }
+ //Message received if the invoke request is successful
+ default:
+ //cout << "invokeFinished(): Invoke Succeeded" << endl;
+ break;
+ }
+
+ // A little house keeping never hurts...
+ delete _invokeTargetReply;
+}
+
+// A public function to display a SystemDialog in your UI
+void Carousel::showDialog(QString errMsg)
+{
+ SystemDialog *dialog = new SystemDialog("OK");
+
+ dialog->setTitle("Problem!");
+
+ dialog->setBody(errMsg);
+
+ dialog->setEmoticonsEnabled(true);
+
+ // Connect the finished() signal to the onDialogFinished() slot.
+ // The slot will check the SystemUiResult to see which button was tapped.
+
+ bool success = connect(dialog,
+ SIGNAL(finished(bb::system::SystemUiResult::Type)),
+ this,
+ SLOT(onDialogFinished(bb::system::SystemUiResult::Type)));
+
+ if (success) {
+ // Signal was successfully connected.
+ // Now show the dialog box in your UI.
+
+ dialog->show();
+ } else {
+ // Failed to connect to signal.
+ dialog->deleteLater();
+ }
+}
+
+void Carousel::onDialogFinished(bb::system::SystemUiResult::Type type)
+{
+
+}
diff --git a/BBM Carousel/src/Carousel.hpp b/BBM Carousel/src/Carousel.hpp
new file mode 100644
index 0000000..eb5c0e8
--- /dev/null
+++ b/BBM Carousel/src/Carousel.hpp
@@ -0,0 +1,56 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef Carousel_HPP_
+#define Carousel_HPP_
+
+#include
+#include
+#include
+#include
+#include
+
+namespace bb { namespace cascades { class Application; }}
+/*!
+ * @brief Application pane object
+ *
+ *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
+ */
+class Carousel : public QObject
+{
+ Q_OBJECT
+public:
+ Carousel(bb::cascades::Application *app);
+ virtual ~Carousel() {};
+
+ bb::system::InvokeTargetReply *_invokeTargetReply;
+
+ void showDialog(QString errMsg);
+ Q_INVOKABLE void invokeBBMInvite();
+ Q_INVOKABLE void invokeBBMShareText();
+ Q_INVOKABLE void invokeBBMShareTextGrp();
+ Q_INVOKABLE void invokeBBMShareImage();
+ Q_INVOKABLE void invokeBBMShareImageGrp();
+ Q_INVOKABLE QByteArray getBytes(QString str);
+ Q_INVOKABLE QEasingCurve getEase();
+ Q_INVOKABLE QVariant createMirrorImage(QString inputFName);
+
+public slots:
+ void onDialogFinished(bb::system::SystemUiResult::Type type);
+ void onInvokeResult();
+};
+
+
+#endif /* Carousel_HPP_ */
diff --git a/BBM Carousel/src/Dialog.cpp b/BBM Carousel/src/Dialog.cpp
new file mode 100644
index 0000000..f8682e9
--- /dev/null
+++ b/BBM Carousel/src/Dialog.cpp
@@ -0,0 +1,147 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Dialog.hpp"
+#include
+#include
+
+namespace
+{
+const char* cancelButtonContext = "Dialog_Cancelled";
+const char* okButtonContext = "Dialog_OK";
+}
+
+Dialog::Dialog(QObject* parent)
+ : QThread(parent)
+ , m_cancelButton(false)
+ , m_okButton(false)
+ , m_cancelRequired(false)
+ , m_titleText("")
+{
+}
+
+Dialog::~Dialog()
+{
+}
+
+void Dialog::show()
+{
+ if (!isRunning())
+ {
+ start();
+ }
+}
+
+void Dialog::addCustomButton(QString const& text, QString const& context)
+{
+ if (text.trimmed().isEmpty())
+ {
+ return;
+ }
+
+ m_customButtons[text] = context;
+}
+
+bool Dialog::getShowCancelButtonProperty() const
+{
+ return m_cancelButton;
+}
+
+void Dialog::setShowCancelButtonProperty(bool value)
+{
+ m_cancelButton = value;
+}
+
+bool Dialog::getShowOkButtonProperty() const
+{
+ return m_okButton;
+}
+
+void Dialog::setShowOkButtonProperty(bool value)
+{
+ m_okButton = value;
+}
+
+QString Dialog::getTitleTextProperty() const
+{
+ return m_titleText;
+}
+
+void Dialog::setTitleTextProperty(QString const& value)
+{
+ m_titleText = value;
+}
+
+QString Dialog::getOkButtonContext() const
+{
+ return okButtonContext;
+}
+
+QString Dialog::getCancelButtonContext() const
+{
+ return cancelButtonContext;
+}
+
+bool Dialog::showDialog()
+{
+ return (dialog_show(m_dialog) == BPS_SUCCESS);
+}
+
+void Dialog::destroyDialog()
+{
+ if (m_dialog)
+ {
+ dialog_destroy(m_dialog);
+ m_dialog = 0;
+ }
+}
+
+bool Dialog::setTitle()
+{
+ if (!m_titleText.trimmed().isEmpty() && dialog_set_title_text(m_dialog, m_titleText.toAscii()) != BPS_SUCCESS)
+ {
+ qDebug() << "Failed to set alert dialog title text.";
+ return false;
+ }
+ return true;
+}
+
+bool Dialog::addButtons()
+{
+ //show localized ok button
+ if (m_okButton && dialog_add_button(m_dialog, DIALOG_OK_LABEL, true, okButtonContext, true) != BPS_SUCCESS)
+ {
+ qDebug() << "Failed to add OK button to alert dialog.";
+ return false;
+ }
+
+ //show the localized cancel button
+ if (m_cancelButton && dialog_add_button(m_dialog, DIALOG_CANCEL_LABEL, true, cancelButtonContext, true) != BPS_SUCCESS)
+ {
+ qDebug() << "Failed to add CANCEL button to alert dialog.";
+ return false;
+ }
+
+ //add custom buttons
+ for (QMap::iterator it = m_customButtons.begin(); it != m_customButtons.end(); ++it)
+ {
+ if (dialog_add_button(m_dialog, it.key().toAscii(), true, it.value().toAscii(), true) != BPS_SUCCESS)
+ {
+ qDebug() << "Failed to add " << it.key() << " button to alert dialog.";
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/BBM Carousel/src/Dialog.hpp b/BBM Carousel/src/Dialog.hpp
new file mode 100644
index 0000000..a122222
--- /dev/null
+++ b/BBM Carousel/src/Dialog.hpp
@@ -0,0 +1,148 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DIALOG_HPP_
+#define DIALOG_HPP_
+
+#include
+#include
+#include
+
+/*
+ * This is a base class for certain types of dialogs like the
+ * Alert, Prompt, Login and FileSave Dialogs which require
+ * addition of custom buttons.
+ *
+ * Derived classes implement a run loop specific to the type of
+ * dialog being displayed.
+ */
+class Dialog : public QThread
+{
+ Q_OBJECT
+
+ /*
+ * Property exposed to QML to show or hide the localized cancel button
+ */
+ Q_PROPERTY(bool cancelButton READ getShowCancelButtonProperty WRITE setShowCancelButtonProperty)
+
+ /*
+ * Property exposed to QML to show or hide the localized OK button
+ */
+ Q_PROPERTY(bool okButton READ getShowOkButtonProperty WRITE setShowOkButtonProperty)
+
+ /*
+ * Property exposed to QML to set the title of the dialog. Note: not all dialogs
+ * will show a title, for example the filesave dialog
+ */
+ Q_PROPERTY(QString titleText READ getTitleTextProperty WRITE setTitleTextProperty)
+public:
+ /*
+ * Ctor & Dtor
+ */
+ Dialog(QObject* parent = 0);
+ virtual ~Dialog();
+
+ /*
+ * Exposed to QML to start the run loop which creates and displays the dialog.
+ * The dialog is shown until a button is clicked.
+ */
+ virtual Q_INVOKABLE void show();
+
+ /*
+ * Exposed to QML to allow custom buttons to be added to the dialog
+ * @param text - the text displayed on the button
+ * @param context - a string data associated with the custom button
+ */
+ virtual Q_INVOKABLE void addCustomButton(QString const& text, QString const& context);
+
+public:
+ /*
+ * Getter and Setter for the show OK button property exposed to QML
+ */
+ bool getShowOkButtonProperty() const;
+ void setShowOkButtonProperty(bool value);
+
+ /*
+ * Getter and Setter for the show Cancel button property exposed to QML
+ */
+ bool getShowCancelButtonProperty() const;
+ void setShowCancelButtonProperty(bool value);
+
+ /*
+ * Getter and Setter for the Title text property exposed to QML
+ */
+ QString getTitleTextProperty() const;
+ void setTitleTextProperty(QString const& value);
+
+protected:
+ /*
+ * Adds the OK, Cancel and Custom buttons into the dialog
+ */
+ bool addButtons();
+
+ /*
+ * Sets the title of the dialog
+ */
+ bool setTitle();
+
+ /*
+ * Displays the dialog on the screen
+ */
+ bool showDialog();
+
+ /*
+ * Destroys the dialog
+ */
+ void destroyDialog();
+
+ /*
+ * Returns the context string for the localized OK button
+ */
+ QString getOkButtonContext() const;
+
+ /*
+ * Returns the context string for the localized Cancel button
+ */
+ QString getCancelButtonContext() const;
+
+signals:
+ /*
+ * Signal emitted when the localized OK button is clicked
+ */
+ void ok();
+
+ /*
+ * Signal emitted when the localized CANCEL button is clicked
+ */
+ void cancel();
+
+ /*
+ * Signal emitted when a custom button is clicked
+ * @param index - the index of the custom button
+ * @param label - the label of the custom button
+ * @param context - the context data of the custom button
+ */
+ void customButton(int index, QString label, QString context);
+
+protected:
+ dialog_instance_t m_dialog;
+ bool m_cancelButton;
+ bool m_okButton;
+ bool m_cancelRequired;
+ QString m_titleText;
+ QMap m_customButtons;
+};
+
+#endif /* DIALOG_HPP_ */
diff --git a/BBM Carousel/src/main.cpp b/BBM Carousel/src/main.cpp
new file mode 100644
index 0000000..fcafbad
--- /dev/null
+++ b/BBM Carousel/src/main.cpp
@@ -0,0 +1,66 @@
+/* Copyright (c) 2012 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include "Carousel.hpp"
+#include "AlertDialog.hpp"
+
+using namespace bb::cascades;
+void myMessageOutput(QtMsgType type, const char *msg)
+ {
+ //in this function, you can write the message to any stream!
+ switch (type) {
+ case QtDebugMsg:
+ fprintf(stderr, "Debug: %s\n", msg);
+ break;
+ case QtWarningMsg:
+ fprintf(stderr, "Warning: %s\n", msg);
+ break;
+ case QtCriticalMsg:
+ fprintf(stderr, "Critical: %s\n", msg);
+ break;
+ case QtFatalMsg:
+ fprintf(stderr, "Fatal: %s\n", msg);
+ abort();
+ }
+ }
+
+int main(int argc, char **argv)
+{
+
+ qmlRegisterType("Dialog.Alert", 1, 0, "AlertDialog");
+
+ qInstallMsgHandler(myMessageOutput);
+ // this is where the server is started etc
+ Application app(argc, argv);
+
+ // localization support
+ QTranslator translator;
+ QString locale_string = QLocale().name();
+ QString filename = QString( "carousel_%1" ).arg( locale_string );
+ if (translator.load(filename, "app/native/qm")) {
+ app.installTranslator( &translator );
+ }
+
+ new Carousel(&app);
+
+ return Application::exec();
+ }
diff --git a/BBM Carousel/translations/Makefile b/BBM Carousel/translations/Makefile
new file mode 100644
index 0000000..1e6530b
--- /dev/null
+++ b/BBM Carousel/translations/Makefile
@@ -0,0 +1,12 @@
+QMAKE_TARGET = carousel
+LUPDATE = $(QNX_HOST)/usr/bin/lupdate
+LRELEASE = $(QNX_HOST)/usr/bin/lrelease
+
+update: $(QMAKE_TARGET).pro FORCE
+ $(LUPDATE) $(QMAKE_TARGET).pro
+
+release: $(QMAKE_TARGET).pro $(QMAKE_TARGET).ts
+ $(LRELEASE) $(QMAKE_TARGET).pro
+
+FORCE:
+
diff --git a/BBM Carousel/translations/carousel.pro b/BBM Carousel/translations/carousel.pro
new file mode 100644
index 0000000..1ad46a1
--- /dev/null
+++ b/BBM Carousel/translations/carousel.pro
@@ -0,0 +1 @@
+include (../carousel.pro)
diff --git a/BBM Carousel/translations/carousel.qm b/BBM Carousel/translations/carousel.qm
new file mode 100644
index 0000000..be651ee
--- /dev/null
+++ b/BBM Carousel/translations/carousel.qm
@@ -0,0 +1 @@
+<¸dÊÍ!¿`¡½Ý
\ No newline at end of file
diff --git a/BBM Carousel/translations/carousel.ts b/BBM Carousel/translations/carousel.ts
new file mode 100644
index 0000000..07a7469
--- /dev/null
+++ b/BBM Carousel/translations/carousel.ts
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/BBM Carousel/translations/carousel_de.qm b/BBM Carousel/translations/carousel_de.qm
new file mode 100644
index 0000000..9dad8df
Binary files /dev/null and b/BBM Carousel/translations/carousel_de.qm differ
diff --git a/BBM Carousel/translations/carousel_de.ts b/BBM Carousel/translations/carousel_de.ts
new file mode 100644
index 0000000..baec665
--- /dev/null
+++ b/BBM Carousel/translations/carousel_de.ts
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/BBM Carousel/translations/carousel_en_GB.qm b/BBM Carousel/translations/carousel_en_GB.qm
new file mode 100644
index 0000000..9dad8df
Binary files /dev/null and b/BBM Carousel/translations/carousel_en_GB.qm differ
diff --git a/BBM Carousel/translations/carousel_en_GB.ts b/BBM Carousel/translations/carousel_en_GB.ts
new file mode 100644
index 0000000..60202ef
--- /dev/null
+++ b/BBM Carousel/translations/carousel_en_GB.ts
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/BBM Carousel/translations/carousel_es.qm b/BBM Carousel/translations/carousel_es.qm
new file mode 100644
index 0000000..9dad8df
Binary files /dev/null and b/BBM Carousel/translations/carousel_es.qm differ
diff --git a/BBM Carousel/translations/carousel_es.ts b/BBM Carousel/translations/carousel_es.ts
new file mode 100644
index 0000000..eadc347
--- /dev/null
+++ b/BBM Carousel/translations/carousel_es.ts
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/BBM Carousel/translations/carousel_fr.qm b/BBM Carousel/translations/carousel_fr.qm
new file mode 100644
index 0000000..c02994c
Binary files /dev/null and b/BBM Carousel/translations/carousel_fr.qm differ
diff --git a/BBM Carousel/translations/carousel_fr.ts b/BBM Carousel/translations/carousel_fr.ts
new file mode 100644
index 0000000..0d01428
--- /dev/null
+++ b/BBM Carousel/translations/carousel_fr.ts
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/BBM Carousel/translations/carousel_it.qm b/BBM Carousel/translations/carousel_it.qm
new file mode 100644
index 0000000..9dad8df
Binary files /dev/null and b/BBM Carousel/translations/carousel_it.qm differ
diff --git a/BBM Carousel/translations/carousel_it.ts b/BBM Carousel/translations/carousel_it.ts
new file mode 100644
index 0000000..a2257e5
--- /dev/null
+++ b/BBM Carousel/translations/carousel_it.ts
@@ -0,0 +1,4 @@
+
+
+
+