kpresenter

KPrViewIface.cpp

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #include "KPrViewIface.h"
00022 
00023 #include "KPrView.h"
00024 #include "KPrCanvas.h"
00025 #include "KPrPage.h"
00026 #include "KPrDocument.h"
00027 
00028 #include <kapplication.h>
00029 #include <dcopclient.h>
00030 
00031 KPrViewIface::KPrViewIface( KPrView *view_ )
00032     : KoViewIface( view_ )
00033 {
00034     view = view_;
00035 }
00036 
00037 void KPrViewIface::editCut()
00038 {
00039     view->editCut();
00040 }
00041 
00042 void KPrViewIface::editCopy()
00043 {
00044     view->editCopy();
00045 }
00046 
00047 void KPrViewIface::editPaste()
00048 {
00049     view->editPaste();
00050 }
00051 
00052 void KPrViewIface::editDelete()
00053 {
00054     view->editDelete();
00055 }
00056 
00057 void KPrViewIface::editSelectAll()
00058 {
00059     view->editSelectAll();
00060 }
00061 
00062 void KPrViewIface::editDuplicatePage()
00063 {
00064     view->editDuplicatePage();
00065 }
00066 
00067 void KPrViewIface::editDelPage()
00068 {
00069     view->editDelPage();
00070 }
00071 
00072 void KPrViewIface::editFind()
00073 {
00074     view->editFind();
00075 }
00076 
00077 void KPrViewIface::editReplace()
00078 {
00079     view->editReplace();
00080 }
00081 
00082 void KPrViewIface::newView()
00083 {
00084     view->newView();
00085 }
00086 
00087 void KPrViewIface::insertPage()
00088 {
00089     view->insertPage();
00090 }
00091 
00092 void KPrViewIface::insertPicture()
00093 {
00094     view->insertPicture();
00095 }
00096 
00097 void KPrViewIface::toolsMouse()
00098 {
00099     view->toolsMouse();
00100 }
00101 
00102 void KPrViewIface::toolsLine()
00103 {
00104     view->toolsLine();
00105 }
00106 
00107 void KPrViewIface::toolsRectangle()
00108 {
00109     view->toolsRectangle();
00110 }
00111 
00112 void KPrViewIface::toolsCircleOrEllipse()
00113 {
00114     view->toolsCircleOrEllipse();
00115 }
00116 
00117 void KPrViewIface::toolsPie()
00118 {
00119     view->toolsPie();
00120 }
00121 
00122 void KPrViewIface::toolsText()
00123 {
00124     view->toolsText();
00125 }
00126 
00127 void KPrViewIface::toolsAutoform()
00128 {
00129     view->toolsAutoform();
00130 }
00131 
00132 void KPrViewIface::toolsDiagramm()
00133 {
00134     view->toolsDiagramm();
00135 }
00136 
00137 void KPrViewIface::toolsTable()
00138 {
00139     view->toolsTable();
00140 }
00141 
00142 void KPrViewIface::toolsFormula()
00143 {
00144     view->toolsFormula();
00145 }
00146 
00147 void KPrViewIface::toolsObject()
00148 {
00149     view->toolsObject();
00150 }
00151 
00152 void KPrViewIface::toolsFreehand()
00153 {
00154     view->toolsFreehand();
00155 }
00156 
00157 void KPrViewIface::toolsPolyline()
00158 {
00159     view->toolsPolyline();
00160 }
00161 
00162 void KPrViewIface::toolsQuadricBezierCurve()
00163 {
00164     view->toolsQuadricBezierCurve();
00165 }
00166 
00167 void KPrViewIface::toolsCubicBezierCurve()
00168 {
00169     view->toolsCubicBezierCurve();
00170 }
00171 
00172 void KPrViewIface::toolsConvexOrConcavePolygon()
00173 {
00174     view->toolsConvexOrConcavePolygon();
00175 }
00176 
00177 void KPrViewIface::extraPenBrush()
00178 {
00179     view->extraProperties();
00180 }
00181 
00182 void KPrViewIface::extraProperties()
00183 {
00184     view->extraProperties();
00185 }
00186 
00187 void KPrViewIface::extraRaise()
00188 {
00189     view->extraRaise();
00190 }
00191 
00192 void KPrViewIface::extraLower()
00193 {
00194     view->extraLower();
00195 }
00196 
00197 void KPrViewIface::extraRotate()
00198 {
00199     view->extraRotate();
00200 }
00201 
00202 void KPrViewIface::extraShadow()
00203 {
00204     view->extraShadow();
00205 }
00206 
00207 void KPrViewIface::extraBackground()
00208 {
00209     view->extraBackground();
00210 }
00211 
00212 void KPrViewIface::extraLayout()
00213 {
00214     view->extraLayout();
00215 }
00216 
00217 void KPrViewIface::extraConfigure()
00218 {
00219     view->extraConfigure();
00220 }
00221 
00222 void KPrViewIface::extraLineBegin()
00223 {
00224     view->extraLineBegin();
00225 }
00226 
00227 void KPrViewIface::extraLineEnd()
00228 {
00229     view->extraLineEnd();
00230 }
00231 
00232 void KPrViewIface::extraWebPres()
00233 {
00234     view->extraWebPres();
00235 }
00236 
00237 void KPrViewIface::extraMSPres()
00238 {
00239     view->extraMSPres();
00240 }
00241 
00242 void KPrViewIface::extraAlignObjLeft()
00243 {
00244     view->extraAlignObjLeft();
00245 }
00246 
00247 void KPrViewIface::extraAlignObjCenterH()
00248 {
00249     view->extraAlignObjCenterH();
00250 }
00251 
00252 void KPrViewIface::extraAlignObjRight()
00253 {
00254     view->extraAlignObjRight();
00255 }
00256 
00257 void KPrViewIface::extraAlignObjTop()
00258 {
00259     view->extraAlignObjTop();
00260 }
00261 
00262 void KPrViewIface::extraAlignObjCenterV()
00263 {
00264     view->extraAlignObjCenterV();
00265 }
00266 
00267 void KPrViewIface::extraAlignObjBottom()
00268 {
00269     view->extraAlignObjBottom();
00270 }
00271 
00272 void KPrViewIface::extraGroup()
00273 {
00274     view->extraGroup();
00275 }
00276 
00277 void KPrViewIface::extraUnGroup()
00278 {
00279     view->extraUnGroup();
00280 }
00281 
00282 void KPrViewIface::extraPenStyle()
00283 {
00284 // FIXME
00285 //     view->extraPenStyle();
00286 }
00287 
00288 void KPrViewIface::extraPenWidth()
00289 {
00290 // FIXME
00291 //     view->extraPenWidth();
00292 }
00293 
00294 void KPrViewIface::screenTransEffect()
00295 {
00296     view->screenTransEffect();
00297 }
00298 
00299 void KPrViewIface::screenConfigPages()
00300 {
00301     view->screenConfigPages();
00302 }
00303 
00304 void KPrViewIface::screenAssignEffect()
00305 {
00306     view->screenAssignEffect();
00307 }
00308 
00309 void KPrViewIface::screenStart()
00310 {
00311     view->screenStart();
00312 }
00313 
00314 void KPrViewIface::screenStartFromFirst()
00315 {
00316     view->screenStartFromFirst();
00317 }
00318 
00319 void KPrViewIface::screenStop()
00320 {
00321     view->screenStop();
00322 }
00323 
00324 void KPrViewIface::screenPause()
00325 {
00326     view->screenPause();
00327 }
00328 
00329 void KPrViewIface::screenFirst()
00330 {
00331     view->screenFirst();
00332 }
00333 
00334 void KPrViewIface::screenPrev()
00335 {
00336     view->screenPrev();
00337 }
00338 
00339 void KPrViewIface::screenNext()
00340 {
00341     view->screenNext();
00342 }
00343 
00344 void KPrViewIface::screenLast()
00345 {
00346     view->screenLast();
00347 }
00348 
00349 void KPrViewIface::screenSkip()
00350 {
00351     view->screenSkip();
00352 }
00353 
00354 void KPrViewIface::sizeSelected( int size )
00355 {
00356     view->sizeSelected( size );
00357 }
00358 
00359 void KPrViewIface::fontSelected( const QString &fontFamily )
00360 {
00361     view->fontSelected( fontFamily );
00362 }
00363 
00364 void KPrViewIface::textBold()
00365 {
00366     view->textBold();
00367 }
00368 
00369 void KPrViewIface::textItalic()
00370 {
00371     view->textItalic();
00372 }
00373 
00374 void KPrViewIface::textUnderline()
00375 {
00376     view->textUnderline();
00377 }
00378 
00379 void KPrViewIface::textColor()
00380 {
00381     view->textColor();
00382 }
00383 
00384 void KPrViewIface::textAlignLeft()
00385 {
00386     view->textAlignLeft();
00387 }
00388 
00389 void KPrViewIface::textAlignCenter()
00390 {
00391     view->textAlignCenter();
00392 }
00393 
00394 void KPrViewIface::textAlignRight()
00395 {
00396     view->textAlignRight();
00397 }
00398 
00399 void KPrViewIface::mtextFont()
00400 {
00401     view->mtextFont();
00402 }
00403 
00404 void KPrViewIface::textDepthPlus()
00405 {
00406     view->textDepthPlus();
00407 }
00408 
00409 void KPrViewIface::textDepthMinus()
00410 {
00411     view->textDepthMinus();
00412 }
00413 
00414 void KPrViewIface::textContentsToHeight()
00415 {
00416     view->textContentsToHeight();
00417 }
00418 
00419 void KPrViewIface::textObjectToContents()
00420 {
00421     view->textObjectToContents();
00422 }
00423 
00424 void KPrViewIface::penChosen()
00425 {
00426     view->penChosen();
00427 }
00428 
00429 void KPrViewIface::brushChosen()
00430 {
00431     view->brushChosen();
00432 }
00433 
00434 int KPrViewIface::getCurrentPresPage() const
00435 {
00436     return view->getCurrentPresPage();
00437 }
00438 
00439 int KPrViewIface::getCurrentPresStep() const
00440 {
00441     return view->getCurrentPresStep();
00442 }
00443 
00444 int KPrViewIface::getPresStepsOfPage() const
00445 {
00446     return view->getPresStepsOfPage();
00447 }
00448 
00449 int KPrViewIface::getNumPresPages() const
00450 {
00451     return view->getNumPresPages();
00452 }
00453 
00454 bool KPrViewIface::gotoPresPage( int pg ) const
00455 {
00456     return view->gotoPresPage( pg );
00457 }
00458 
00459 int KPrViewIface::getCurrentPageNum() const
00460 {
00461     return view->getCurrPgNum();
00462 }
00463 
00464 void KPrViewIface::insertSpecialChar()
00465 {
00466     view->insertSpecialChar();
00467 }
00468 
00469 void KPrViewIface::insertLink()
00470 {
00471     view->insertLink();
00472 }
00473 
00474 void KPrViewIface::editCustomVars()
00475 {
00476     view->editCustomVars();
00477 }
00478 
00479 void KPrViewIface::insertVariable()
00480 {
00481     view->insertVariable();
00482 }
00483 
00484 void KPrViewIface::insertCustomVariable()
00485 {
00486     view->insertCustomVariable();
00487 }
00488 
00489 void KPrViewIface::insertNewCustomVariable()
00490 {
00491     view->insertNewCustomVariable();
00492 }
00493 
00494 void KPrViewIface::changeCaseOfText()
00495 {
00496     view->changeCaseOfText();
00497 }
00498 
00499 void KPrViewIface::viewShowSideBar()
00500 {
00501     view->viewShowSideBar();
00502 }
00503 
00504 void KPrViewIface::viewShowNoteBar()
00505 {
00506     view->viewShowNoteBar();
00507 }
00508 
00509 void KPrViewIface::viewSlideMaster()
00510 {
00511     view->viewSlideMaster();
00512 }
00513 
00514 
00515 void KPrViewIface::formatParagraph()
00516 {
00517     view->formatParagraph();
00518 }
00519 
00520 void KPrViewIface::extraAutoFormat()
00521 {
00522     view->extraAutoFormat();
00523 }
00524 
00525 void KPrViewIface::refreshAllVariable()
00526 {
00527     view->extraAutoFormat();
00528 }
00529 
00530 bool KPrViewIface::skipToPage( int _num )
00531 {
00532     //don't try to skip to a not exist page
00533     if(_num>(int)view->kPresenterDoc()->getPageNums()-1)
00534         return false;
00535     view->skipToPage(_num);
00536     return true;
00537 }
00538 
00539 void KPrViewIface::toolsRotate()
00540 {
00541     view->toolsRotate();
00542 }
00543 
00544 void KPrViewIface::toolsZoom()
00545 {
00546     view->toolsZoom();
00547 }
00548 
00549 void KPrViewIface::insertComment()
00550 {
00551     view->insertComment();
00552 }
00553 
00554 void KPrViewIface::configureCompletion()
00555 {
00556     view->configureCompletion();
00557 }
00558 
00559 void KPrViewIface::duplicateObj()
00560 {
00561     view->duplicateObj();
00562 }
00563 
00564 void KPrViewIface::extraSendBackward()
00565 {
00566     view->extraSendBackward();
00567 }
00568 
00569 void KPrViewIface::extraBringForward()
00570 {
00571     view->extraBringForward();
00572 }
00573 
00574 void KPrViewIface::applyAutoFormat()
00575 {
00576     view->applyAutoFormat();
00577 }
00578 
00579 void KPrViewIface::editDeSelectAll()
00580 {
00581     view->editDeSelectAll();
00582 }
00583 
00584 void KPrViewIface::createStyleFromSelection()
00585 {
00586     view->createStyleFromSelection();
00587 }
00588 
00589 void KPrViewIface::closeObject()
00590 {
00591     view->closeObject();
00592 }
00593 
00594 void KPrViewIface::savePicture()
00595 {
00596     view->savePicture();
00597 }
00598 
00599 void KPrViewIface::viewFooter()
00600 {
00601     view->viewFooter();
00602 }
00603 
00604 void KPrViewIface::viewHeader()
00605 {
00606     view->viewHeader();
00607 }
00608 
00609 
00610 // note: _nPage is the user visible 1-based page number
00611 // if 0 < _verbose exportPage() returns the title and notes of the page
00612 // if not verbose it returns an empty string
00613 QStringList KPrViewIface::exportPage( int _nPage,
00614                                              int _nWidth,
00615                                              int _nHeight,
00616                                              const QString & _fileName,
00617                                              const QString & _format,
00618                                              int _quality,
00619                                              int _verbose )const
00620 {
00621     QStringList res;
00622     // we translate the user visible 1-based page number
00623     // to KPresenter's internal 0-based page number
00624     const int nPage = _nPage-1;
00625     if( 0 <= nPage &&
00626         view &&
00627         view->kPresenterDoc() &&
00628         nPage < (int)view->kPresenterDoc()->getPageNums() ){
00629         KPrCanvas* canvas = view->getCanvas();
00630         if( canvas ){
00631             if( canvas->exportPage( nPage,
00632                                     QMAX(8, _nWidth),
00633                                     QMAX(8, _nHeight),
00634                                     KURL::fromPathOrURL( _fileName ),
00635                                     _format.isEmpty() ? "PNG" : _format.latin1(),
00636                                     QMAX(-1, QMIN(100, _quality))) ){
00637                 if( 0 < _verbose ){
00638                     KPrPage* page = view->kPresenterDoc()->pageList().at( nPage );
00639                     if( page ){
00640                         // Note: Do not i18n the following strings, they are prepared
00641                         //       to be written to an IndeView page information file,
00642                         //       see http://www.indeview.org for details.
00643                         // Note: We use the 1-based page number as fallback page title.
00644                         res << QString("Name=%1")
00645                                 .arg( page->pageTitle( QString("Page%1").arg(_nPage) ) );
00646                         res << QString("Notes=%1")
00647                                 .arg( page->noteText() );
00648                     }
00649                 }
00650             }
00651         }
00652     }
00653     return res;
00654 }
00655 
00656 void KPrViewIface::insertFile()
00657 {
00658     view->insertFile();
00659 }
00660 
00661 void KPrViewIface::importStyle()
00662 {
00663     view->importStyle();
00664 }
00665 
00666 void KPrViewIface::backgroundPicture()
00667 {
00668     view->backgroundPicture();
00669 }
00670 
00671 void KPrViewIface::insertFile( const QString & file )
00672 {
00673     view->insertFile( file );
00674 }
00675 
00676 void KPrViewIface::addWordToDictionary()
00677 {
00678     view->addWordToDictionary();
00679 }
00680 
00681 void KPrViewIface::customSlideShow()
00682 {
00683     view->customSlideShow();
00684 }
00685 
00686 void KPrViewIface::insertLineBreak()
00687 {
00688     view->slotLineBreak();
00689 }
00690 
00691 void KPrViewIface::increaseNumberingLevel()
00692 {
00693     view->slotIncreaseNumberingLevel();
00694 }
00695 
00696 void KPrViewIface::decreaseNumberingLevel()
00697 {
00698     view->slotDecreaseNumberingLevel();
00699 }
00700 
00701 void KPrViewIface::increaseFontSize()
00702 {
00703     view->increaseFontSize();
00704 }
00705 
00706 void KPrViewIface::decreaseFontSize()
00707 {
00708     view->decreaseFontSize();
00709 }
00710 
00711 void KPrViewIface::flipHorizontal()
00712 {
00713     view->flipHorizontal();
00714 }
00715 
00716 void KPrViewIface::flipVertical()
00717 {
00718     view->flipVertical();
00719 }
KDE Home | KDE Accessibility Home | Description of Access Keys