import bb.cascades 1.0
TabbedPane {
showTabsOnActionBar: false
Tab {
title: qsTr("All Targets")
Page {
titleBar: TitleBar {
title: qsTr("Social Invocation")
}
actions: [
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
query {
mimeType: "text/plain"
invokeActionId: "bb.action.SHARE"
}
onTriggered: {
data = _socialInvocation.encodeQString(generalShare.statusText);
console.log(data);
}
}
]
GeneralBlock {
id: generalShare
}
}
}
Tab {
title: qsTr("Facebook")
imageSource: "asset:///images/ic_facebook.png"
Page {
id: facebookTab
actions: [
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Update Status")
query {
mimeType: "text/plain"
invokeTargetId: "Facebook"
invokeActionId: "bb.action.SHARE"
}
onTriggered: {
data = _socialInvocation.encodeQString(fbShare.statusText);
console.log(data);
}
},
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Post URL")
query {
invokeTargetId: "Facebook"
invokeActionId: "bb.action.SHARE"
uri: "http://www.blackberry.com"
}
},
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Post Image")
query {
mimeType: "image/jpeg"
invokeTargetId: "Facebook"
invokeActionId: "bb.action.SHARE"
uri: _dirPaths.asset + "images/MissScarlett.png"
}
}
]
titleBar: TitleBar {
title: qsTr("Social Invocation - Facebook")
}
GeneralBlock {
id: fbShare
statusLabel: qsTr("Set your Facebook Status")
Divider {
}
Label {
text: qsTr("View a Facebook Profile")
textStyle.fontWeight: FontWeight.Bold
}
RadioGroup {
id: fbGroup
Option {
id: optionUser
text: qsTr("User Profile")
selected: true
value: "user"
}
Option {
id: optionBusiness
text: qsTr("Business page")
value: "page"
}
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
TextField {
id: txtFBProfile
hintText: qsTr("Enter numeric Facebook id")
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.75
}
}
Button {
text: qsTr("GO!")
onClicked: {
_socialInvocation.invoke("com.rim.bb.app.facebook", "bb.action.OPEN", fbGroup.selectedValue, txtFBProfile.text)
}
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.25
}
}
}
Divider {
}
Label {
text: qsTr("Share an image on Facebook")
textStyle.fontWeight: FontWeight.Bold
}
ImageSelectionBlock {
invokeTarget: "Facebook"
}
}
}
}
Tab {
title: qsTr("Twitter")
imageSource: "asset:///images/ic_twitter.png"
Page {
actions: [
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Tweet")
query {
mimeType: "text/plain"
invokeTargetId: "Twitter"
invokeActionId: "bb.action.SHARE"
}
onTriggered: {
data = _socialInvocation.encodeQString(twShare.statusText);
console.log(data);
}
},
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Post URL")
query {
invokeTargetId: "Twitter"
invokeActionId: "bb.action.SHARE"
uri: "http://www.blackberry.com"
}
},
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Post Image")
query {
mimeType: "image/png"
invokeTargetId: "Twitter"
invokeActionId: "bb.action.SHARE"
uri: _dirPaths.camera + "IMG_00000004.jpg"
}
}
]
titleBar: TitleBar {
title: qsTr("Social Invocation - Twitter")
}
GeneralBlock {
id: twShare
statusLabel: qsTr("Compose a Tweet")
Label {
text: qsTr("View a Twitter Profile")
textStyle.fontWeight: FontWeight.Bold
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
TextField {
id: txtProfile
hintText: qsTr("Enter Twitter handle")
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.75
}
}
Button {
text: qsTr("GO!")
onClicked: {
_socialInvocation.invoke("com.twitter.urihandler", "bb.action.VIEW", "", "twitter:connect:" + txtProfile.text)
}
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.25
}
}
}
Label {
text: qsTr("Search Twitter")
textStyle.fontWeight: FontWeight.Bold
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
TextField {
id: txtSearch
hintText: qsTr("Enter search term")
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.75
}
}
Button {
text: qsTr("GO!")
onClicked: {
_socialInvocation.invoke("com.twitter.urihandler", "bb.action.VIEW", "", "twitter:search:" + txtSearch.text)
}
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.25
}
}
}
Label {
text: qsTr("Share an image on Twitter")
textStyle.fontWeight: FontWeight.Bold
}
ImageSelectionBlock {
invokeTarget: "Twitter"
}
}
}
}
Tab {
title: qsTr("LinkedIn")
imageSource: "asset:///images/ic_linked_in.png"
Page {
actions: [
InvokeActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Update Status")
query {
mimeType: "text/plain"
invokeTargetId: "LinkedIn"
invokeActionId: "bb.action.SHARE"
}
onTriggered: {
data = _socialInvocation.encodeQString(liShare.statusText);
console.log(data);
}
},
ActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("View Profile")
onTriggered: {
//
//
_socialInvocation.invoke("com.linkedin.urihandler", "bb.action.VIEW", "", "linkedin:contact:" + "")
}
}
]
titleBar: TitleBar {
title: qsTr("Social Invocation - LinkedIn")
}
GeneralBlock {
id: liShare
statusLabel: qsTr("Share an Update:")
}
}
}
Tab {
title: qsTr("Foursquare")
Page {
actions: [
ActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("Update Profile")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/self/update")
}
},
ActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("View Profile")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/self")
}
},
ActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("View Friend Requests")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/requests")
}
},
ActionItem {
title: qsTr("View Friend Suggestions")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/suggest?type=friend")
}
},
ActionItem {
title: qsTr("View Page Suggestions")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/suggest?type=page")
}
},
ActionItem {
title: qsTr("Explore")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://venues/explore")
}
},
ActionItem {
title: qsTr("View Venue")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://venues/4b7b1529f964a5206b502fe3")
}
},
ActionItem {
title: qsTr("View Check-in")
onTriggered: {
//
//
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://checkins/" + "")
}
},
ActionItem {
ActionBar.placement: ActionBarPlacement.OnBar
title: qsTr("View Jesse's Profile")
onTriggered: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/452591")
}
},
ActionItem {
title: qsTr("Allow SSO")
onTriggered: {
_socialInvocation.onSSO()
}
}
]
titleBar: TitleBar {
title: qsTr("Social Invocation - Foursquare")
}
Container {
leftPadding: 20.0
rightPadding: 20.0
topPadding: 20.0
bottomPadding: 20.0
Label {
text: qsTr("Add Friends")
textStyle.fontWeight: FontWeight.Bold
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
DropDown {
title: "Find Friends From:"
enabled: true
id: ddSearch
Option {
text: "Contacts"
value: "phonebook"
selected: true
}
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.75
}
}
Button {
text: qsTr("GO!")
onClicked: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://users/addfriends?from=" + ddSearch.selectedValue)
}
verticalAlignment: VerticalAlignment.Center
layoutProperties: StackLayoutProperties {
spaceQuota: 0.25
}
}
}
Label {
text: qsTr("Search Foursquare")
textStyle.fontWeight: FontWeight.Bold
}
TextField {
id: txtVenue
hintText: qsTr("Enter Venue Name")
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Button {
text: qsTr("Search Card")
onClicked: {
_socialInvocation.invokeFoursquareVenueCard(txtVenue.text)
}
}
Button {
text: qsTr("Invoke App")
onClicked: {
_socialInvocation.invoke("com.foursquare.blackberry.uri", "bb.action.OPEN", "", "foursquare://venues/search?query=" + txtVenue.text)
}
}
}
}
}
}
}