kword

KWordFormulaFrameSetIface.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include "KWordFormulaFrameSetIface.h"
00021 #include "KWordViewIface.h"
00022 #include "KWFrame.h"
00023 #include "KWFormulaFrameSet.h"
00024 #include "KWView.h"
00025 #include "KWCanvas.h"
00026 #include "KWDocument.h"
00027 #include <kapplication.h>
00028 #include <dcopclient.h>
00029 #include "KWordFrameSetIface.h"
00030 
00031 KWordFormulaFrameSetIface::KWordFormulaFrameSetIface( KWFormulaFrameSet *_frame )
00032     : KWordFrameSetIface( _frame)
00033 {
00034    m_formulaFrame = _frame;
00035 }
00036 
00037 DCOPRef KWordFormulaFrameSetIface::startEditing()
00038 {
00039     if ( m_formulaFrame->isDeleted() )
00040         return DCOPRef();
00041     KWDocument *doc = m_formulaFrame->kWordDocument();
00042     QValueList<KWView *> views = doc->getAllViews();
00043     KWCanvas* canvas = views.first()->getGUI()->canvasWidget();
00044     canvas->editFrameSet( m_formulaFrame );
00045     return DCOPRef( kapp->dcopClient()->appId(),
00046             ( static_cast<KWFormulaFrameSetEdit *>( canvas->currentFrameSetEdit() ) )
00047              ->dcopObject()->objId() );
00048 }
KDE Home | KDE Accessibility Home | Description of Access Keys