interfaces Library API Documentation

playerdcopobject_skel.cpp

00001 /****************************************************************************
00002 **
00003 ** DCOP Skeleton created by dcopidl2cpp from playerdcopobject.kidl
00004 **
00005 ** WARNING! All changes made in this file will be lost!
00006 **
00007 *****************************************************************************/
00008 
00009 #include "./playerdcopobject.h"
00010 
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013 
00014 namespace KMediaPlayer {
00015 
00016 static const int PlayerDCOPObject_fhash = 17;
00017 static const char* const PlayerDCOPObject_ftable[14][3] = {
00018     { "bool", "openURL(KURL)", "openURL(KURL file)" },
00019     { "void", "pause()", "pause()" },
00020     { "void", "play()", "play()" },
00021     { "void", "stop()", "stop()" },
00022     { "void", "seek(unsigned long int)", "seek(unsigned long int msec)" },
00023     { "bool", "isSeekable()", "isSeekable()" },
00024     { "unsigned long int", "position()", "position()" },
00025     { "bool", "hasLength()", "hasLength()" },
00026     { "unsigned long int", "length()", "length()" },
00027     { "void", "setLooping(bool)", "setLooping(bool)" },
00028     { "bool", "isLooping()", "isLooping()" },
00029     { "int", "state()", "state()" },
00030     { "void", "setState(int)", "setState(int)" },
00031     { 0, 0, 0 }
00032 };
00033 static const int PlayerDCOPObject_ftable_hiddens[13] = {
00034     0,
00035     0,
00036     0,
00037     0,
00038     0,
00039     0,
00040     0,
00041     0,
00042     0,
00043     0,
00044     0,
00045     0,
00046     0,
00047 };
00048 
00049 bool PlayerDCOPObject::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00050 {
00051     static QAsciiDict<int>* fdict = 0;
00052     if ( !fdict ) {
00053     fdict = new QAsciiDict<int>( PlayerDCOPObject_fhash, true, false );
00054     for ( int i = 0; PlayerDCOPObject_ftable[i][1]; i++ )
00055         fdict->insert( PlayerDCOPObject_ftable[i][1],  new int( i ) );
00056     }
00057     int* fp = fdict->find( fun );
00058     switch ( fp?*fp:-1) {
00059     case 0: { // bool openURL(KURL)
00060     KURL arg0;
00061     QDataStream arg( data, IO_ReadOnly );
00062     arg >> arg0;
00063     replyType = PlayerDCOPObject_ftable[0][0]; 
00064     QDataStream _replyStream( replyData, IO_WriteOnly );
00065     _replyStream << openURL(arg0 );
00066     } break;
00067     case 1: { // void pause()
00068     replyType = PlayerDCOPObject_ftable[1][0]; 
00069     pause( );
00070     } break;
00071     case 2: { // void play()
00072     replyType = PlayerDCOPObject_ftable[2][0]; 
00073     play( );
00074     } break;
00075     case 3: { // void stop()
00076     replyType = PlayerDCOPObject_ftable[3][0]; 
00077     stop( );
00078     } break;
00079     case 4: { // void seek(unsigned long int)
00080     unsigned long int arg0;
00081     QDataStream arg( data, IO_ReadOnly );
00082     arg >> arg0;
00083     replyType = PlayerDCOPObject_ftable[4][0]; 
00084     seek(arg0 );
00085     } break;
00086     case 5: { // bool isSeekable()
00087     replyType = PlayerDCOPObject_ftable[5][0]; 
00088     QDataStream _replyStream( replyData, IO_WriteOnly );
00089     _replyStream << isSeekable( );
00090     } break;
00091     case 6: { // unsigned long int position()
00092     replyType = PlayerDCOPObject_ftable[6][0]; 
00093     QDataStream _replyStream( replyData, IO_WriteOnly );
00094     _replyStream << position( );
00095     } break;
00096     case 7: { // bool hasLength()
00097     replyType = PlayerDCOPObject_ftable[7][0]; 
00098     QDataStream _replyStream( replyData, IO_WriteOnly );
00099     _replyStream << hasLength( );
00100     } break;
00101     case 8: { // unsigned long int length()
00102     replyType = PlayerDCOPObject_ftable[8][0]; 
00103     QDataStream _replyStream( replyData, IO_WriteOnly );
00104     _replyStream << length( );
00105     } break;
00106     case 9: { // void setLooping(bool)
00107     bool arg0;
00108     QDataStream arg( data, IO_ReadOnly );
00109     arg >> arg0;
00110     replyType = PlayerDCOPObject_ftable[9][0]; 
00111     setLooping(arg0 );
00112     } break;
00113     case 10: { // bool isLooping()
00114     replyType = PlayerDCOPObject_ftable[10][0]; 
00115     QDataStream _replyStream( replyData, IO_WriteOnly );
00116     _replyStream << isLooping( );
00117     } break;
00118     case 11: { // int state()
00119     replyType = PlayerDCOPObject_ftable[11][0]; 
00120     QDataStream _replyStream( replyData, IO_WriteOnly );
00121     _replyStream << state( );
00122     } break;
00123     case 12: { // void setState(int)
00124     int arg0;
00125     QDataStream arg( data, IO_ReadOnly );
00126     arg >> arg0;
00127     replyType = PlayerDCOPObject_ftable[12][0]; 
00128     setState(arg0 );
00129     } break;
00130     default: 
00131     return DCOPObject::process( fun, data, replyType, replyData );
00132     }
00133     return true;
00134 }
00135 
00136 QCStringList PlayerDCOPObject::interfaces()
00137 {
00138     QCStringList ifaces = DCOPObject::interfaces();
00139     ifaces += "KMediaPlayer::PlayerDCOPObject";
00140     return ifaces;
00141 }
00142 
00143 QCStringList PlayerDCOPObject::functions()
00144 {
00145     QCStringList funcs = DCOPObject::functions();
00146     for ( int i = 0; PlayerDCOPObject_ftable[i][2]; i++ ) {
00147     if (PlayerDCOPObject_ftable_hiddens[i])
00148         continue;
00149     QCString func = PlayerDCOPObject_ftable[i][0];
00150     func += ' ';
00151     func += PlayerDCOPObject_ftable[i][2];
00152     funcs << func;
00153     }
00154     return funcs;
00155 }
00156 
00157 } // namespace
00158 
KDE Logo
This file is part of the documentation for interfaces Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Jan 21 09:58:23 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003