kpresenter

KPrView.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003    Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@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 #ifndef kpresenter_view_h
00022 #define kpresenter_view_h
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027 
00028 #include <qguardedptr.h>
00029 #include <qtimer.h>
00030 #include <qdatetime.h>
00031 
00032 #include <KoView.h>
00033 #include "global.h"
00034 #include <KoBrush.h>
00035 #include <KoPen.h>
00036 #include <KoRuler.h>
00037 
00038 class QPopupMenu;
00039 class QSplitter;
00040 class QLabel;
00041 class DCOPObject;
00042 class KPrView;
00043 class KPrBackDialog;
00044 class KoRuler;
00045 class QScrollBar;
00046 class AFChoose;
00047 class KPrPropertyEditor;
00048 class KPrPgConfDia;
00049 class KPrSlideTransitionDia;
00050 class KPrRotationDialogImpl;
00051 class KPrShadowDialogImpl;
00052 class KPrImageEffectDia;
00053 class ConfPieDia;
00054 class ConfRectDia;
00055 class ConfPolygonDia;
00056 class ConfPictureDia;
00057 class KPrPresDurationDia;
00058 class QToolButton;
00059 class KPrSideBar;
00060 class KPrNoteBar;
00061 
00062 class KAction;
00063 class KActionMenu;
00064 class KToggleAction;
00065 class TKSelectColorAction;
00066 class KoPartSelectAction;
00067 class KoPicture;
00068 class KoParagStyle;
00069 class KoLineStyleAction;
00070 class KoLineWidthAction;
00071 class KoRect;
00072 
00073 class KoCharSelectDia;
00074 class KoTextFormat;
00075 class KoTextObject;
00076 class KoTextZoomHandler;
00077 
00078 class KCommand;
00079 class KMacroCommand;
00080 class KFontSizeAction;
00081 class KColorAction;
00082 class KSelectAction;
00083 class KFontAction;
00084 class KoParagCounter;
00085 class KActionMenu;
00086 class KoSearchContext;
00087 class KPrFindReplace;
00088 class KPrCanvas;
00089 class KoFontDia;
00090 class KoParagDia;
00091 class KPrObject;
00092 class KPrPixmapObject;
00093 class KPrDocument;
00094 class KPrPage;
00095 class KPrTextObject;
00096 class KoTextIterator;
00097 class KStatusBarLabel;
00098 
00099 class KoSpell;
00100 #include <kspell2/broker.h>
00101 namespace KSpell2 {
00102     class Dialog;
00103 }
00104 
00105 class PageBase : public QWidget
00106 {
00107 public:
00108     PageBase( QWidget *parent, KPrView *v ) : QWidget( parent ), view( v ) {}
00109     void resizeEvent( QResizeEvent *e );
00110 
00111 private:
00112     KPrView *view;
00113 
00114 };
00115 
00116 
00117 class KPrView : public KoView
00118 {
00119     friend class PageBase;
00120     Q_OBJECT
00121 
00122 public:
00123     KPrView( KPrDocument* _doc, QWidget *_parent = 0, const char *_name = 0 );
00124     ~KPrView();
00125 
00126     void initGui();
00127     virtual DCOPObject* dcopObject();
00128 
00129     // for dcop interface
00130     int getCurrentPresPage() const;
00131     int getCurrentPresStep() const;
00132     int getPresStepsOfPage() const;
00133     int getNumPresPages() const;
00134     bool gotoPresPage( int pg );
00135 
00136     virtual void setupPrinter( KPrinter &printer );
00137     virtual void print( KPrinter &printer );
00138 
00139     void showFormat( const KoTextFormat &format );
00140 
00141     void showZoom( int zoom ); // show a zoom value in the combo
00142     void setZoom( int zoom, bool updateViews ); // change the zoom value
00143     void changeZoomMenu( int zoom=-1);
00144     void showStyle( const QString & styleName );
00145     void updateStyleList();
00146 
00147     KoTextZoomHandler *zoomHandler() const;
00148 
00149     //used this function when we when to print/create web presentation etc...
00150     //=>we unzoom it.
00151     void unZoomDocument(int &dpiX,int &dpiY);
00152     void zoomDocument(int zoom);
00153 
00154     //refresh footer/header button when we make undo/redo show/hide header/footer
00155     void updateHeaderFooterButton();
00156     void updateDisplayObjectMasterPageButton();
00157 
00158     void updateDisplayBackgroundButton();
00159     virtual int leftBorder() const { return canvas()->mapTo(const_cast<KPrView *>(this), QPoint(0,0)).x(); };
00160     virtual int rightBorder() const { return width() - canvas()->mapTo(const_cast<KPrView *>(this), QPoint(canvas()->width(), 0)).x(); };
00161     virtual int topBorder() const { return canvas()->mapTo(const_cast<KPrView *>(this), QPoint(0,0)).y(); };
00162     virtual int bottomBorder() const { return height() - canvas()->mapTo(const_cast<KPrView *>(this), QPoint(0, canvas()->height())).y(); };
00163 
00164     void updateGuideLineButton();
00165 
00166     void updateGridButton();
00167     void savePicture( const QString& oldName, KoPicture& picture);
00168     void savePicture( KPrPixmapObject* obj );
00169 
00170     void insertFile(const QString &path);
00171     void testAndCloseAllTextObjectProtectedContent();
00172     void updateRulerInProtectContentMode();
00173     QPtrList<KAction> listOfResultOfCheckWord( const QString &word );
00174 
00178     KSpell2::Broker *broker() const;
00179     bool editMaster() const { return m_editMaster;}
00180 
00181 signals:
00182     void currentPageChanged( int );
00183     void presentationFinished();
00184 
00185 public slots:
00186     // edit menu
00187     void editCut();
00188     void editCopy();
00189     void editPaste();
00190     void editDelete();
00191     void editSelectAll();
00192     void editDeSelectAll();
00193     void editCopyPage();
00194     void editDuplicatePage();
00195     void editDelPage();
00196     void editFind();
00197     void editReplace();
00198 
00199     // view menu
00200     void viewShowSideBar();
00201     void viewShowNoteBar();
00202     void viewSlideMaster();
00203     void viewZoom( const QString &s );
00204 
00205     void viewFooter();
00206     void viewHeader();
00207     void insertComment();
00208     void editComment();
00209 
00210     void viewGuideLines();
00211 
00212     void viewGrid();
00213 
00214     void viewSnapToGrid();
00215 
00216     // insert menu
00217     void insertPage();
00218     void insertPicture();
00219     void insertPicture(const QString &file);
00220     void insertSpecialChar();
00221 
00222     // tools menu
00223     void toolsMouse();
00224     void toolsRotate();
00225     void toolsZoom();
00226     void toolsLine();
00227     void toolsLinePopup();
00228     void toolsShapePopup();
00229     void toolsRectangle();
00230     void toolsCircleOrEllipse();
00231     void toolsPie();
00232     void toolsText();
00233     void toolsAutoform();
00234     void toolsDiagramm();
00235     void toolsTable();
00236     void toolsFormula();
00237     void toolsObject();
00238     void toolsFreehand();
00239     void toolsPolyline();
00240     void toolsQuadricBezierCurve();
00241     void toolsCubicBezierCurve();
00242     void toolsConvexOrConcavePolygon();
00243     void toolsClosedLinePopup();
00244     void toolsClosedFreehand();
00245     void toolsClosedPolyline();
00246     void toolsClosedQuadricBezierCurve();
00247     void toolsClosedCubicBezierCurve();
00248 
00249     // extra menu
00250     void extraProperties();
00251     void extraRaise();
00252     void extraLower();
00253     void extraRotate();
00254     void extraSendBackward();
00255     void extraBringForward();
00256     void extraArrangePopup();
00257 
00258     void extraShadow();
00259     void extraBackground();
00260     void extraLayout();
00261     void extraConfigure();
00262     void extraLineBegin();
00263     void extraLineEnd();
00264     void extraWebPres();
00265     void extraMSPres();
00266     void extraCreateTemplate();
00267     void extraDefaultTemplate();
00268     void extraGroup();
00269     void extraUnGroup();
00270     void extraPenStyle( int newStyle );
00271     void extraPenWidth( double newWidth );
00272 
00273     void configureCompletion();
00274 
00275     void extraAlignObjLeft();
00276     void extraAlignObjCenterH();
00277     void extraAlignObjRight();
00278     void extraAlignObjTop();
00279     void extraAlignObjCenterV();
00280     void extraAlignObjBottom();
00281 
00282     // screen menu
00283     void screenConfigPages();
00284     void screenAssignEffect();
00285     void screenTransEffect();
00286     void screenStart();
00287     void screenStartFromFirst();
00288     void screenStop();
00289     void screenPause();
00290     void screenFirst();
00296     void screenPrev( bool gotoPreviousPage = false );
00302     void screenNext( bool gotoNextPage = false );
00303     void screenLast();
00304     void screenSkip();
00305 
00306     // text toolbar
00307     void sizeSelected( int size );
00308     void fontSelected( const QString &fontFamily );
00309     void textBold();
00310     void textItalic();
00311     void textUnderline();
00312     void textStrikeOut();
00313     void textColor();
00314     void textAlignLeft();
00315     void textAlignCenter();
00316     void textAlignRight();
00317     void textAlignBlock();
00318     void mtextFont();
00319 
00320     void slotCounterStyleSelected();
00321 
00322     void textDepthPlus();
00323     void textDepthMinus();
00324     void textContentsToHeight();
00325     void textObjectToContents();
00326     void textInsertPageNum();
00327     void textDefaultFormat();
00328 
00329     // color bar
00330     void penChosen();
00331     void brushChosen();
00332 
00333     void skipToPage( int _num );
00334     void nextPage();
00335     void prevPage();
00336 
00340     void updateSideBarItem( KPrPage * page );
00341     void addSideBarItem( int pos );
00342     void moveSideBarItem( int oldPos, int newPos );
00343     void removeSideBarItem( int pos );
00344 
00345     //statusbar updates
00346     void updatePageInfo();
00347     void updateObjectStatusBarItem();
00348     void pageNumChanged();
00349     void updateSideBarMenu();
00350 
00351     void objectSelectedChanged();
00352 
00353     void renamePageTitle();
00354 
00355     void picViewOriginalSize();
00356     void picViewOrig640x480();
00357     void picViewOrig800x600();
00358     void picViewOrig1024x768();
00359     void picViewOrig1280x1024();
00360     void picViewOrig1600x1200();
00361 
00362     void chPic();
00363     void imageEffect();
00364 
00365     void textSubScript();
00366     void textSuperScript();
00367 
00368     void slotSpecialChar(QChar, const QString &);
00369     void slotSpecialCharDlgClosed();
00370 
00371     void insertLink();
00372     void changeLink();
00373     void copyLink();
00374     void removeLink();
00375     void addToBookmark();
00376     void slotSoftHyphen();
00377     void slotNonbreakingSpace();
00378     void slotNonbreakingHyphen();
00379     void slotLineBreak();
00380     void slotIncreaseNumberingLevel();
00381     void slotDecreaseNumberingLevel();
00382 
00383     void extraAutoFormat();
00384     void slotSpellCheck();
00385 
00386 
00387     void spellCheckerDone( const QString & );
00388     void spellCheckerCancel();
00389     void startKSpell();
00390     void spellAddAutoCorrect (const QString & originalword, const QString & newword);
00391     void spellCheckerMisspelling( const QString &, int );
00392     void spellCheckerCorrected( const QString &, int, const QString & );
00393     void alignChanged( int );
00394 
00395     void formatParagraph();
00396     void changeNbOfRecentFiles(int _nb);
00397 
00398     void insertVariable();
00399 
00400     void insertCustomVariable();
00401     void insertNewCustomVariable();
00402     void refreshCustomMenu();
00403 
00404     void editCustomVars ();
00405     void openLink();
00406 
00407     void increaseFontSize();
00408     void decreaseFontSize();
00409 
00410     void tabListChanged( const KoTabulatorList & tabList );
00411 
00412     void newLeftIndent( double _leftIndent);
00413     void newFirstIndent( double _firstIndent);
00414     void newRightIndent( double _rightIndent);
00415     void slotUpdateRuler();
00416 
00417     void slotHRulerDoubleClicked( double ptpos );
00418     void slotHRulerDoubleClicked();
00419 
00420     void changeCaseOfText();
00421     void slotStyleSelected();
00422     void textStyleSelected( int );
00423     void extraStylist();
00424 
00425     void slotAllowAutoFormat();
00426 
00427     void slotCompletion();
00428 
00429     void removeComment();
00430     void copyTextOfComment();
00431 
00432     //zoom menu
00433     void zoomMinus();
00434     void zoomPageWidth();
00435     void zoomEntirePage();
00436     void zoomPlus();
00437     void zoomSelectedObject();
00438     void zoomPageHeight();
00439     void zoomAllObject();
00440 
00441     void flipHorizontal();
00442     void flipVertical();
00443     void closeObject();
00444 
00445     void duplicateObj();
00446     void applyAutoFormat();
00447     void createStyleFromSelection();
00448 
00449     void alignVerticalTop();
00450     void alignVerticalBottom();
00451     void alignVerticalCenter();
00452 
00453 
00454     void savePicture();
00455     void autoSpellCheck();
00456 
00457     void insertFile();
00458     void editCustomVariable();
00459     void importStyle();
00460 
00461     void backgroundPicture();
00462     void updateBgSpellCheckingState();
00463     void updatePresentationButton(bool);
00464     void refreshGroupButton();
00465     void slotAddIgnoreAllWord();
00466     void addWordToDictionary();
00467     void customSlideShow();
00468 
00469     void displayObjectFromMasterPage();
00470     void displayBackground();
00471     void slotUnitChanged(KoUnit::Unit);
00472     void documentModified( bool );
00473 
00474 public:
00475     // create GUI
00476     virtual void createGUI();
00477 
00478     // get current pagenum, 1-based
00479     unsigned int getCurrPgNum() const;
00484     void recalcCurrentPageNum();
00485 
00486     // return pointer to document
00487     KPrDocument *kPresenterDoc() const {return m_pKPresenterDoc; }
00488 
00489     // properties
00490     void changePicture( const QString & );
00491 
00492     KPrCanvas* getCanvas() const { return m_canvas;}
00493 
00494     void setRulerMouseShow( bool _show );
00495     void setRulerMousePos( int mx, int my );
00496 
00497     // set scrollbar ranges
00498     void setRanges();
00499 
00500     KoRuler *getHRuler() const { return h_ruler; }
00501     KoRuler *getVRuler() const { return v_ruler; }
00502     KoTabChooser *getTabChooser() const { return tabChooser; }
00503     QScrollBar *getHScrollBar() const { return horz; }
00504     QScrollBar *getVScrollBar() const { return vert; }
00505 
00514     void showObjectRect( const KPrObject * object );
00515 
00516     PieType getPieType() const { return pieType; }
00517     int getPieAngle() const { return pieAngle; }
00518     int getPieLength() const { return pieLength; }
00519     KoPen getPen() const { return pen; }
00520     QBrush getBrush() const { return brush; }
00521     LineEnd getLineBegin() const { return lineBegin; }
00522     LineEnd getLineEnd() const{ return lineEnd; }
00523     QColor getGColor1() const { return gColor1; }
00524     QColor getGColor2() const { return gColor2; }
00525     BCType getGType() const { return gType; }
00526     FillType getFillType() const { return fillType; }
00527     bool getGUnbalanced() const { return gUnbalanced; }
00528     int getGXFactor() const { return gXFactor; }
00529     int getGYFactor() const { return gYFactor; }
00530     TKSelectColorAction* getActionBrushColor() const { return actionBrushColor; }
00531     TKSelectColorAction* getActionPenColor() const { return actionPenColor; }
00532 
00533     void setPieType(PieType _pieType) { pieType = _pieType; }
00534     void setPieAngle(int _pieAngle) { pieAngle = _pieAngle; }
00535     void setPieLength(int _pieLength) { pieLength = _pieLength; }
00536     void setPen(KoPen _pen) { pen = _pen; }
00537     void setBrush(QBrush _brush) { brush = _brush; }
00538     void setLineBegin(LineEnd _lineBegin) { lineBegin = _lineBegin; }
00539     void setLineEnd(LineEnd _lineEnd){ lineEnd = _lineEnd; }
00540     void setGColor1(QColor _gColor1) { gColor1 = _gColor1; }
00541     void setGColor2(QColor _gColor2) { gColor2 = _gColor2; }
00542     void setGType(BCType _gType) { gType = _gType; }
00543     void setFillType(FillType _fillType) { fillType = _fillType; }
00544     void setGUnbalanced(bool _gUnbalanced) { gUnbalanced = _gUnbalanced; }
00545     void setGXFactor(int _gXFactor) { gXFactor = _gXFactor; }
00546     void setGYFactor(int _gYFactor) { gYFactor = _gYFactor; }
00547 
00548     void setTool( ToolEditMode toolEditMode );
00549 
00550     int getRndX() const { return rndX; }
00551     int getRndY() const { return rndY; }
00552 
00553     void setRndX(int _rndX) { rndX = _rndX; }
00554     void setRndY(int _rndY) { rndY = _rndY; }
00555 
00556 //     QFont &currFont() { return tbFont; }
00557 //     QColor &currColor() { return tbColor; }
00558 
00559     void enableWebPres();
00560     void enableMSPres();
00561 
00565     bool doubleClickActivation() const;
00569     QWidget* canvas() const;
00573     int canvasXOffset() const;
00577     int canvasYOffset() const;
00578 
00582     void updateSideBar();
00583 
00584     void refreshPageButton();
00585 
00586     void setCanvasXOffset( int _x );
00587     void setCanvasYOffset( int _y );
00588 
00589     void openPopupMenuObject( const QString & name , const QPoint & _point );
00590     void openPopupMenuMenuPage( const QPoint & _point );
00591     void openPopupMenuSideBar(const QPoint & _point);
00592 
00593     void openPopupMenuZoom( const QPoint & _point );
00594 
00595     void penColorChanged( const KoPen & _pen );
00596     void brushColorChanged( const QBrush & _brush );
00597 
00602     void restartAutoPresTimer();
00603 
00608     void continueAutoPresTimer();
00609 
00614     void stopAutoPresTimer();
00615 
00620     void setAutoPresTimer( int sec );
00621 
00622     void showCounter( KoParagCounter &c );
00623 
00624     QPopupMenu * popupMenu( const QString& name );
00625 
00626     void showRulerIndent( double _leftMargin, double _firstLine, double _rightMargin, bool rtl );
00627 
00628     void reorganize();
00629 
00630     // For KPrNoteBar
00631     KPrNoteBar *getNoteBar() const { return notebar; }
00632 
00633     // Used by Page to plug/unplug the datatool actions
00634     QPtrList<KAction>& actionList() { return m_actionList; }
00635     // Used by Page to plug/unplug the variable actions
00636     QPtrList<KAction> &variableActionList() { return m_variableActionList; }
00637 
00638     // for Polygon object
00639     bool getCheckConcavePolygon() const { return checkConcavePolygon; }
00640     int getCornersValue() const { return cornersValue; }
00641     int getSharpnessValue() const { return sharpnessValue; }
00642 
00643     void setCheckConcavePolygon(bool _concavePolygon) { checkConcavePolygon = _concavePolygon; }
00644     void setCornersValue(int _cornersValue) { cornersValue = _cornersValue; }
00645     void setSharpnessValue(int _sharpnessValue) { sharpnessValue = _sharpnessValue; }
00646 
00647     // for Picture Object
00648     PictureMirrorType getPictureMirrorType() const { return mirrorType; }
00649     int getPictureDepth() const { return depth; }
00650     bool getPictureSwapRGB() const { return swapRGB; }
00651     bool getPictureGrayscal() const { return grayscal; }
00652     int getPictureBright() const { return bright; }
00653 
00659     void setPageDuration( int _pgNum );
00660 
00666     void setZoomRect( const KoRect & rect );
00667     void changeVerticalAlignmentStatus(VerticalAlignmentType _type );
00668 
00669     void closeTextObject();
00670     void deSelectAllObjects();
00671 
00672     void insertDirectCursor(bool b);
00673     void updateDirectCursorButton();
00674 
00675     void setEditMaster( bool editMaster );
00676 
00677 protected slots:
00678     // dialog slots
00679     void backOk( KPrBackDialog*, bool );
00680     void afChooseOk( const QString & );
00681     void slotAfchooseCanceled();
00682     void propertiesOk();
00683     void pgConfOk();
00684     void rotateOk();
00685     void shadowOk();
00686     void pddClosed();
00687 
00688     // scrolling
00689     void scrollH( int );
00690     void scrollV( int );
00691 
00692     // textobject
00693     void fontChanged( const QFont & );
00694     void colorChanged( const QColor &color );
00695 
00696     void extraLineBeginNormal();
00697     void extraLineBeginArrow();
00698     void extraLineBeginRect();
00699     void extraLineBeginCircle();
00700     void extraLineBeginLineArrow();
00701     void extraLineBeginDimensionLine();
00702     void extraLineBeginDoubleArrow();
00703     void extraLineBeginDoubleLineArrow();
00704     void setExtraLineBegin(LineEnd lb);
00705     void extraLineEndNormal();
00706     void extraLineEndArrow();
00707     void extraLineEndRect();
00708     void extraLineEndCircle();
00709     void extraLineEndLineArrow();
00710     void extraLineEndDimensionLine();
00711     void extraLineEndDoubleArrow();
00712     void extraLineEndDoubleLineArrow();
00713     void setExtraLineEnd(LineEnd le);
00714 
00715     void setExtraPenStyle( Qt::PenStyle style );
00716     void setExtraPenWidth( double width );
00717 
00722     void restartPresentation() { m_autoPresRestart = true; }
00727     void stopAutomaticPresentation() { m_autoPresStop = true; }
00728 
00729     void newPageLayout( const KoPageLayout &_layout );
00730     void openPageLayoutDia() { extraLayout(); }
00731     void unitChanged( KoUnit::Unit );
00732 
00733     void doAutomaticScreenPres();
00734 
00735     void getPageMouseWheelEvent( QWheelEvent *e );
00736     void updateRuler();
00737 
00738     void refreshAllVariable();
00739     void slotViewFormattingChars();
00740     void slotUpdateScrollBarRanges();
00741 
00742     void addGuideLine();
00743 
00744     void refreshRuler( bool state );
00745     void slotApplyFont();
00746     void slotApplyParag();
00747     void slotObjectEditChanged();
00748     void slotChangeCutState(bool );
00749 
00750     void insertDirectCursor();
00751     void slotCorrectWord();
00752     void editFindNext();
00753     void editFindPrevious();
00754 
00755     void initialLayoutOfSplitter();
00756 
00757     virtual void slotChildActivated(bool a);
00758 
00759     void loadingFinished();
00760 
00761 protected:
00762     virtual void resizeEvent( QResizeEvent* );
00763     virtual void dragEnterEvent( QDragEnterEvent *e );
00764     virtual void dragMoveEvent( QDragMoveEvent *e );
00765     virtual void dragLeaveEvent( QDragLeaveEvent *e );
00766     virtual void dropEvent( QDropEvent *e );
00767 
00768     virtual void keyPressEvent( QKeyEvent* );
00769 
00770     virtual void guiActivateEvent( KParts::GUIActivateEvent *ev );
00771 
00772 // GUI
00773     void setupActions();
00774     void setupPopupMenus();
00775     void setupScrollbars();
00776     void setupRulers();
00777 
00778     void startScreenPres( int pgNum = -1 );
00779 
00780     virtual void updateReadWrite( bool readwrite );
00781 
00782     void addVariableActions( int type, const QStringList & texts,
00783                              KActionMenu * parentMenu, const QString & menuText );
00784 
00785     void showParagraphDialog( int initialPage = -1, double initialTabPos = 0.0 );
00786 
00787     QValueList<KoTextObject *> spellAddTextObject() const;
00788 
00789     bool switchInOtherPage( const QString & text );
00790 
00791     void openThePresentationDurationDialog();
00792     QString presentationDurationDataFormatChange( int _time );
00793 
00794     int getZoomEntirePage() const;
00795 
00796     KCommand * applyAutoFormatToCurrentPage( const QPtrList<KoTextObject> & lst);
00797     void textStyleSelected( KoParagStyle *_sty );
00798 
00799     /*
00800      * create a command which sets the pen according to the flags
00801      * for the selected objects on the active and sticky page
00802      */
00803     KCommand * getPenCmd( const QString &name, KoPen pen, LineEnd lb, LineEnd le, int flags );
00804 
00805     void spellCheckerRemoveHighlight();
00806 
00807     void updateNoteBarText();
00808 private:
00809     void clearSpellChecker(bool cancelSpellCheck = false);
00810 
00811 // ********** variables **********
00812 
00813     // document
00814     KPrDocument *m_pKPresenterDoc;
00815 
00816     // flags
00821     bool m_autoPresRestart;
00822 
00827     bool m_autoPresStop;
00828     bool m_screenSaverWasEnabled;
00829     bool m_dpmsWasEnabled;
00830 
00831     // right button popup menus
00832     QPopupMenu *rb_lbegin, *rb_lend;
00833     QPopupMenu *m_arrangeObjectsPopup;
00834     QPtrList<KAction> m_actionList; // for the kodatatools
00835     QPtrList<KAction> m_variableActionList;
00836 
00837     // scrollbars
00838     QScrollBar *vert, *horz;
00839 
00840     // dialogs
00841     AFChoose *afChoose;
00842     KPrPropertyEditor *m_propertyEditor;
00843     KPrPgConfDia *pgConfDia;
00844     KPrRotationDialogImpl *rotateDia;
00845     KPrShadowDialogImpl *shadowDia;
00846     KPrImageEffectDia *imageEffectDia;
00847     KPrPresDurationDia *presDurationDia;
00848 
00849     // default pen and brush
00850     KoPen pen;
00851     QBrush brush;
00852     LineEnd lineBegin;
00853     LineEnd lineEnd;
00854     QColor gColor1, gColor2;
00855     BCType gType;
00856     FillType fillType;
00857     PieType pieType;
00858     bool gUnbalanced;
00859     int gXFactor, gYFactor;
00860     int pieLength, pieAngle;
00861     int rndX, rndY;
00862     // for Convex/Concave Polygon
00863     bool checkConcavePolygon;
00864     int cornersValue;
00865     int sharpnessValue;
00867     QPoint m_mousePos;
00868 
00869     // for Picture Object
00870     PictureMirrorType mirrorType;
00871     int depth;
00872     bool swapRGB;
00873     bool grayscal;
00874     int bright;
00875 
00876     // the page
00877     KPrCanvas *m_canvas;
00878     KoRuler *h_ruler, *v_ruler;
00879     KoTabChooser *tabChooser;
00880     // text toolbar values
00881     QFont tbFont;
00882     int tbAlign;
00883     QColor tbColor;
00884 
00885     bool m_bShowGUI;
00886     bool presStarted;
00890     bool m_editMaster;
00891     bool allowWebPres;
00892     bool allowMSPres;
00893     int currPg; // 0-based
00894 
00895     QSize oldSize;
00896 
00897     int screensaver_pid;
00898 
00899     // Statusbar items
00900     QLabel * m_sbPageLabel; // 'Current page number and page count' label
00901     QLabel * m_sbObjectLabel; // Info about selected object
00902     QLabel *m_sbSavingLabel; // use when saving file
00903     KStatusBarLabel* m_sbModifiedLabel;
00904     KStatusBarLabel* m_sbUnitLabel;
00905     KStatusBarLabel* m_sbZoomLabel;
00906 
00907     // actions
00908     KAction *actionEditCut;
00909     KAction *actionEditCustomVars;
00910     KAction *actionEditCopy;
00911     KAction *actionEditPaste;
00912     KAction *actionEditDelete;
00913     KAction *actionEditSelectAll;
00914     KAction *actionEditDeSelectAll;
00915     KAction *actionEditCopyPage;
00916     KAction *actionEditDuplicatePage;
00917     KAction *actionEditDelPage;
00918 
00919     KToggleAction *actionViewShowSideBar;
00920     KToggleAction *actionViewShowNoteBar;
00921     KToggleAction *actionViewSlideMaster;
00922 
00923     KToggleAction *actionViewShowGuideLine;
00924 
00925     KToggleAction *actionViewFormattingChars;
00926     KToggleAction *actionViewShowGrid;
00927     KToggleAction *actionViewSnapToGrid;
00928 
00929     KAction *actionInsertPage;
00930     KAction *actionInsertPicture;
00931 
00932     KToggleAction *actionToolsMouse;
00933     KToggleAction *actionToolsRotate;
00934     KToggleAction *actionToolsZoom;
00935     KToggleAction *actionToolsLine;
00936     KToggleAction *actionToolsRectangle;
00937     KToggleAction *actionToolsCircleOrEllipse;
00938     KToggleAction *actionToolsPie;
00939     KToggleAction *actionToolsText;
00940     KToggleAction *actionToolsAutoform;
00941     KToggleAction *actionToolsDiagramm;
00942     KToggleAction *actionToolsTable;
00943     KToggleAction *actionToolsFormula;
00944     KToggleAction *actionToolsFreehand;
00945     KToggleAction *actionToolsPolyline;
00946     KToggleAction *actionToolsQuadricBezierCurve;
00947     KToggleAction *actionToolsCubicBezierCurve;
00948     KToggleAction *actionToolsConvexOrConcavePolygon;
00949     KToggleAction *actionToolsClosedFreehand;
00950     KToggleAction *actionToolsClosedPolyline;
00951     KToggleAction *actionToolsClosedQuadricBezierCurve;
00952     KToggleAction *actionToolsClosedCubicBezierCurve;
00953     KoPartSelectAction *actionToolsObject;
00954     KActionMenu *actionToolsLinePopup;
00955     KActionMenu *actionToolsShapePopup;
00956     KActionMenu *actionToolsClosedLinePopup;
00957 
00958     KAction *actionTextFont;
00959     KFontSizeAction *actionTextFontSize;
00960     KFontAction *actionTextFontFamily;
00961     KToggleAction *actionTextAlignLeft;
00962     KToggleAction *actionTextAlignCenter;
00963     KToggleAction *actionTextAlignRight;
00964     KToggleAction *actionTextAlignBlock;
00965 
00966     KActionMenu *actionFormatBullet;
00967     KActionMenu *actionFormatNumber;
00968 
00969 
00970     KAction *actionTextDepthPlus;
00971     KAction *actionTextDepthMinus;
00972     KAction *actionTextExtentCont2Height;
00973     KAction *actionTextExtendObj2Cont;
00974     KToggleAction *actionTextBold;
00975     KToggleAction *actionTextItalic;
00976     KToggleAction *actionTextUnderline;
00977     KToggleAction *actionFormatStrikeOut;
00978     KAction *actionTextInsertPageNum;
00979 
00980     KAction *actionExtraProperties;
00981     KAction *actionExtraRaise;
00982     KAction *actionExtraLower;
00983 
00984     KAction *actionExtraBringForward;
00985     KAction *actionExtraSendBackward;
00986     KActionMenu *actionExtraArrangePopup;
00987 
00988     KAction *actionExtraRotate;
00989     KAction *actionExtraShadow;
00990     KActionMenu *actionExtraAlignObjsPopup;
00991     KAction *actionExtraAlignObjLeft;
00992     KAction *actionExtraAlignObjCenterH;
00993     KAction *actionExtraAlignObjRight;
00994     KAction *actionExtraAlignObjTop;
00995     KAction *actionExtraAlignObjCenterV;
00996     KAction *actionExtraAlignObjBottom;
00997     KAction *actionExtraBackground;
00998     KAction *actionExtraLayout;
00999     KAction *actionExtraConfigure;
01000     KAction *actionExtraWebPres;
01001     KAction *actionExtraMSPres;
01002     KAction *actionExtraCreateTemplate;
01003     KAction *actionExtraLineBegin;
01004     KAction *actionExtraLineEnd;
01005     KAction *actionExtraGroup;
01006     KAction *actionExtraUnGroup;
01007     KoLineStyleAction *actionExtraPenStyle;
01008     KoLineWidthAction *actionExtraPenWidth;
01009 
01010     KAction *actionScreenConfigPages;
01011     KAction *actionScreenAssignEffect;
01012     KAction *actionScreenTransEffect;
01013     KAction *actionScreenStart;
01014     KAction *actionScreenStartFromFirst;
01015     KAction *actionScreenStop;
01016     KAction *actionScreenPause;
01017     KAction *actionScreenFirst;
01018     KAction *actionScreenPrev;
01019     KAction *actionScreenNext;
01020     KAction *actionScreenLast;
01021     KAction *actionScreenSkip;
01022 
01023     KAction *actionEditFind;
01024     KAction *actionEditFindNext;
01025     KAction *actionEditFindPrevious;
01026     KAction *actionEditReplace;
01027 
01028     KAction *actionCustomSlideShow;
01029 
01030     KAction *actionColorBar;
01031     KAction *actionExtraDefaultTemplate;
01032 
01033     TKSelectColorAction* actionBrushColor;
01034     TKSelectColorAction* actionPenColor;
01035     TKSelectColorAction* actionTextColor;
01036 
01037 
01038     KAction *actionResizeTextObject;
01039     KAction *actionExtendObjectHeight;
01040     KAction *actionObjectProperties;
01041 
01042     KAction *actionRenamePage;
01043 
01044     KAction *actionPicOriginalSize;
01045     KAction *actionPic640x480;
01046     KAction *actionPic800x600;
01047     KAction *actionPic1024x768;
01048     KAction *actionPic1280x1024;
01049     KAction *actionPic1600x1200;
01050     KAction *actionChangePic;
01051     KAction *actionExtraSpellCheck;
01052     KAction *actionFormatDefault;
01053 
01054     KAction *actionImageEffect;
01055 
01056     KAction *actionInsertComment;
01057     KAction *actionEditComment;
01058     KAction *actionRemoveComment;
01059     KAction *actionCopyTextOfComment;
01060 
01061     KAction *actionImportStyle;
01062 
01063     DCOPObject *dcop;
01064 
01065     QToolButton *pgNext, *pgPrev;
01066     KPrSideBar *sidebar;
01067     KPrNoteBar *notebar;
01068     QSplitter *splitter;
01069     PageBase *pageBase;
01070 
01071     KToggleAction *actionFormatSuper;
01072     KToggleAction *actionFormatSub;
01073 
01074     KToggleAction *m_actionExtraHeader;
01075     KToggleAction *m_actionExtraFooter;
01076 
01077     KAction* actionInsertSpecialChar;
01078     KAction *actionInsertLink;
01079 
01080     KAction * actionChangeLink;
01081     KAction *actionCopyLink;
01082     KAction *actionRemoveLink;
01083 
01084     KAction *actionAddLinkToBookmak;
01085     KAction *actionFormatParag;
01086     KAction *actionOpenLink;
01087     KAction *actionIncreaseFontSize;
01088     KAction *actionDecreaseFontSize;
01089     KAction *actionChangeCase;
01090     KAction *actionRefreshAllVariable;
01091 
01092     KSelectAction *actionViewZoom;
01093 
01094     KSelectAction *actionFormatStyle;
01095 
01096     KToggleAction *actionAllowAutoFormat;
01097 
01098     KToggleAction *actionDisplayObjectFromMasterPage;
01099 
01100     KToggleAction *actionDisplayBackgroundPage;
01101 
01102     KAction *actionFormatStylist;
01103 
01104     KAction *actionAddGuideLine;
01105 
01106     KAction *actionConfigureCompletion;
01107 
01108     KAction *actionZoomMinus;
01109     KAction *actionZoomPageWidth;
01110     KAction *actionZoomEntirePage;
01111     KAction *actionZoomPlus;
01112     KAction *actionZoomSelectedObject;
01113     KAction *actionZoomPageHeight;
01114     KAction *actionZoomAllObject;
01115 
01116     KAction *actionFlipHorizontal;
01117     KAction *actionFlipVertical;
01118     KAction *actionCloseObject;
01119 
01120     KAction *actionDuplicateObj;
01121     KAction *actionApplyAutoFormat;
01122 
01123     KAction *actionCreateStyleFromSelection;
01124 
01125     KAction *actionSavePicture;
01126 
01127     KAction *actionSaveBackgroundPicture;
01128 
01129 
01130     KAction *actionInsertFile;
01131 
01132     KAction *actionSpellIgnoreAll;
01133 
01134     KToggleAction *actionAlignVerticalTop;
01135     KToggleAction *actionAlignVerticalBottom;
01136     KToggleAction *actionAlignVerticalCenter;
01137 
01138     KToggleAction *actionAllowBgSpellCheck;
01139     KAction *actionEditCustomVarsEdit;
01140     KActionMenu *actionFormatStyleMenu;
01141     KToggleAction *actionInsertDirectCursor;
01142 
01143     KAction *actionAddWordToPersonalDictionary;
01144 
01146     QTimer m_autoPresTimer;
01148     QTime m_autoPresTime;
01150     int m_autoPresElapsedTime;
01152     int m_autoPresTimerValue;
01154     bool m_autoPresTimerConnected;
01155 
01157     QTime m_duration;
01159     QValueList<int> m_presentationDurationList;
01160 
01161     KoCharSelectDia *m_specialCharDlg;
01162 
01163     // store the currently selected line-tool
01164     enum CurrentLineTool {
01165         LtLine = 1,
01166         LtFreehand = 2,
01167         LtPolyline = 4,
01168         LtQuadricBezier = 8,
01169         LtCubicBezier = 16
01170     };
01171 
01172     CurrentLineTool m_currentLineTool;
01173 
01174     // store the currently selected shape-tool
01175     enum CurrentShapeTool {
01176         StRectangle = 1,
01177         StCircle = 2,
01178         StPie = 4,
01179         StPolygon = 8
01180     };
01181 
01182     CurrentShapeTool m_currentShapeTool;
01183 
01184     // store the currently selected closed-line-tool
01185     enum CurrentClosedLineTool {
01186         CltFreehand = 1,
01187         CltPolyline = 2,
01188         CltQuadricBezier = 4,
01189         CltCubicBezier = 8
01190     };
01191 
01192     CurrentClosedLineTool m_currentClosedLineTool;
01193 
01194     // Spell-checking
01195     struct {
01196         KoSpell *kospell;
01197         KMacroCommand * macroCmdSpellCheck;
01198         QStringList replaceAll;
01199         KoTextIterator * textIterator;
01200         KSpell2::Dialog *dlg;
01201     } m_spell;
01202 
01203     KSpell2::Broker::Ptr m_broker;
01204 
01205 
01206 
01207     KActionMenu *actionInsertVariable;
01208     KActionMenu *actionInsertCustom;
01209 
01210     struct VariableDef {
01211         int type;
01212         int subtype;
01213     };
01214     typedef QMap<KAction *, VariableDef> VariableDefMap;
01215     VariableDefMap m_variableDefMap;
01216 
01217     KoSearchContext *m_searchEntry, *m_replaceEntry;
01218     KPrFindReplace *m_findReplace;
01219     KoFontDia *m_fontDlg;
01220     KoParagDia *m_paragDlg;
01221     int m_switchPage;
01222     int m_initSwitchPage;
01223 
01224     int xOffsetSaved, yOffsetSaved; // saved when going fullscreen
01225     bool m_bDisplayFieldCode; //save state before to go to presentation mode
01226 };
01227 
01228 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys