20 #include "kdcopactionproxy.h"
22 #include <dcopclient.h>
23 #include <tdeapplication.h>
24 #include <tdeaction.h>
26 #include <kdcoppropertyproxy.h>
30 class KDCOPActionProxy::KDCOPActionProxyPrivate
33 KDCOPActionProxyPrivate()
36 ~KDCOPActionProxyPrivate()
48 init( actionCollection, parent );
58 d =
new KDCOPActionProxyPrivate;
59 d->m_actionCollection = collection;
61 d->m_prefix = parent->
objId() +
"/action/";
62 d->m_pos = d->m_prefix.length();
72 if ( !d->m_actionCollection )
73 return TQValueList<TDEAction *>();
75 return d->m_actionCollection->actions();
80 if ( !d->m_actionCollection )
83 return d->m_actionCollection->action( name );
88 return d->m_prefix + name;
93 TQMap<TQCString,DCOPRef> res;
97 id = kapp->dcopClient()->appId();
99 TQValueList<TDEAction *> lst =
actions();
100 TQValueList<TDEAction *>::ConstIterator it = lst.begin();
101 TQValueList<TDEAction *>::ConstIterator end = lst.end();
102 for (; it != end; ++it )
109 TQCString &replyType, TQByteArray &replyData )
111 if ( obj.left( d->m_pos ) != d->m_prefix )
118 return processAction( obj, fun, data, replyType, replyData, act );
122 TQCString &replyType, TQByteArray &replyData,
TDEAction *action )
124 if ( fun ==
"activate()" )
131 if ( fun ==
"isPlugged()" )
134 TQDataStream reply( replyData, IO_WriteOnly );
139 if ( fun ==
"functions()" )
141 TQValueList<TQCString> res;
142 res <<
"QCStringList functions()";
143 res <<
"void activate()";
144 res <<
"bool isPlugged()";
148 replyType =
"QCStringList";
149 TQDataStream reply( replyData, IO_WriteOnly );
157 void KDCOPActionProxy::virtual_hook(
int id,
void* data )