~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kpresenter/KPresenterViewIface.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

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