main.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
  3. * All rights reserved.
  4. * This component and the accompanying materials are made available
  5. * under the terms of "Eclipse Public License v1.0"
  6. * which accompanies this distribution, and is available
  7. * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8. *
  9. * Initial Contributors:
  10. * Nokia Corporation - initial contribution.
  11. *
  12. * Contributors:
  13. *
  14. * Description: Main.
  15. */
  16. /*!
  17. * \file
  18. * \brief Declaration of the main() function for the P2Pexample application.
  19. */
  20. /*! \mainpage P2P via NFC example
  21. *
  22. * \section intro_sec Introduction
  23. *
  24. * The P2Pexample is a sample application that demonstrates how to use the peer-to-peer communication between
  25. * multiple NFC devices using the NFC LLCP communication protocol.
  26. * The P2Pexample application is a multiplayer game, the purpose of which is to collect a full stack of matching images.
  27. * Each player starts with a random set of images. The players can view each other's images and exchange a single
  28. * image during each connection session.
  29. *
  30. * A custom Qt Quick user interface shows the players' images and allows the selection of a single image
  31. * for exchange during the next NFC connection session. Dialog boxes are displayed at game startup and when a
  32. * player meets the winning condition. After winning, the winning player's game is reset.
  33. *
  34. * The C++ class P2PEngine represents a game logic engine. It is contains the images used in the game, the
  35. * lists of local and remote players' images, and the image selected for exchange.
  36. * The game stage is updated based on messages from the NFCconnection class. P2PEngine emits
  37. * three signals that are listened to by the Qt UI.
  38. *
  39. * The C++ class NfcConnection creates a peer-to-peer connection between NFC devices using the NFC LLCP communication
  40. * protocol. The class is responsible for sending and receiving messages between two NFC devices.
  41. * LLCP server takes care of listening for NFC targets and starts an LLCP connection to the client.
  42. * The LLCP server is listening for incoming connections at a specified URI and then sends data to the client.
  43. *
  44. * \section prerequisites_sec Prerequisites
  45. *
  46. * Qt and Qt Quick basics.
  47. *
  48. * \section capability_sec Required capablities
  49. *
  50. * The application requires no capabilities that cannot be granted by the user at install time. The SIS installation file can be self-signed.
  51. *
  52. * \section knownissues_sec Known issues
  53. *
  54. * None.
  55. *
  56. * \section build_install_sec Building and installation
  57. *
  58. * \subsection build_install_preparations_subsec Preparations
  59. *
  60. * Make sure that you have installed Qt 4.7.3 and Qt Mobility 1.2 (or later if applicable
  61. * to your version of the Qt SDK) binaries on your device. These can be installed using
  62. * the SIS installation packages included with Qt SDK. This sample requires Qt SDK 1.1 or later is
  63. * required to compile the application.
  64. *
  65. * Additionally, create a target for Qt 4.7.3 and Qt Mobility 1.2
  66. * for Symbian^3 following the instructions from:
  67. * https://projects.forum.nokia.com/QtM12bSymb
  68. *
  69. * Two or more Nokia C7-00 devices with Symbian Anna firmware are required to run the application.
  70. *
  71. * \subsection build_install_qt_sdk_subsec Build & installation instructions using Qt SDK
  72. *
  73. * <ol>
  74. * <li>
  75. * Open P2Pexample.pro by selecting the menu item File > Open File or Project... and select P2Pexample.pro.
  76. * </li>
  77. * <li>
  78. * Select the "Qt 4.7.3 for Symbian^3 with QtM1.2b" target and press the Finish button.
  79. * </li>
  80. * <li>
  81. * Make sure that an NFC enabled Symbian device is connected to your development PC via USB,
  82. * ensure that the "Symbian Device" target is selected in the Target Selector and press the Run
  83. * button to build the project and create the P2Pexample.sis Symbian install package. The application
  84. * is automatically installed on the device.
  85. * </li>
  86. * </ol>
  87. *
  88. * \section usage_sec Usage
  89. *
  90. * \subsection usage_prerequisites_subsec Usage prerequisites
  91. *
  92. * Two or more NFC enabled devices that all have the P2Pexample application installed and
  93. * running are needed to be able play.
  94. *
  95. * \subsection usage_game_start_subsec Game start
  96. *
  97. * When the application is launched it randomly initializes images for each player.
  98. * A dialog is shown to remind the player of the game rules. Ater tapping the OK button the player can start to play.
  99. *
  100. * \subsection usage_playing_the_game_subsec Playing the game
  101. *
  102. * The player can select one image that he/she wants to exchange by tapping on it.
  103. * The selection can be changed by tapping on another image. Players can see each other's images on their device by
  104. * placing two NFC sensors together. If both players have selected images, the images will be exchanged.
  105. *
  106. * \subsection usage_winning_the_game_subsec Winning the game
  107. *
  108. * When a player collects a full stack of identical image the game won dialog is shown. After tapping the OK button game state is reset.
  109. *
  110. * \section compatibility_sec Compatibility
  111. *
  112. * This sample application has been tested using the following hardware and
  113. * software:
  114. *
  115. * <ul>
  116. * <li>Nokia C7-00 with Symbian Anna Firmware</li>
  117. * <li>Nokia Qt SDK 1.1</li>
  118. * <li>QtMobility 1.2 Beta1</li>
  119. * </ul>
  120. *
  121. * \section change_history_sec Change history
  122. *
  123. * 1.0 First version
  124. *
  125. * \section references_sec References
  126. *
  127. * NFC
  128. * http://www.forum.nokia.com/NFC
  129. *
  130. * Qt for Symbian
  131. * http://qt.nokia.com/downloads
  132. */
  133. #ifndef MAIN_H
  134. #define MAIN_H
  135. /*!
  136. * \fn int main(int argc, char *argv[])
  137. * \brief The <code>main()</code> function for the P2P example application.
  138. *
  139. * Constructs the main window of the application.
  140. */
  141. int main(int argc, char *argv[]);
  142. #endif // MAIN_H