KoViewIface.cc
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "KoViewIface.h"
00022
00023 #include "koView.h"
00024
00025 #include <kapplication.h>
00026 #include <dcopclient.h>
00027 #include <kdcopactionproxy.h>
00028 #include <kaction.h>
00029
00030
00031 QCString KoViewIface::newIfaceName()
00032 {
00033 static int s_viewIFNumber = 0;
00034 QCString name; name.setNum( s_viewIFNumber++ ); name.prepend("View-");
00035 return name;
00036 }
00037
00038 KoViewIface::KoViewIface( KoView *view )
00039 : DCOPObject( newIfaceName() )
00040 {
00041 m_actionProxy = new KDCOPActionProxy( view->actionCollection(), this );
00042 }
00043
00044 KoViewIface::KoViewIface( const char *name, KoView *view )
00045 : DCOPObject( name )
00046 {
00047 m_pView = view;
00048 m_actionProxy = new KDCOPActionProxy( view->actionCollection(), this );
00049 }
00050
00051 KoViewIface::~KoViewIface()
00052 {
00053 delete m_actionProxy;
00054 }
00055
00056 DCOPRef KoViewIface::action( const QCString &name )
00057 {
00058 return DCOPRef( kapp->dcopClient()->appId(), m_actionProxy->actionObjectId( name ) );
00059 }
00060
00061 QCStringList KoViewIface::actions()
00062 {
00063 QCStringList res;
00064 QValueList<KAction *> lst = m_actionProxy->actions();
00065 QValueList<KAction *>::ConstIterator it = lst.begin();
00066 QValueList<KAction *>::ConstIterator end = lst.end();
00067 for (; it != end; ++it )
00068 res.append( (*it)->name() );
00069
00070 return res;
00071 }
00072
00073 QMap<QCString,DCOPRef> KoViewIface::actionMap()
00074 {
00075 return m_actionProxy->actionMap();
00076 }
This file is part of the documentation for lib Library Version 1.3.5.