KShutdown – graphical shutdown utility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

230 lines
5.1KB

  1. /****************************************************************************
  2. **
  3. ** DCOP Stub Implementation created by dcopidl2cpp from kshutdowniface.kidl
  4. **
  5. ** WARNING! All changes made in this file will be lost!
  6. **
  7. *****************************************************************************/
  8. #include "kshutdowniface_stub.h"
  9. #include <dcopclient.h>
  10. #include <kdatastream.h>
  11. KShutdownIface_stub::KShutdownIface_stub( const TQCString& app, const TQCString& obj )
  12. : DCOPStub( app, obj )
  13. {
  14. }
  15. KShutdownIface_stub::KShutdownIface_stub( DCOPClient* client, const TQCString& app, const TQCString& obj )
  16. : DCOPStub( client, app, obj )
  17. {
  18. }
  19. KShutdownIface_stub::KShutdownIface_stub( const DCOPRef& ref )
  20. : DCOPStub( ref )
  21. {
  22. }
  23. void KShutdownIface_stub::cancel()
  24. {
  25. if ( !dcopClient() ) {
  26. setStatus( CallFailed );
  27. return;
  28. }
  29. TQByteArray data;
  30. dcopClient()->send( app(), obj(), "cancel()", data );
  31. setStatus( CallSucceeded );
  32. }
  33. bool KShutdownIface_stub::shutDown()
  34. {
  35. bool result = false;
  36. if ( !dcopClient() ) {
  37. setStatus( CallFailed );
  38. return result;
  39. }
  40. TQByteArray data, replyData;
  41. TQCString replyType;
  42. if ( dcopClient()->call( app(), obj(), "shutDown()", data, replyType, replyData ) ) {
  43. if ( replyType == "bool" ) {
  44. TQDataStream _reply_stream( replyData, IO_ReadOnly );
  45. _reply_stream >> result;
  46. setStatus( CallSucceeded );
  47. } else {
  48. callFailed();
  49. }
  50. } else {
  51. callFailed();
  52. }
  53. return result;
  54. }
  55. bool KShutdownIface_stub::shutdown()
  56. {
  57. bool result = false;
  58. if ( !dcopClient() ) {
  59. setStatus( CallFailed );
  60. return result;
  61. }
  62. TQByteArray data, replyData;
  63. TQCString replyType;
  64. if ( dcopClient()->call( app(), obj(), "shutdown()", data, replyType, replyData ) ) {
  65. if ( replyType == "bool" ) {
  66. TQDataStream _reply_stream( replyData, IO_ReadOnly );
  67. _reply_stream >> result;
  68. setStatus( CallSucceeded );
  69. } else {
  70. callFailed();
  71. }
  72. } else {
  73. callFailed();
  74. }
  75. return result;
  76. }
  77. bool KShutdownIface_stub::reboot()
  78. {
  79. bool result = false;
  80. if ( !dcopClient() ) {
  81. setStatus( CallFailed );
  82. return result;
  83. }
  84. TQByteArray data, replyData;
  85. TQCString replyType;
  86. if ( dcopClient()->call( app(), obj(), "reboot()", data, replyType, replyData ) ) {
  87. if ( replyType == "bool" ) {
  88. TQDataStream _reply_stream( replyData, IO_ReadOnly );
  89. _reply_stream >> result;
  90. setStatus( CallSucceeded );
  91. } else {
  92. callFailed();
  93. }
  94. } else {
  95. callFailed();
  96. }
  97. return result;
  98. }
  99. bool KShutdownIface_stub::lockScreen()
  100. {
  101. bool result = false;
  102. if ( !dcopClient() ) {
  103. setStatus( CallFailed );
  104. return result;
  105. }
  106. TQByteArray data, replyData;
  107. TQCString replyType;
  108. if ( dcopClient()->call( app(), obj(), "lockScreen()", data, replyType, replyData ) ) {
  109. if ( replyType == "bool" ) {
  110. TQDataStream _reply_stream( replyData, IO_ReadOnly );
  111. _reply_stream >> result;
  112. setStatus( CallSucceeded );
  113. } else {
  114. callFailed();
  115. }
  116. } else {
  117. callFailed();
  118. }
  119. return result;
  120. }
  121. bool KShutdownIface_stub::logout()
  122. {
  123. bool result = false;
  124. if ( !dcopClient() ) {
  125. setStatus( CallFailed );
  126. return result;
  127. }
  128. TQByteArray data, replyData;
  129. TQCString replyType;
  130. if ( dcopClient()->call( app(), obj(), "logout()", data, replyType, replyData ) ) {
  131. if ( replyType == "bool" ) {
  132. TQDataStream _reply_stream( replyData, IO_ReadOnly );
  133. _reply_stream >> result;
  134. setStatus( CallSucceeded );
  135. } else {
  136. callFailed();
  137. }
  138. } else {
  139. callFailed();
  140. }
  141. return result;
  142. }
  143. void KShutdownIface_stub::configure()
  144. {
  145. if ( !dcopClient() ) {
  146. setStatus( CallFailed );
  147. return;
  148. }
  149. TQByteArray data;
  150. dcopClient()->send( app(), obj(), "configure()", data );
  151. setStatus( CallSucceeded );
  152. }
  153. TQString KShutdownIface_stub::getStatusInfo()
  154. {
  155. TQString result;
  156. if ( !dcopClient() ) {
  157. setStatus( CallFailed );
  158. return result;
  159. }
  160. TQByteArray data, replyData;
  161. TQCString replyType;
  162. if ( dcopClient()->call( app(), obj(), "getStatusInfo()", data, replyType, replyData ) ) {
  163. if ( replyType == "TQString" ) {
  164. TQDataStream _reply_stream( replyData, IO_ReadOnly );
  165. _reply_stream >> result;
  166. setStatus( CallSucceeded );
  167. } else {
  168. callFailed();
  169. }
  170. } else {
  171. callFailed();
  172. }
  173. return result;
  174. }
  175. void KShutdownIface_stub::makeInvisible()
  176. {
  177. if ( !dcopClient() ) {
  178. setStatus( CallFailed );
  179. return;
  180. }
  181. TQByteArray data, replyData;
  182. TQCString replyType;
  183. if ( dcopClient()->call( app(), obj(), "makeInvisible()", data, replyType, replyData ) ) {
  184. setStatus( CallSucceeded );
  185. } else {
  186. callFailed();
  187. }
  188. }
  189. void KShutdownIface_stub::makeVisible()
  190. {
  191. if ( !dcopClient() ) {
  192. setStatus( CallFailed );
  193. return;
  194. }
  195. TQByteArray data;
  196. dcopClient()->send( app(), obj(), "makeVisible()", data );
  197. setStatus( CallSucceeded );
  198. }
  199. void KShutdownIface_stub::setTestMode( bool arg0 )
  200. {
  201. if ( !dcopClient() ) {
  202. setStatus( CallFailed );
  203. return;
  204. }
  205. TQByteArray data;
  206. TQDataStream arg( data, IO_WriteOnly );
  207. arg << arg0;
  208. dcopClient()->send( app(), obj(), "setTestMode(bool)", data );
  209. setStatus( CallSucceeded );
  210. }