kpresenter

KPrViewIface.cpp
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "KPrViewIface.h"
21
22#include "KPrView.h"
23#include "KPrCanvas.h"
24#include "KPrPage.h"
25#include "KPrDocument.h"
26
27#include <tdeapplication.h>
28#include <dcopclient.h>
29
30KPrViewIface::KPrViewIface( KPrView *view_ )
31 : KoViewIface( view_ )
32{
33 view = view_;
34}
35
36void KPrViewIface::editCut()
37{
38 view->editCut();
39}
40
41void KPrViewIface::editCopy()
42{
43 view->editCopy();
44}
45
46void KPrViewIface::editPaste()
47{
48 view->editPaste();
49}
50
51void KPrViewIface::editDelete()
52{
53 view->editDelete();
54}
55
56void KPrViewIface::editSelectAll()
57{
58 view->editSelectAll();
59}
60
61void KPrViewIface::editDuplicatePage()
62{
63 view->editDuplicatePage();
64}
65
66void KPrViewIface::editDelPage()
67{
68 view->editDelPage();
69}
70
71void KPrViewIface::editFind()
72{
73 view->editFind();
74}
75
76void KPrViewIface::editReplace()
77{
78 view->editReplace();
79}
80
81void KPrViewIface::newView()
82{
83 view->newView();
84}
85
86void KPrViewIface::insertPage()
87{
88 view->insertPage();
89}
90
91void KPrViewIface::insertPicture()
92{
93 view->insertPicture();
94}
95
96void KPrViewIface::toolsMouse()
97{
98 view->toolsMouse();
99}
100
101void KPrViewIface::toolsLine()
102{
103 view->toolsLine();
104}
105
106void KPrViewIface::toolsRectangle()
107{
108 view->toolsRectangle();
109}
110
111void KPrViewIface::toolsCircleOrEllipse()
112{
113 view->toolsCircleOrEllipse();
114}
115
116void KPrViewIface::toolsPie()
117{
118 view->toolsPie();
119}
120
121void KPrViewIface::toolsText()
122{
123 view->toolsText();
124}
125
126void KPrViewIface::toolsAutoform()
127{
128 view->toolsAutoform();
129}
130
131void KPrViewIface::toolsDiagramm()
132{
133 view->toolsDiagramm();
134}
135
136void KPrViewIface::toolsTable()
137{
138 view->toolsTable();
139}
140
141void KPrViewIface::toolsFormula()
142{
143 view->toolsFormula();
144}
145
146void KPrViewIface::toolsObject()
147{
148 view->toolsObject();
149}
150
151void KPrViewIface::toolsFreehand()
152{
153 view->toolsFreehand();
154}
155
156void KPrViewIface::toolsPolyline()
157{
158 view->toolsPolyline();
159}
160
161void KPrViewIface::toolsQuadricBezierCurve()
162{
163 view->toolsQuadricBezierCurve();
164}
165
166void KPrViewIface::toolsCubicBezierCurve()
167{
168 view->toolsCubicBezierCurve();
169}
170
171void KPrViewIface::toolsConvexOrConcavePolygon()
172{
173 view->toolsConvexOrConcavePolygon();
174}
175
176void KPrViewIface::extraPenBrush()
177{
178 view->extraProperties();
179}
180
181void KPrViewIface::extraProperties()
182{
183 view->extraProperties();
184}
185
186void KPrViewIface::extraRaise()
187{
188 view->extraRaise();
189}
190
191void KPrViewIface::extraLower()
192{
193 view->extraLower();
194}
195
196void KPrViewIface::extraRotate()
197{
198 view->extraRotate();
199}
200
201void KPrViewIface::extraShadow()
202{
203 view->extraShadow();
204}
205
206void KPrViewIface::extraBackground()
207{
208 view->extraBackground();
209}
210
211void KPrViewIface::extraLayout()
212{
213 view->extraLayout();
214}
215
216void KPrViewIface::extraConfigure()
217{
218 view->extraConfigure();
219}
220
221void KPrViewIface::extraLineBegin()
222{
223 view->extraLineBegin();
224}
225
226void KPrViewIface::extraLineEnd()
227{
228 view->extraLineEnd();
229}
230
231void KPrViewIface::extraWebPres()
232{
233 view->extraWebPres();
234}
235
236void KPrViewIface::extraMSPres()
237{
238 view->extraMSPres();
239}
240
241void KPrViewIface::extraAlignObjLeft()
242{
243 view->extraAlignObjLeft();
244}
245
246void KPrViewIface::extraAlignObjCenterH()
247{
248 view->extraAlignObjCenterH();
249}
250
251void KPrViewIface::extraAlignObjRight()
252{
253 view->extraAlignObjRight();
254}
255
256void KPrViewIface::extraAlignObjTop()
257{
258 view->extraAlignObjTop();
259}
260
261void KPrViewIface::extraAlignObjCenterV()
262{
263 view->extraAlignObjCenterV();
264}
265
266void KPrViewIface::extraAlignObjBottom()
267{
268 view->extraAlignObjBottom();
269}
270
271void KPrViewIface::extraGroup()
272{
273 view->extraGroup();
274}
275
276void KPrViewIface::extraUnGroup()
277{
278 view->extraUnGroup();
279}
280
281void KPrViewIface::extraPenStyle()
282{
283// FIXME
284// view->extraPenStyle();
285}
286
287void KPrViewIface::extraPenWidth()
288{
289// FIXME
290// view->extraPenWidth();
291}
292
293void KPrViewIface::screenTransEffect()
294{
295 view->screenTransEffect();
296}
297
298void KPrViewIface::screenConfigPages()
299{
300 view->screenConfigPages();
301}
302
303void KPrViewIface::screenAssignEffect()
304{
305 view->screenAssignEffect();
306}
307
308void KPrViewIface::screenStart()
309{
310 view->screenStart();
311}
312
313void KPrViewIface::screenStartFromFirst()
314{
315 view->screenStartFromFirst();
316}
317
318void KPrViewIface::screenStop()
319{
320 view->screenStop();
321}
322
323void KPrViewIface::screenPause()
324{
325 view->screenPause();
326}
327
328void KPrViewIface::screenFirst()
329{
330 view->screenFirst();
331}
332
333void KPrViewIface::screenPrev()
334{
335 view->screenPrev();
336}
337
338void KPrViewIface::screenNext()
339{
340 view->screenNext();
341}
342
343void KPrViewIface::screenLast()
344{
345 view->screenLast();
346}
347
348void KPrViewIface::screenSkip()
349{
350 view->screenSkip();
351}
352
353void KPrViewIface::sizeSelected( int size )
354{
355 view->sizeSelected( size );
356}
357
358void KPrViewIface::fontSelected( const TQString &fontFamily )
359{
360 view->fontSelected( fontFamily );
361}
362
363void KPrViewIface::textBold()
364{
365 view->textBold();
366}
367
368void KPrViewIface::textItalic()
369{
370 view->textItalic();
371}
372
373void KPrViewIface::textUnderline()
374{
375 view->textUnderline();
376}
377
378void KPrViewIface::textColor()
379{
380 view->textColor();
381}
382
383void KPrViewIface::textAlignLeft()
384{
385 view->textAlignLeft();
386}
387
388void KPrViewIface::textAlignCenter()
389{
390 view->textAlignCenter();
391}
392
393void KPrViewIface::textAlignRight()
394{
395 view->textAlignRight();
396}
397
398void KPrViewIface::mtextFont()
399{
400 view->mtextFont();
401}
402
403void KPrViewIface::textDepthPlus()
404{
405 view->textDepthPlus();
406}
407
408void KPrViewIface::textDepthMinus()
409{
410 view->textDepthMinus();
411}
412
413void KPrViewIface::textContentsToHeight()
414{
415 view->textContentsToHeight();
416}
417
418void KPrViewIface::textObjectToContents()
419{
420 view->textObjectToContents();
421}
422
423void KPrViewIface::penChosen()
424{
425 view->penChosen();
426}
427
428void KPrViewIface::brushChosen()
429{
430 view->brushChosen();
431}
432
433int KPrViewIface::getCurrentPresPage() const
434{
435 return view->getCurrentPresPage();
436}
437
438int KPrViewIface::getCurrentPresStep() const
439{
440 return view->getCurrentPresStep();
441}
442
443int KPrViewIface::getPresStepsOfPage() const
444{
445 return view->getPresStepsOfPage();
446}
447
448int KPrViewIface::getNumPresPages() const
449{
450 return view->getNumPresPages();
451}
452
453bool KPrViewIface::gotoPresPage( int pg ) const
454{
455 return view->gotoPresPage( pg );
456}
457
458int KPrViewIface::getCurrentPageNum() const
459{
460 return view->getCurrPgNum();
461}
462
463void KPrViewIface::insertSpecialChar()
464{
465 view->insertSpecialChar();
466}
467
468void KPrViewIface::insertLink()
469{
470 view->insertLink();
471}
472
473void KPrViewIface::editCustomVars()
474{
475 view->editCustomVars();
476}
477
478void KPrViewIface::insertVariable()
479{
480 view->insertVariable();
481}
482
483void KPrViewIface::insertCustomVariable()
484{
485 view->insertCustomVariable();
486}
487
488void KPrViewIface::insertNewCustomVariable()
489{
490 view->insertNewCustomVariable();
491}
492
493void KPrViewIface::changeCaseOfText()
494{
495 view->changeCaseOfText();
496}
497
498void KPrViewIface::viewShowSideBar()
499{
500 view->viewShowSideBar();
501}
502
503void KPrViewIface::viewShowNoteBar()
504{
505 view->viewShowNoteBar();
506}
507
508void KPrViewIface::viewSlideMaster()
509{
510 view->viewSlideMaster();
511}
512
513
514void KPrViewIface::formatParagraph()
515{
516 view->formatParagraph();
517}
518
519void KPrViewIface::extraAutoFormat()
520{
521 view->extraAutoFormat();
522}
523
524void KPrViewIface::refreshAllVariable()
525{
526 view->extraAutoFormat();
527}
528
529bool KPrViewIface::skipToPage( int _num )
530{
531 //don't try to skip to a not exist page
532 if(_num>(int)view->kPresenterDoc()->getPageNums()-1)
533 return false;
534 view->skipToPage(_num);
535 return true;
536}
537
538void KPrViewIface::toolsRotate()
539{
540 view->toolsRotate();
541}
542
543void KPrViewIface::toolsZoom()
544{
545 view->toolsZoom();
546}
547
548void KPrViewIface::insertComment()
549{
550 view->insertComment();
551}
552
553void KPrViewIface::configureCompletion()
554{
555 view->configureCompletion();
556}
557
558void KPrViewIface::duplicateObj()
559{
560 view->duplicateObj();
561}
562
563void KPrViewIface::extraSendBackward()
564{
565 view->extraSendBackward();
566}
567
568void KPrViewIface::extraBringForward()
569{
570 view->extraBringForward();
571}
572
573void KPrViewIface::applyAutoFormat()
574{
575 view->applyAutoFormat();
576}
577
578void KPrViewIface::editDeSelectAll()
579{
580 view->editDeSelectAll();
581}
582
583void KPrViewIface::createStyleFromSelection()
584{
585 view->createStyleFromSelection();
586}
587
588void KPrViewIface::closeObject()
589{
590 view->closeObject();
591}
592
593void KPrViewIface::savePicture()
594{
595 view->savePicture();
596}
597
598void KPrViewIface::viewFooter()
599{
600 view->viewFooter();
601}
602
603void KPrViewIface::viewHeader()
604{
605 view->viewHeader();
606}
607
608
609// note: _nPage is the user visible 1-based page number
610// if 0 < _verbose exportPage() returns the title and notes of the page
611// if not verbose it returns an empty string
612TQStringList KPrViewIface::exportPage( int _nPage,
613 int _nWidth,
614 int _nHeight,
615 const TQString & _fileName,
616 const TQString & _format,
617 int _quality,
618 int _verbose )const
619{
620 TQStringList res;
621 // we translate the user visible 1-based page number
622 // to KPresenter's internal 0-based page number
623 const int nPage = _nPage-1;
624 if( 0 <= nPage &&
625 view &&
626 view->kPresenterDoc() &&
627 nPage < (int)view->kPresenterDoc()->getPageNums() ){
628 KPrCanvas* canvas = view->getCanvas();
629 if( canvas ){
630 if( canvas->exportPage( nPage,
631 TQMAX(8, _nWidth),
632 TQMAX(8, _nHeight),
633 KURL::fromPathOrURL( _fileName ),
634 _format.isEmpty() ? "PNG" : _format.latin1(),
635 TQMAX(-1, TQMIN(100, _quality))) ){
636 if( 0 < _verbose ){
637 KPrPage* page = view->kPresenterDoc()->pageList().at( nPage );
638 if( page ){
639 // Note: Do not i18n the following strings, they are prepared
640 // to be written to an IndeView page information file,
641 // see http://www.indeview.org for details.
642 // Note: We use the 1-based page number as fallback page title.
643 res << TQString("Name=%1")
644 .arg( page->pageTitle( TQString("Page%1").arg(_nPage) ) );
645 res << TQString("Notes=%1")
646 .arg( page->noteText() );
647 }
648 }
649 }
650 }
651 }
652 return res;
653}
654
655void KPrViewIface::insertFile()
656{
657 view->insertFile();
658}
659
660void KPrViewIface::importStyle()
661{
662 view->importStyle();
663}
664
665void KPrViewIface::backgroundPicture()
666{
667 view->backgroundPicture();
668}
669
670void KPrViewIface::insertFile( const TQString & file )
671{
672 view->insertFile( file );
673}
674
675void KPrViewIface::addWordToDictionary()
676{
677 view->addWordToDictionary();
678}
679
680void KPrViewIface::customSlideShow()
681{
682 view->customSlideShow();
683}
684
685void KPrViewIface::insertLineBreak()
686{
687 view->slotLineBreak();
688}
689
690void KPrViewIface::increaseNumberingLevel()
691{
692 view->slotIncreaseNumberingLevel();
693}
694
695void KPrViewIface::decreaseNumberingLevel()
696{
697 view->slotDecreaseNumberingLevel();
698}
699
700void KPrViewIface::increaseFontSize()
701{
702 view->increaseFontSize();
703}
704
705void KPrViewIface::decreaseFontSize()
706{
707 view->decreaseFontSize();
708}
709
710void KPrViewIface::flipHorizontal()
711{
712 view->flipHorizontal();
713}
714
715void KPrViewIface::flipVertical()
716{
717 view->flipVertical();
718}
Class KPCanvas - There is a single instance of this class for a given view.
Definition KPrCanvas.h:82
bool exportPage(int nPage, int nWidth, int nHeight, const KURL &fileURL, const char *format, int quality=-1)