kpilot/kpilot

kpilotDCOP_stub.cc

00001 /****************************************************************************
00002 **
00003 ** DCOP Stub Implementation created by dcopidl2cpp from kpilotDCOP.kidl
00004 **
00005 ** WARNING! All changes made in this file will be lost!
00006 **
00007 *****************************************************************************/
00008 
00009 #include "kpilotDCOP_stub.h"
00010 #include <dcopclient.h>
00011 
00012 #include <kdatastream.h>
00013 
00014 
00015 KPilotDCOP_stub::KPilotDCOP_stub( const QCString& app, const QCString& obj )
00016   : DCOPStub( app, obj )
00017 {
00018 }
00019 
00020 KPilotDCOP_stub::KPilotDCOP_stub( DCOPClient* client, const QCString& app, const QCString& obj )
00021   : DCOPStub( client, app, obj )
00022 {
00023 }
00024 
00025 KPilotDCOP_stub::KPilotDCOP_stub( const DCOPRef& ref )
00026   : DCOPStub( ref )
00027 {
00028 }
00029 
00030 void KPilotDCOP_stub::daemonStatus( int arg0 )
00031 {
00032     if ( !dcopClient()  ) {
00033     setStatus( CallFailed );
00034     return;
00035     }
00036     QByteArray data;
00037     QDataStream arg( data, IO_WriteOnly );
00038     arg << arg0;
00039     dcopClient()->send( app(), obj(), "daemonStatus(int)", data );
00040     setStatus( CallSucceeded );
00041 }
00042 
00043 void KPilotDCOP_stub::configure()
00044 {
00045     if ( !dcopClient()  ) {
00046     setStatus( CallFailed );
00047     return;
00048     }
00049     QByteArray data;
00050     dcopClient()->send( app(), obj(), "configure()", data );
00051     setStatus( CallSucceeded );
00052 }
00053 
00054 void KPilotDCOP_stub::configureWizard()
00055 {
00056     if ( !dcopClient()  ) {
00057     setStatus( CallFailed );
00058     return;
00059     }
00060     QByteArray data;
00061     dcopClient()->send( app(), obj(), "configureWizard()", data );
00062     setStatus( CallSucceeded );
00063 }
00064 
00065 int KPilotDCOP_stub::kpilotStatus()
00066 {
00067     int result = 0;
00068     if ( !dcopClient()  ) {
00069     setStatus( CallFailed );
00070     return result;
00071     }
00072     QByteArray data, replyData;
00073     QCString replyType;
00074     if ( dcopClient()->call( app(), obj(), "kpilotStatus()", data, replyType, replyData ) ) {
00075     if ( replyType == "int" ) {
00076         QDataStream _reply_stream( replyData, IO_ReadOnly );
00077         _reply_stream >> result;
00078         setStatus( CallSucceeded );
00079     } else {
00080         callFailed();
00081     }
00082     } else { 
00083     callFailed();
00084     }
00085     return result;
00086 }
00087 
00088 
KDE Home | KDE Accessibility Home | Description of Access Keys