1
// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
2
/* This file is part of the KDE project
3
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
21
#include "KPresenterViewIface.h"
23
#include "kpresenter_view.h"
24
#include "kprcanvas.h"
26
#include "kpresenter_doc.h"
28
#include <kapplication.h>
29
#include <dcopclient.h>
31
KPresenterViewIface::KPresenterViewIface( KPresenterView *view_ )
32
: KoViewIface( view_ )
37
void KPresenterViewIface::editCut()
42
void KPresenterViewIface::editCopy()
47
void KPresenterViewIface::editPaste()
52
void KPresenterViewIface::editDelete()
57
void KPresenterViewIface::editSelectAll()
59
view->editSelectAll();
62
void KPresenterViewIface::editDuplicatePage()
64
view->editDuplicatePage();
67
void KPresenterViewIface::editDelPage()
72
void KPresenterViewIface::editFind()
77
void KPresenterViewIface::editReplace()
82
void KPresenterViewIface::newView()
87
void KPresenterViewIface::insertPage()
92
void KPresenterViewIface::insertPicture()
94
view->insertPicture();
97
void KPresenterViewIface::toolsMouse()
102
void KPresenterViewIface::toolsLine()
107
void KPresenterViewIface::toolsRectangle()
109
view->toolsRectangle();
112
void KPresenterViewIface::toolsCircleOrEllipse()
114
view->toolsCircleOrEllipse();
117
void KPresenterViewIface::toolsPie()
122
void KPresenterViewIface::toolsText()
127
void KPresenterViewIface::toolsAutoform()
129
view->toolsAutoform();
132
void KPresenterViewIface::toolsDiagramm()
134
view->toolsDiagramm();
137
void KPresenterViewIface::toolsTable()
142
void KPresenterViewIface::toolsFormula()
144
view->toolsFormula();
147
void KPresenterViewIface::toolsObject()
152
void KPresenterViewIface::toolsFreehand()
154
view->toolsFreehand();
157
void KPresenterViewIface::toolsPolyline()
159
view->toolsPolyline();
162
void KPresenterViewIface::toolsQuadricBezierCurve()
164
view->toolsQuadricBezierCurve();
167
void KPresenterViewIface::toolsCubicBezierCurve()
169
view->toolsCubicBezierCurve();
172
void KPresenterViewIface::toolsConvexOrConcavePolygon()
174
view->toolsConvexOrConcavePolygon();
177
void KPresenterViewIface::extraPenBrush()
179
view->extraProperties();
182
void KPresenterViewIface::extraProperties()
184
view->extraProperties();
187
void KPresenterViewIface::extraRaise()
192
void KPresenterViewIface::extraLower()
197
void KPresenterViewIface::extraRotate()
202
void KPresenterViewIface::extraShadow()
207
void KPresenterViewIface::extraBackground()
209
view->extraBackground();
212
void KPresenterViewIface::extraLayout()
217
void KPresenterViewIface::extraConfigure()
219
view->extraConfigure();
222
void KPresenterViewIface::extraLineBegin()
224
view->extraLineBegin();
227
void KPresenterViewIface::extraLineEnd()
229
view->extraLineEnd();
232
void KPresenterViewIface::extraWebPres()
234
view->extraWebPres();
237
void KPresenterViewIface::extraMSPres()
242
void KPresenterViewIface::extraAlignObjLeft()
244
view->extraAlignObjLeft();
247
void KPresenterViewIface::extraAlignObjCenterH()
249
view->extraAlignObjCenterH();
252
void KPresenterViewIface::extraAlignObjRight()
254
view->extraAlignObjRight();
257
void KPresenterViewIface::extraAlignObjTop()
259
view->extraAlignObjTop();
262
void KPresenterViewIface::extraAlignObjCenterV()
264
view->extraAlignObjCenterV();
267
void KPresenterViewIface::extraAlignObjBottom()
269
view->extraAlignObjBottom();
272
void KPresenterViewIface::extraAlignObjs()
274
view->extraAlignObjs();
277
void KPresenterViewIface::extraGroup()
282
void KPresenterViewIface::extraUnGroup()
284
view->extraUnGroup();
287
void KPresenterViewIface::extraPenStyle()
289
view->extraPenStyle();
292
void KPresenterViewIface::extraPenWidth()
294
view->extraPenWidth();
297
void KPresenterViewIface::screenTransEffect()
299
view->screenTransEffect();
302
void KPresenterViewIface::screenConfigPages()
304
view->screenConfigPages();
307
void KPresenterViewIface::screenAssignEffect()
309
view->screenAssignEffect();
312
void KPresenterViewIface::screenStart()
317
void KPresenterViewIface::screenStartFromFirst()
319
view->screenStartFromFirst();
322
void KPresenterViewIface::screenStop()
327
void KPresenterViewIface::screenPause()
332
void KPresenterViewIface::screenFirst()
337
void KPresenterViewIface::screenPrev()
342
void KPresenterViewIface::screenNext()
347
void KPresenterViewIface::screenLast()
352
void KPresenterViewIface::screenSkip()
357
void KPresenterViewIface::sizeSelected( int size )
359
view->sizeSelected( size );
362
void KPresenterViewIface::fontSelected( const QString &fontFamily )
364
view->fontSelected( fontFamily );
367
void KPresenterViewIface::textBold()
372
void KPresenterViewIface::textItalic()
377
void KPresenterViewIface::textUnderline()
379
view->textUnderline();
382
void KPresenterViewIface::textColor()
387
void KPresenterViewIface::textAlignLeft()
389
view->textAlignLeft();
392
void KPresenterViewIface::textAlignCenter()
394
view->textAlignCenter();
397
void KPresenterViewIface::textAlignRight()
399
view->textAlignRight();
402
void KPresenterViewIface::mtextFont()
407
void KPresenterViewIface::textDepthPlus()
409
view->textDepthPlus();
412
void KPresenterViewIface::textDepthMinus()
414
view->textDepthMinus();
417
void KPresenterViewIface::textContentsToHeight()
419
view->textContentsToHeight();
422
void KPresenterViewIface::textObjectToContents()
424
view->textObjectToContents();
427
void KPresenterViewIface::penChosen()
432
void KPresenterViewIface::brushChosen()
437
int KPresenterViewIface::getCurrentPresPage() const
439
return view->getCurrentPresPage();
442
int KPresenterViewIface::getCurrentPresStep() const
444
return view->getCurrentPresStep();
447
int KPresenterViewIface::getPresStepsOfPage() const
449
return view->getPresStepsOfPage();
452
int KPresenterViewIface::getNumPresPages() const
454
return view->getNumPresPages();
457
bool KPresenterViewIface::gotoPresPage( int pg ) const
459
return view->gotoPresPage( pg );
462
int KPresenterViewIface::getCurrentPageNum() const
464
return view->getCurrPgNum();
467
void KPresenterViewIface::insertSpecialChar()
469
view->insertSpecialChar();
472
void KPresenterViewIface::insertLink()
477
void KPresenterViewIface::editCustomVars()
479
view->editCustomVars();
482
void KPresenterViewIface::insertVariable()
484
view->insertVariable();
487
void KPresenterViewIface::insertCustomVariable()
489
view->insertCustomVariable();
492
void KPresenterViewIface::insertNewCustomVariable()
494
view->insertNewCustomVariable();
497
void KPresenterViewIface::changeCaseOfText()
499
view->changeCaseOfText();
502
void KPresenterViewIface::viewShowSideBar()
504
view->viewShowSideBar();
507
void KPresenterViewIface::viewShowNoteBar()
509
view->viewShowNoteBar();
512
void KPresenterViewIface::viewSlideMaster()
514
view->viewSlideMaster();
518
void KPresenterViewIface::formatParagraph()
520
view->formatParagraph();
523
void KPresenterViewIface::extraAutoFormat()
525
view->extraAutoFormat();
528
void KPresenterViewIface::refreshAllVariable()
530
view->extraAutoFormat();
533
bool KPresenterViewIface::skipToPage( int _num )
535
//don't try to skip to a not exist page
536
if(_num>(int)view->kPresenterDoc()->getPageNums()-1)
538
view->skipToPage(_num);
542
void KPresenterViewIface::toolsRotate()
547
void KPresenterViewIface::toolsZoom()
552
void KPresenterViewIface::insertComment()
554
view->insertComment();
557
void KPresenterViewIface::configureCompletion()
559
view->configureCompletion();
562
void KPresenterViewIface::duplicateObj()
564
view->duplicateObj();
567
void KPresenterViewIface::extraSendBackward()
569
view->extraSendBackward();
572
void KPresenterViewIface::extraBringForward()
574
view->extraBringForward();
577
void KPresenterViewIface::applyAutoFormat()
579
view->applyAutoFormat();
582
void KPresenterViewIface::editDeSelectAll()
584
view->editDeSelectAll();
587
void KPresenterViewIface::createStyleFromSelection()
589
view->createStyleFromSelection();
592
void KPresenterViewIface::closeObject()
597
void KPresenterViewIface::savePicture()
602
void KPresenterViewIface::viewFooter()
607
void KPresenterViewIface::viewHeader()
613
// note: _nPage is the user visible 1-based page number
614
// if 0 < _verbose exportPage() returns the title and notes of the page
615
// if not verbose it returns an empty string
616
QStringList KPresenterViewIface::exportPage( int _nPage,
619
const QString & _fileName,
620
const QString & _format,
625
// we translate the user visible 1-based page number
626
// to KPresenter's internal 0-based page number
627
const int nPage = _nPage-1;
630
view->kPresenterDoc() &&
631
nPage < (int)view->kPresenterDoc()->getPageNums() ){
632
KPrCanvas* canvas = view->getCanvas();
634
if( canvas->exportPage( nPage,
637
KURL::fromPathOrURL( _fileName ),
638
_format.isEmpty() ? "PNG" : _format.latin1(),
639
QMAX(-1, QMIN(100, _quality))) ){
641
KPrPage* page = view->kPresenterDoc()->pageList().at( nPage );
643
// Note: Do not i18n the following strings, they are prepared
644
// to be written to an IndeView page information file,
645
// see http://www.indeview.org for details.
646
// Note: We use the 1-based page number as fallback page title.
647
res << QString("Name=%1")
648
.arg( page->pageTitle( QString("Page%1").arg(_nPage) ) );
649
res << QString("Notes=%1")
650
.arg( page->noteText() );
659
void KPresenterViewIface::insertFile()
664
void KPresenterViewIface::importStyle()
669
void KPresenterViewIface::backgroundPicture()
671
view->backgroundPicture();
674
void KPresenterViewIface::insertFile( const QString & file )
676
view->insertFile( file );
679
void KPresenterViewIface::addWordToDictionary()
681
view->addWordToDictionary();
684
void KPresenterViewIface::customSlideShow()
686
view->customSlideShow();
689
void KPresenterViewIface::insertLineBreak()
691
view->slotLineBreak();
694
void KPresenterViewIface::increaseNumberingLevel()
696
view->slotIncreaseNumberingLevel();
699
void KPresenterViewIface::decreaseNumberingLevel()
701
view->slotDecreaseNumberingLevel();
704
void KPresenterViewIface::increaseFontSize()
706
view->increaseFontSize();
709
void KPresenterViewIface::decreaseFontSize()
711
view->decreaseFontSize();
714
void KPresenterViewIface::flipHorizontal()
716
view->flipHorizontal();
719
void KPresenterViewIface::flipVertical()
721
view->flipVertical();