KoMainWindowIface.cpp
1/* This file is part of the KDE project
2 Copyright (c) 2001 David Faure <faure@kde.org>
3
4 $Id: KoMainWindowIface.cpp 508787 2006-02-12 18:28:12Z ingwa $
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21#include "KoMainWindowIface.h"
22
23#include "KoMainWindow.h"
24
25#include <tdeapplication.h>
26#include <dcopclient.h>
27#include <kdcopactionproxy.h>
28
29KoMainWindowIface::KoMainWindowIface( KoMainWindow *mainwindow )
30 : DCOPObject( mainwindow )
31{
32 m_pMainWindow = mainwindow;
33 m_actionProxy = new KDCOPActionProxy( mainwindow->actionCollection(), this );
34}
35
36KoMainWindowIface::~KoMainWindowIface()
37{
38 delete m_actionProxy;
39}
40
41DCOPRef KoMainWindowIface::action( const TQCString &name )
42{
43 return DCOPRef( kapp->dcopClient()->appId(), m_actionProxy->actionObjectId( name ) );
44}
45
46QCStringList KoMainWindowIface::actions()
47{
48 QCStringList res;
49 TQValueList<TDEAction *> lst = m_actionProxy->actions();
50 TQValueList<TDEAction *>::ConstIterator it = lst.begin();
51 TQValueList<TDEAction *>::ConstIterator end = lst.end();
52 for (; it != end; ++it )
53 res.append( (*it)->name() );
54
55 return res;
56}
57
58TQMap<TQCString,DCOPRef> KoMainWindowIface::actionMap()
59{
60 return m_actionProxy->actionMap();
61}
62
63ASYNC KoMainWindowIface::print(bool quick) {
64 m_pMainWindow->print(quick);
65}
virtual TDEActionCollection * actionCollection() const
Main window for a KOffice application.