00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 import QtQuick 1.1
00041 import com.nokia.symbian 1.1
00042
00043
00044 PageStackWindow {
00045 id: mainWindow
00046 showStatusBar: true
00047 ToolBarLayout {
00048 id: commonTools
00049 ToolButton {
00050 flat: true
00051 iconSource: "toolbar_back.svg"
00052 onClicked: pageStack.depth <= 1 ? Qt.quit() : pageStack.pop()
00053 }
00054 ToolButton {
00055 flat: true
00056 iconSource: "toolbar_options.svg"
00057 onClicked: pageStack.depth <= 1 ? pageMenu.open() : pageStack.pop()
00058 }
00059 }
00060
00061 Page {
00062 id: helppage
00063 tools: commonTools
00064
00065
00066 PageHeading {
00067 id: help
00068 anchors.top: parent.top
00069 width: parent.width
00070 text: qsTr("Help")
00071 }
00072
00073 TextArea {
00074 anchors.top: help.bottom
00075 width: parent.width
00076 height: parent.height - 5
00077 text: "Select Start Easy Setup menu option, \n" +
00078 "holding the NFC enabled devices close, to communicate over NFC channel.\n\n" +
00079 "It will detect the device and will display the device info.\n\n" +
00080 "Select Start EasySetupAndPair menu option to" +
00081 "detect the device and pair with it.\n\n" +
00082 "Select Share menu option, \n" +
00083 "to prepare the device for sharing files.\n" +
00084 "Share request is not dependent on Easy setup requests,\n" +
00085 "they can be used directly.\n\n" +
00086 "Select Cancel request menu option, \n" +
00087 "to cancel any of the NFC requests \n Eg: Easy setup, Easy SetupAndPair and Share.\n\n" +
00088 "Once sharing is started, you can\n use the menu options to share files.\n\n" +
00089 "Select Share File menu option, to share a file.\n\n" +
00090 "Select Share Files menu option, to share multiple files.\n"
00091 readOnly: true
00092 }
00093 }
00094
00095 Page {
00096 id: aboutpage
00097 tools: commonTools
00098
00099
00100 PageHeading{
00101 id: about
00102 anchors.top: parent.top
00103 width: parent.width
00104 text: qsTr("About")
00105 }
00106
00107
00108 Text {
00109 anchors.top: about.bottom
00110 width: parent.width
00111 height: parent.height
00112 text: " NFC Sharing application, Ver 1.0" +
00113 "\n\n Copyright (c) 2010 Nokia.\n All rights reserved"
00114 color: "white"
00115 }
00116 }
00117
00118 Page {
00119 id: mainpage
00120 tools: commonTools
00121
00122
00123 PageHeading{
00124 id: heading
00125 anchors.top: parent.top
00126 width: parent.width
00127 text: qsTr("Nfc share Example")
00128 }
00129
00130
00131 TextArea {
00132 id: displayInfo
00133 anchors.top: heading.bottom
00134 anchors.topMargin: 10
00135 font.pointSize: 8
00136 anchors.left: parent.left
00137 anchors.leftMargin: 10
00138 anchors.right: parent.right
00139 anchors.rightMargin: 10
00140 width: parent.width
00141 anchors.bottomMargin: 10
00142 anchors.bottom: parent.bottom
00143 readOnly: true
00144 text: "Click the menu option."
00145 }
00146
00147
00148 Menu {
00149 id: pageMenu
00150
00151 content:
00152 Column {
00153 width: pageMenu.width
00154
00155 MenuItem {
00156 id: menu1
00157 text: qsTr("Start Easy Setup")
00158 onClicked:{
00159 nfcshareex.startEasySetup();
00160 pageMenu.close();
00161 }
00162 }
00163
00164 MenuItem {
00165 id: menu2
00166 text: qsTr("Start Easy SetupAndPair")
00167 onClicked:{
00168 nfcshareex.startEasySetupAndPair();
00169 pageMenu.close();
00170 }
00171 }
00172
00173 MenuItem {
00174 id: menu3
00175 text: qsTr("Share File")
00176 onClicked:{
00177 nfcshareex.shareFile();
00178 pageMenu.close();
00179 }
00180 }
00181
00182 MenuItem {
00183 id: menu4
00184 text: qsTr("Share Files")
00185 onClicked:{
00186 nfcshareex.shareFiles();
00187 pageMenu.close();
00188 }
00189 }
00190
00191 MenuItem {
00192 id: menu5
00193 text: qsTr("Cancel")
00194 onClicked:{
00195 nfcshareex.cancel();
00196 pageMenu.close();
00197 }
00198 }
00199
00200 MenuItem {
00201 id: menu6
00202 text: qsTr("Clear text")
00203 onClicked:{
00204 displayInfo.text = ""
00205 nfcshareex.clear();
00206 pageMenu.close();
00207 }
00208 }
00209
00210 MenuItem {
00211 id: menu7
00212 text: qsTr("Help")
00213 onClicked:{
00214 pageStack.push(helppage)
00215 pageMenu.close();
00216 }
00217 }
00218
00219 MenuItem {
00220 id: menu8
00221 text: qsTr("About")
00222 onClicked:{
00223 pageStack.push(aboutpage);
00224 pageMenu.close();
00225 }
00226 }
00227
00228 }
00229 }
00230
00231
00232
00233 Connections {
00234 target: nfcshareex
00235 onDisplayText: {
00236 displayInfo.text = aText;
00237 }
00238 }
00239 }
00240
00241
00242 Component.onCompleted: {
00243 pageStack.push(mainpage)
00244 }
00245
00246 }
00247