summaryrefslogtreecommitdiffstats
path: root/kshutdown/kshutdowniface_stub.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-07-28 02:30:20 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-07-28 02:30:20 +0200
commit48a589b8c526b34e79e8cdddc4cb7f5fc7b76815 (patch)
tree0f30d90998669b60a0aa840f824cc3d4ea7ddc66 /kshutdown/kshutdowniface_stub.cpp
downloadkshutdown-48a589b8c526b34e79e8cdddc4cb7f5fc7b76815.tar.gz
kshutdown-48a589b8c526b34e79e8cdddc4cb7f5fc7b76815.zip
Initial import of kshutdown 1.0.4
Diffstat (limited to 'kshutdown/kshutdowniface_stub.cpp')
-rw-r--r--kshutdown/kshutdowniface_stub.cpp229
1 files changed, 229 insertions, 0 deletions
diff --git a/kshutdown/kshutdowniface_stub.cpp b/kshutdown/kshutdowniface_stub.cpp
new file mode 100644
index 0000000..9187c8c
--- /dev/null
+++ b/kshutdown/kshutdowniface_stub.cpp
@@ -0,0 +1,229 @@
+/****************************************************************************
+**
+** DCOP Stub Implementation created by dcopidl2cpp from kshutdowniface.kidl
+**
+** WARNING! All changes made in this file will be lost!
+**
+*****************************************************************************/
+
+#include "kshutdowniface_stub.h"
+#include <dcopclient.h>
+
+#include <kdatastream.h>
+
+
+KShutdownIface_stub::KShutdownIface_stub( const QCString& app, const QCString& obj )
+ : DCOPStub( app, obj )
+{
+}
+
+KShutdownIface_stub::KShutdownIface_stub( DCOPClient* client, const QCString& app, const QCString& obj )
+ : DCOPStub( client, app, obj )
+{
+}
+
+KShutdownIface_stub::KShutdownIface_stub( const DCOPRef& ref )
+ : DCOPStub( ref )
+{
+}
+
+void KShutdownIface_stub::cancel()
+{
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return;
+ }
+ QByteArray data;
+ dcopClient()->send( app(), obj(), "cancel()", data );
+ setStatus( CallSucceeded );
+}
+
+bool KShutdownIface_stub::shutDown()
+{
+ bool result = false;
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return result;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "shutDown()", data, replyType, replyData ) ) {
+ if ( replyType == "bool" ) {
+ QDataStream _reply_stream( replyData, IO_ReadOnly );
+ _reply_stream >> result;
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+ } else {
+ callFailed();
+ }
+ return result;
+}
+
+bool KShutdownIface_stub::shutdown()
+{
+ bool result = false;
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return result;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "shutdown()", data, replyType, replyData ) ) {
+ if ( replyType == "bool" ) {
+ QDataStream _reply_stream( replyData, IO_ReadOnly );
+ _reply_stream >> result;
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+ } else {
+ callFailed();
+ }
+ return result;
+}
+
+bool KShutdownIface_stub::reboot()
+{
+ bool result = false;
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return result;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "reboot()", data, replyType, replyData ) ) {
+ if ( replyType == "bool" ) {
+ QDataStream _reply_stream( replyData, IO_ReadOnly );
+ _reply_stream >> result;
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+ } else {
+ callFailed();
+ }
+ return result;
+}
+
+bool KShutdownIface_stub::lockScreen()
+{
+ bool result = false;
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return result;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "lockScreen()", data, replyType, replyData ) ) {
+ if ( replyType == "bool" ) {
+ QDataStream _reply_stream( replyData, IO_ReadOnly );
+ _reply_stream >> result;
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+ } else {
+ callFailed();
+ }
+ return result;
+}
+
+bool KShutdownIface_stub::logout()
+{
+ bool result = false;
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return result;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "logout()", data, replyType, replyData ) ) {
+ if ( replyType == "bool" ) {
+ QDataStream _reply_stream( replyData, IO_ReadOnly );
+ _reply_stream >> result;
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+ } else {
+ callFailed();
+ }
+ return result;
+}
+
+void KShutdownIface_stub::configure()
+{
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return;
+ }
+ QByteArray data;
+ dcopClient()->send( app(), obj(), "configure()", data );
+ setStatus( CallSucceeded );
+}
+
+QString KShutdownIface_stub::getStatusInfo()
+{
+ QString result;
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return result;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "getStatusInfo()", data, replyType, replyData ) ) {
+ if ( replyType == "QString" ) {
+ QDataStream _reply_stream( replyData, IO_ReadOnly );
+ _reply_stream >> result;
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+ } else {
+ callFailed();
+ }
+ return result;
+}
+
+void KShutdownIface_stub::makeInvisible()
+{
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return;
+ }
+ QByteArray data, replyData;
+ QCString replyType;
+ if ( dcopClient()->call( app(), obj(), "makeInvisible()", data, replyType, replyData ) ) {
+ setStatus( CallSucceeded );
+ } else {
+ callFailed();
+ }
+}
+
+void KShutdownIface_stub::makeVisible()
+{
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return;
+ }
+ QByteArray data;
+ dcopClient()->send( app(), obj(), "makeVisible()", data );
+ setStatus( CallSucceeded );
+}
+
+void KShutdownIface_stub::setTestMode( bool arg0 )
+{
+ if ( !dcopClient() ) {
+ setStatus( CallFailed );
+ return;
+ }
+ QByteArray data;
+ QDataStream arg( data, IO_WriteOnly );
+ arg << arg0;
+ dcopClient()->send( app(), obj(), "setTestMode(bool)", data );
+ setStatus( CallSucceeded );
+}
+
+