qatresult.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /****************************************************************************
  2. **
  3. ** This file is part of the Qt Extended Opensource Package.
  4. **
  5. ** Copyright (C) 2009 Trolltech ASA.
  6. **
  7. ** Contact: Qt Extended Information (info@qtextended.org)
  8. **
  9. ** This file may be used under the terms of the GNU General Public License
  10. ** version 2.0 as published by the Free Software Foundation and appearing
  11. ** in the file LICENSE.GPL included in the packaging of this file.
  12. **
  13. ** Please review the following information to ensure GNU General Public
  14. ** Licensing requirements will be met:
  15. ** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
  16. **
  17. **
  18. ****************************************************************************/
  19. #ifndef QATRESULT_H
  20. #define QATRESULT_H
  21. #include <qobject.h>
  22. #include <qstring.h>
  23. class QAtResultPrivate;
  24. class QAtResult
  25. {
  26. public:
  27. enum ResultCode
  28. {
  29. OK = -1,
  30. Connect = -2,
  31. NoCarrier = -3,
  32. Error = -4,
  33. NoDialtone = -5,
  34. Busy = -6,
  35. NoAnswer = -7,
  36. Dead = -8,
  37. // General errors (GSM 27.07, section 9.2.1).
  38. PhoneFailure = 0,
  39. NoConnectionToPhone = 1,
  40. PhoneAdapterLinkReserved = 2,
  41. OperationNotAllowed = 3,
  42. OperationNotSupported = 4,
  43. PhSimPinRequired = 5,
  44. PhFSimPinRequired = 6,
  45. PhFSimPukRequired = 7,
  46. SimNotInserted = 10,
  47. SimPinRequired = 11,
  48. SimPukRequired = 12,
  49. SimFailure = 13,
  50. SimBusy = 14,
  51. SimWrong = 15,
  52. IncorrectPassword = 16,
  53. SimPin2Required = 17,
  54. SimPuk2Required = 18,
  55. MemoryFull = 20,
  56. InvalidIndex = 21,
  57. NotFound = 22,
  58. MemoryFailure = 23,
  59. TextStringTooLong = 24,
  60. InvalidCharsInTextString = 25,
  61. DialStringTooLong = 26,
  62. InvalidCharsInDialString = 27,
  63. NoNetworkService = 30,
  64. NetworkTimeout = 31,
  65. NetworkNotAllowed = 32,
  66. NetPersPinRequired = 40,
  67. NetPersPukRequired = 41,
  68. NetSubsetPersPinRequired = 42,
  69. NetSubsetPersPukRequired = 43,
  70. ServProvPersPinRequired = 44,
  71. ServProvPersPukRequired = 45,
  72. CorpPersPinRequired = 46,
  73. CorpPersPukRequired = 47, // 23 according to spec ???
  74. HiddenKeyRequired = 48, // 24 according to spec ???
  75. Unknown = 100,
  76. // GPRS-related errors (GSM 27.07, section 9.2.2).
  77. IllegalMS = 103,
  78. IllegalME = 106,
  79. GPRSServicesNotAllowed = 107,
  80. PLMNNotAllowed = 111,
  81. LocationAreaNotAllowed = 112,
  82. RoamingNotAllowed = 113,
  83. ServiceOptionNotSupported = 132,
  84. ServiceOptionNotSubscribed = 133,
  85. ServiceOptionOutOfOrder = 134,
  86. UnspecifiedGPRSError = 148,
  87. PDPAuthenticationFailure = 149,
  88. InvalidMobileClass = 150,
  89. // VBS/VGCS and eMLPP errors (GSM 27.07, section 9.2.3).
  90. VBSVGCSNotSupported = 151,
  91. NoServiceSubscriptionOnSim = 152,
  92. NoSubscriptionForGroupId = 153,
  93. GroupIdNotActivatedOnSim = 154,
  94. NoMatchingNotification = 155,
  95. VBSVGCSCallAlreadyPresent = 156,
  96. Congestion = 157,
  97. NetworkFailure = 158,
  98. UplinkBusy = 159,
  99. NoAccessRightsForSimFile = 160,
  100. NoSubscriptionForPriority = 161,
  101. OperationNotApplicable = 162,
  102. // SMS errors (GSM 27.05, section 3.2.5).
  103. MEFailure = 300,
  104. SMSServiceOfMEReserved = 301,
  105. SMSOperationNotAllowed = 302,
  106. SMSOperationNotSupported = 303,
  107. InvalidPDUModeParameter = 304,
  108. InvalidTextModeParameter = 305,
  109. USimNotInserted = 310,
  110. USimPinRequired = 311,
  111. PHUSimPinRequired = 312,
  112. USimFailure = 313,
  113. USimBusy = 314,
  114. USimWrong = 315,
  115. USimPukRequired = 316,
  116. USimPin2Required = 317,
  117. USimPuk2Required = 318,
  118. SMSMemoryFailure = 320,
  119. InvalidMemoryIndex = 321,
  120. SMSMemoryFull = 322,
  121. SMSCAddressUnknown = 330,
  122. SMSNoNetworkService = 331,
  123. SMSNetworkTimeout = 332,
  124. NoCNMAAckExpected = 340,
  125. UnknownError = 500
  126. };
  127. class UserData
  128. {
  129. public:
  130. virtual ~UserData() {}
  131. };
  132. QAtResult();
  133. QAtResult( const QAtResult& other );
  134. ~QAtResult();
  135. QAtResult& operator=( const QAtResult& other );
  136. QString result() const;
  137. void setResult( const QString& value );
  138. QString content() const;
  139. void setContent( const QString& value );
  140. void append( const QString& value );
  141. QAtResult::ResultCode resultCode() const;
  142. void setResultCode( QAtResult::ResultCode value );
  143. bool ok() const;
  144. QString verboseResult() const;
  145. QAtResult::UserData *userData() const;
  146. void setUserData( QAtResult::UserData *value );
  147. private:
  148. QAtResultPrivate *d;
  149. void resultToCode( const QString& value );
  150. QString codeToResult( const QString& defaultValue ) const;
  151. };
  152. #endif