kpresenter

KPrView.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@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., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef kpresenter_view_h
22#define kpresenter_view_h
23
24#ifdef HAVE_CONFIG_H
25#include <config.h>
26#endif
27
28#include <tqguardedptr.h>
29#include <tqtimer.h>
30#include <tqdatetime.h>
31
32#include <KoView.h>
33#include "global.h"
34#include <KoBrush.h>
35#include <KoPen.h>
36#include <KoRuler.h>
37
38class TQPopupMenu;
39class TQSplitter;
40class TQLabel;
41class DCOPObject;
42class KPrView;
43class KPrBackDialog;
44class KoRuler;
45class TQScrollBar;
46class AFChoose;
47class KPrPropertyEditor;
48class KPrPgConfDia;
49class KPrSlideTransitionDia;
51class KPrShadowDialogImpl;
52class KPrImageEffectDia;
53class ConfPieDia;
54class ConfRectDia;
55class ConfPolygonDia;
56class ConfPictureDia;
57class KPrPresDurationDia;
58class TQToolButton;
59class KPrSideBar;
60class KPrNoteBar;
61
62class TDEAction;
63class TDEActionMenu;
64class TDEToggleAction;
65class TTDESelectColorAction;
66class KoPartSelectAction;
67class KoPicture;
68class KoParagStyle;
69class KoLineStyleAction;
70class KoLineWidthAction;
71class KoRect;
72
73class KoCharSelectDia;
74class KoTextFormat;
75class KoTextObject;
76class KoTextZoomHandler;
77
78class KCommand;
79class KMacroCommand;
80class TDEFontSizeAction;
81class KColorAction;
82class TDESelectAction;
83class TDEFontAction;
84class KoParagCounter;
85class TDEActionMenu;
86class KoSearchContext;
87class KPrFindReplace;
88class KPrCanvas;
89class KoFontDia;
90class KoParagDia;
91class KPrObject;
92class KPrPixmapObject;
93class KPrDocument;
94class KPrPage;
95class KPrTextObject;
96class KoTextIterator;
97class KStatusBarLabel;
98
99class KoSpell;
100#include <tdespell2/broker.h>
101namespace KSpell2 {
102 class Dialog;
103}
104
105class PageBase : public TQWidget
106{
107public:
108 PageBase( TQWidget *parent, KPrView *v ) : TQWidget( parent ), view( v ) {}
109 void resizeEvent( TQResizeEvent *e );
110
111private:
112 KPrView *view;
113
114};
115
116
117class KPrView : public KoView
118{
119 friend class PageBase;
120 TQ_OBJECT
121
122
123public:
124 KPrView( KPrDocument* _doc, TQWidget *_parent = 0, const char *_name = 0 );
125 ~KPrView();
126
127 void initGui();
128 virtual DCOPObject* dcopObject();
129
130 // for dcop interface
131 int getCurrentPresPage() const;
132 int getCurrentPresStep() const;
133 int getPresStepsOfPage() const;
134 int getNumPresPages() const;
135 bool gotoPresPage( int pg );
136
137 virtual void setupPrinter( KPrinter &printer );
138 virtual void print( KPrinter &printer );
139
140 void showFormat( const KoTextFormat &format );
141
142 void showZoom( int zoom ); // show a zoom value in the combo
143 void setZoom( int zoom, bool updateViews ); // change the zoom value
144 void changeZoomMenu( int zoom=-1);
145 void showStyle( const TQString & styleName );
146 void updateStyleList();
147
148 KoTextZoomHandler *zoomHandler() const;
149
150 //used this function when we when to print/create web presentation etc...
151 //=>we unzoom it.
152 void unZoomDocument(int &dpiX,int &dpiY);
153 void zoomDocument(int zoom);
154
155 //refresh footer/header button when we make undo/redo show/hide header/footer
156 void updateHeaderFooterButton();
157 void updateDisplayObjectMasterPageButton();
158
159 void updateDisplayBackgroundButton();
160 virtual int leftBorder() const { return canvas()->mapTo(const_cast<KPrView *>(this), TQPoint(0,0)).x(); };
161 virtual int rightBorder() const { return width() - canvas()->mapTo(const_cast<KPrView *>(this), TQPoint(canvas()->width(), 0)).x(); };
162 virtual int topBorder() const { return canvas()->mapTo(const_cast<KPrView *>(this), TQPoint(0,0)).y(); };
163 virtual int bottomBorder() const { return height() - canvas()->mapTo(const_cast<KPrView *>(this), TQPoint(0, canvas()->height())).y(); };
164
165 void updateGuideLineButton();
166
167 void updateGridButton();
168 void savePicture( const TQString& oldName, KoPicture& picture);
169 void savePicture( KPrPixmapObject* obj );
170
171 void insertFile(const TQString &path);
172 void testAndCloseAllTextObjectProtectedContent();
173 void updateRulerInProtectContentMode();
174 TQPtrList<TDEAction> listOfResultOfCheckWord( const TQString &word );
175
179 KSpell2::Broker *broker() const;
180 bool editMaster() const { return m_editMaster;}
181
182signals:
183 void currentPageChanged( int );
184 void presentationFinished();
185
186public slots:
187 // edit menu
188 void editCut();
189 void editCopy();
190 void editPaste();
191 void editDelete();
192 void editSelectAll();
193 void editDeSelectAll();
194 void editCopyPage();
195 void editDuplicatePage();
196 void editDelPage();
197 void editFind();
198 void editReplace();
199
200 // view menu
201 void viewShowSideBar();
202 void viewShowNoteBar();
203 void viewSlideMaster();
204 void viewZoom( const TQString &s );
205
206 void viewFooter();
207 void viewHeader();
208 void insertComment();
209 void editComment();
210
211 void viewGuideLines();
212
213 void viewGrid();
214
215 void viewSnapToGrid();
216
217 // insert menu
218 void insertPage();
219 void insertPicture();
220 void insertPicture(const TQString &file);
221 void insertSpecialChar();
222
223 // tools menu
224 void toolsMouse();
225 void toolsRotate();
226 void toolsZoom();
227 void toolsLine();
228 void toolsLinePopup();
229 void toolsShapePopup();
230 void toolsRectangle();
231 void toolsCircleOrEllipse();
232 void toolsPie();
233 void toolsText();
234 void toolsAutoform();
235 void toolsDiagramm();
236 void toolsTable();
237 void toolsFormula();
238 void toolsObject();
239 void toolsFreehand();
240 void toolsPolyline();
241 void toolsQuadricBezierCurve();
242 void toolsCubicBezierCurve();
243 void toolsConvexOrConcavePolygon();
244 void toolsClosedLinePopup();
245 void toolsClosedFreehand();
246 void toolsClosedPolyline();
247 void toolsClosedQuadricBezierCurve();
248 void toolsClosedCubicBezierCurve();
249
250 // extra menu
251 void extraProperties();
252 void extraRaise();
253 void extraLower();
254 void extraRotate();
255 void extraSendBackward();
256 void extraBringForward();
257 void extraArrangePopup();
258
259 void extraShadow();
260 void extraBackground();
261 void extraLayout();
262 void extraConfigure();
263 void extraLineBegin();
264 void extraLineEnd();
265 void extraWebPres();
266 void extraMSPres();
267 void extraCreateTemplate();
268 void extraDefaultTemplate();
269 void extraGroup();
270 void extraUnGroup();
271 void extraPenStyle( int newStyle );
272 void extraPenWidth( double newWidth );
273
274 void configureCompletion();
275
276 void extraAlignObjLeft();
277 void extraAlignObjCenterH();
278 void extraAlignObjRight();
279 void extraAlignObjTop();
280 void extraAlignObjCenterV();
281 void extraAlignObjBottom();
282
283 // screen menu
284 void screenConfigPages();
285 void screenAssignEffect();
286 void screenTransEffect();
287 void screenStart();
288 void screenStartFromFirst();
289 void screenStop();
290 void screenPause();
291 void screenFirst();
297 void screenPrev( bool gotoPreviousPage = false );
303 void screenNext( bool gotoNextPage = false );
304 void screenLast();
305 void screenSkip();
306
307 // text toolbar
308 void sizeSelected( int size );
309 void fontSelected( const TQString &fontFamily );
310 void textBold();
311 void textItalic();
312 void textUnderline();
313 void textStrikeOut();
314 void textColor();
315 void textAlignLeft();
316 void textAlignCenter();
317 void textAlignRight();
318 void textAlignBlock();
319 void mtextFont();
320
321 void slotCounterStyleSelected();
322
323 void textDepthPlus();
324 void textDepthMinus();
325 void textContentsToHeight();
326 void textObjectToContents();
327 void textInsertPageNum();
328 void textDefaultFormat();
329
330 // color bar
331 void penChosen();
332 void brushChosen();
333
334 void skipToPage( int _num );
335 void nextPage();
336 void prevPage();
337
341 void updateSideBarItem( KPrPage * page );
342 void addSideBarItem( int pos );
343 void moveSideBarItem( int oldPos, int newPos );
344 void removeSideBarItem( int pos );
345
346 //statusbar updates
347 void updatePageInfo();
348 void updateObjectStatusBarItem();
349 void pageNumChanged();
350 void updateSideBarMenu();
351
352 void objectSelectedChanged();
353
354 void renamePageTitle();
355
356 void picViewOriginalSize();
357 void picViewOrig640x480();
358 void picViewOrig800x600();
359 void picViewOrig1024x768();
360 void picViewOrig1280x1024();
361 void picViewOrig1600x1200();
362
363 void chPic();
364 void imageEffect();
365
366 void textSubScript();
367 void textSuperScript();
368
369 void slotSpecialChar(TQChar, const TQString &);
370 void slotSpecialCharDlgClosed();
371
372 void insertLink();
373 void changeLink();
374 void copyLink();
375 void removeLink();
376 void addToBookmark();
377 void slotSoftHyphen();
378 void slotNonbreakingSpace();
379 void slotNonbreakingHyphen();
380 void slotLineBreak();
381 void slotIncreaseNumberingLevel();
382 void slotDecreaseNumberingLevel();
383
384 void extraAutoFormat();
385 void slotSpellCheck();
386
387
388 void spellCheckerDone( const TQString & );
389 void spellCheckerCancel();
390 void startKSpell();
391 void spellAddAutoCorrect (const TQString & originalword, const TQString & newword);
392 void spellCheckerMisspelling( const TQString &, int );
393 void spellCheckerCorrected( const TQString &, int, const TQString & );
394 void alignChanged( int );
395
396 void formatParagraph();
397 void changeNbOfRecentFiles(int _nb);
398
399 void insertVariable();
400
401 void insertCustomVariable();
402 void insertNewCustomVariable();
403 void refreshCustomMenu();
404
405 void editCustomVars ();
406 void openLink();
407
408 void increaseFontSize();
409 void decreaseFontSize();
410
411 void tabListChanged( const KoTabulatorList & tabList );
412
413 void newLeftIndent( double _leftIndent);
414 void newFirstIndent( double _firstIndent);
415 void newRightIndent( double _rightIndent);
416 void slotUpdateRuler();
417
418 void slotHRulerDoubleClicked( double ptpos );
419 void slotHRulerDoubleClicked();
420
421 void changeCaseOfText();
422 void slotStyleSelected();
423 void textStyleSelected( int );
424 void extraStylist();
425
426 void slotAllowAutoFormat();
427
428 void slotCompletion();
429
430 void removeComment();
431 void copyTextOfComment();
432
433 //zoom menu
434 void zoomMinus();
435 void zoomPageWidth();
436 void zoomEntirePage();
437 void zoomPlus();
438 void zoomSelectedObject();
439 void zoomPageHeight();
440 void zoomAllObject();
441
442 void flipHorizontal();
443 void flipVertical();
444 void closeObject();
445
446 void duplicateObj();
447 void applyAutoFormat();
448 void createStyleFromSelection();
449
450 void alignVerticalTop();
451 void alignVerticalBottom();
452 void alignVerticalCenter();
453
454
455 void savePicture();
456 void autoSpellCheck();
457
458 void insertFile();
459 void editCustomVariable();
460 void importStyle();
461
462 void backgroundPicture();
463 void updateBgSpellCheckingState();
464 void updatePresentationButton(bool);
465 void refreshGroupButton();
466 void slotAddIgnoreAllWord();
467 void addWordToDictionary();
468 void customSlideShow();
469
470 void displayObjectFromMasterPage();
471 void displayBackground();
472 void slotUnitChanged(KoUnit::Unit);
473 void documentModified( bool );
474
475public:
476 // create GUI
477 virtual void createGUI();
478
479 // get current pagenum, 1-based
480 unsigned int getCurrPgNum() const;
485 void recalcCurrentPageNum();
486
487 // return pointer to document
488 KPrDocument *kPresenterDoc() const {return m_pKPresenterDoc; }
489
490 // properties
491 void changePicture( const TQString & );
492
493 KPrCanvas* getCanvas() const { return m_canvas;}
494
495 void setRulerMouseShow( bool _show );
496 void setRulerMousePos( int mx, int my );
497
498 // set scrollbar ranges
499 void setRanges();
500
501 KoRuler *getHRuler() const { return h_ruler; }
502 KoRuler *getVRuler() const { return v_ruler; }
503 KoTabChooser *getTabChooser() const { return tabChooser; }
504 TQScrollBar *getHScrollBar() const { return horz; }
505 TQScrollBar *getVScrollBar() const { return vert; }
506
515 void showObjectRect( const KPrObject * object );
516
517 PieType getPieType() const { return pieType; }
518 int getPieAngle() const { return pieAngle; }
519 int getPieLength() const { return pieLength; }
520 KoPen getPen() const { return pen; }
521 TQBrush getBrush() const { return brush; }
522 LineEnd getLineBegin() const { return lineBegin; }
523 LineEnd getLineEnd() const{ return lineEnd; }
524 TQColor getGColor1() const { return gColor1; }
525 TQColor getGColor2() const { return gColor2; }
526 BCType getGType() const { return gType; }
527 FillType getFillType() const { return fillType; }
528 bool getGUnbalanced() const { return gUnbalanced; }
529 int getGXFactor() const { return gXFactor; }
530 int getGYFactor() const { return gYFactor; }
531 TTDESelectColorAction* getActionBrushColor() const { return actionBrushColor; }
532 TTDESelectColorAction* getActionPenColor() const { return actionPenColor; }
533
534 void setPieType(PieType _pieType) { pieType = _pieType; }
535 void setPieAngle(int _pieAngle) { pieAngle = _pieAngle; }
536 void setPieLength(int _pieLength) { pieLength = _pieLength; }
537 void setPen(KoPen _pen) { pen = _pen; }
538 void setBrush(TQBrush _brush) { brush = _brush; }
539 void setLineBegin(LineEnd _lineBegin) { lineBegin = _lineBegin; }
540 void setLineEnd(LineEnd _lineEnd){ lineEnd = _lineEnd; }
541 void setGColor1(TQColor _gColor1) { gColor1 = _gColor1; }
542 void setGColor2(TQColor _gColor2) { gColor2 = _gColor2; }
543 void setGType(BCType _gType) { gType = _gType; }
544 void setFillType(FillType _fillType) { fillType = _fillType; }
545 void setGUnbalanced(bool _gUnbalanced) { gUnbalanced = _gUnbalanced; }
546 void setGXFactor(int _gXFactor) { gXFactor = _gXFactor; }
547 void setGYFactor(int _gYFactor) { gYFactor = _gYFactor; }
548
549 void setTool( ToolEditMode toolEditMode );
550
551 int getRndX() const { return rndX; }
552 int getRndY() const { return rndY; }
553
554 void setRndX(int _rndX) { rndX = _rndX; }
555 void setRndY(int _rndY) { rndY = _rndY; }
556
557// TQFont &currFont() { return tbFont; }
558// TQColor &currColor() { return tbColor; }
559
560 void enableWebPres();
561 void enableMSPres();
562
566 bool doubleClickActivation() const;
570 TQWidget* canvas() const;
574 int canvasXOffset() const;
578 int canvasYOffset() const;
579
583 void updateSideBar();
584
585 void refreshPageButton();
586
587 void setCanvasXOffset( int _x );
588 void setCanvasYOffset( int _y );
589
590 void openPopupMenuObject( const TQString & name , const TQPoint & _point );
591 void openPopupMenuMenuPage( const TQPoint & _point );
592 void openPopupMenuSideBar(const TQPoint & _point);
593
594 void openPopupMenuZoom( const TQPoint & _point );
595
596 void penColorChanged( const KoPen & _pen );
597 void brushColorChanged( const TQBrush & _brush );
598
603 void restartAutoPresTimer();
604
609 void continueAutoPresTimer();
610
615 void stopAutoPresTimer();
616
621 void setAutoPresTimer( int sec );
622
623 void showCounter( KoParagCounter &c );
624
625 TQPopupMenu * popupMenu( const TQString& name );
626
627 void showRulerIndent( double _leftMargin, double _firstLine, double _rightMargin, bool rtl );
628
629 void reorganize();
630
631 // For KPrNoteBar
632 KPrNoteBar *getNoteBar() const { return notebar; }
633
634 // Used by Page to plug/unplug the datatool actions
635 TQPtrList<TDEAction>& actionList() { return m_actionList; }
636 // Used by Page to plug/unplug the variable actions
637 TQPtrList<TDEAction> &variableActionList() { return m_variableActionList; }
638
639 // for Polygon object
640 bool getCheckConcavePolygon() const { return checkConcavePolygon; }
641 int getCornersValue() const { return cornersValue; }
642 int getSharpnessValue() const { return sharpnessValue; }
643
644 void setCheckConcavePolygon(bool _concavePolygon) { checkConcavePolygon = _concavePolygon; }
645 void setCornersValue(int _cornersValue) { cornersValue = _cornersValue; }
646 void setSharpnessValue(int _sharpnessValue) { sharpnessValue = _sharpnessValue; }
647
648 // for Picture Object
649 PictureMirrorType getPictureMirrorType() const { return mirrorType; }
650 int getPictureDepth() const { return depth; }
651 bool getPictureSwapRGB() const { return swapRGB; }
652 bool getPictureGrayscal() const { return grayscal; }
653 int getPictureBright() const { return bright; }
654
660 void setPageDuration( int _pgNum );
661
667 void setZoomRect( const KoRect & rect );
668 void changeVerticalAlignmentStatus(VerticalAlignmentType _type );
669
670 void closeTextObject();
671 void deSelectAllObjects();
672
673 void insertDirectCursor(bool b);
674 void updateDirectCursorButton();
675
676 void setEditMaster( bool editMaster );
677
678protected slots:
679 // dialog slots
680 void backOk( KPrBackDialog*, bool );
681 void afChooseOk( const TQString & );
682 void slotAfchooseCanceled();
683 void propertiesOk();
684 void pgConfOk();
685 void rotateOk();
686 void shadowOk();
687 void pddClosed();
688
689 // scrolling
690 void scrollH( int );
691 void scrollV( int );
692
693 // textobject
694 void fontChanged( const TQFont & );
695 void colorChanged( const TQColor &color );
696
697 void extraLineBeginNormal();
698 void extraLineBeginArrow();
699 void extraLineBeginRect();
700 void extraLineBeginCircle();
701 void extraLineBeginLineArrow();
702 void extraLineBeginDimensionLine();
703 void extraLineBeginDoubleArrow();
704 void extraLineBeginDoubleLineArrow();
705 void setExtraLineBegin(LineEnd lb);
706 void extraLineEndNormal();
707 void extraLineEndArrow();
708 void extraLineEndRect();
709 void extraLineEndCircle();
710 void extraLineEndLineArrow();
711 void extraLineEndDimensionLine();
712 void extraLineEndDoubleArrow();
713 void extraLineEndDoubleLineArrow();
714 void setExtraLineEnd(LineEnd le);
715
716 void setExtraPenStyle( TQt::PenStyle style );
717 void setExtraPenWidth( double width );
718
723 void restartPresentation() { m_autoPresRestart = true; }
728 void stopAutomaticPresentation() { m_autoPresStop = true; }
729
730 void newPageLayout( const KoPageLayout &_layout );
731 void openPageLayoutDia() { extraLayout(); }
732 void unitChanged( KoUnit::Unit );
733
734 void doAutomaticScreenPres();
735
736 void getPageMouseWheelEvent( TQWheelEvent *e );
737 void updateRuler();
738
739 void refreshAllVariable();
740 void slotViewFormattingChars();
741 void slotUpdateScrollBarRanges();
742
743 void addGuideLine();
744
745 void refreshRuler( bool state );
746 void slotApplyFont();
747 void slotApplyParag();
748 void slotObjectEditChanged();
749 void slotChangeCutState(bool );
750
751 void insertDirectCursor();
752 void slotCorrectWord();
753 void editFindNext();
754 void editFindPrevious();
755
756 void initialLayoutOfSplitter();
757
758 virtual void slotChildActivated(bool a);
759
760 void loadingFinished();
761
762protected:
763 virtual void resizeEvent( TQResizeEvent* );
764 virtual void dragEnterEvent( TQDragEnterEvent *e );
765 virtual void dragMoveEvent( TQDragMoveEvent *e );
766 virtual void dragLeaveEvent( TQDragLeaveEvent *e );
767 virtual void dropEvent( TQDropEvent *e );
768
769 virtual void keyPressEvent( TQKeyEvent* );
770
771 virtual void guiActivateEvent( KParts::GUIActivateEvent *ev );
772
773// GUI
774 void setupActions();
775 void setupPopupMenus();
776 void setupScrollbars();
777 void setupRulers();
778
779 void startScreenPres( int pgNum = -1 );
780
781 virtual void updateReadWrite( bool readwrite );
782
783 void addVariableActions( int type, const TQStringList & texts,
784 TDEActionMenu * parentMenu, const TQString & menuText );
785
786 void showParagraphDialog( int initialPage = -1, double initialTabPos = 0.0 );
787
788 TQValueList<KoTextObject *> spellAddTextObject() const;
789
790 bool switchInOtherPage( const TQString & text );
791
792 void openThePresentationDurationDialog();
793 TQString presentationDurationDataFormatChange( int _time );
794
795 int getZoomEntirePage() const;
796
797 KCommand * applyAutoFormatToCurrentPage( const TQPtrList<KoTextObject> & lst);
798 void textStyleSelected( KoParagStyle *_sty );
799
800 /*
801 * create a command which sets the pen according to the flags
802 * for the selected objects on the active and sticky page
803 */
804 KCommand * getPenCmd( const TQString &name, KoPen pen, LineEnd lb, LineEnd le, int flags );
805
806 void spellCheckerRemoveHighlight();
807
808 void updateNoteBarText();
809private:
810 void clearSpellChecker(bool cancelSpellCheck = false);
811
812// ********** variables **********
813
814 // document
815 KPrDocument *m_pKPresenterDoc;
816
817 // flags
822 bool m_autoPresRestart;
823
828 bool m_autoPresStop;
829 bool m_screenSaverWasEnabled;
830 bool m_dpmsWasEnabled;
831
832 // right button popup menus
833 TQPopupMenu *rb_lbegin, *rb_lend;
834 TQPopupMenu *m_arrangeObjectsPopup;
835 TQPtrList<TDEAction> m_actionList; // for the kodatatools
836 TQPtrList<TDEAction> m_variableActionList;
837
838 // scrollbars
839 TQScrollBar *vert, *horz;
840
841 // dialogs
842 AFChoose *afChoose;
843 KPrPropertyEditor *m_propertyEditor;
844 KPrPgConfDia *pgConfDia;
845 KPrRotationDialogImpl *rotateDia;
846 KPrShadowDialogImpl *shadowDia;
847 KPrImageEffectDia *imageEffectDia;
848 KPrPresDurationDia *presDurationDia;
849
850 // default pen and brush
851 KoPen pen;
852 TQBrush brush;
853 LineEnd lineBegin;
854 LineEnd lineEnd;
855 TQColor gColor1, gColor2;
856 BCType gType;
857 FillType fillType;
858 PieType pieType;
859 bool gUnbalanced;
860 int gXFactor, gYFactor;
861 int pieLength, pieAngle;
862 int rndX, rndY;
863 // for Convex/Concave Polygon
864 bool checkConcavePolygon;
865 int cornersValue;
866 int sharpnessValue;
868 TQPoint m_mousePos;
869
870 // for Picture Object
871 PictureMirrorType mirrorType;
872 int depth;
873 bool swapRGB;
874 bool grayscal;
875 int bright;
876
877 // the page
878 KPrCanvas *m_canvas;
879 KoRuler *h_ruler, *v_ruler;
880 KoTabChooser *tabChooser;
881 // text toolbar values
882 TQFont tbFont;
883 int tbAlign;
884 TQColor tbColor;
885
886 bool m_bShowGUI;
887 bool presStarted;
891 bool m_editMaster;
892 bool allowWebPres;
893 bool allowMSPres;
894 int currPg; // 0-based
895
896 TQSize oldSize;
897
898 int screensaver_pid;
899
900 // Statusbar items
901 TQLabel * m_sbPageLabel; // 'Current page number and page count' label
902 TQLabel * m_sbObjectLabel; // Info about selected object
903 TQLabel *m_sbSavingLabel; // use when saving file
904 KStatusBarLabel* m_sbModifiedLabel;
905 KStatusBarLabel* m_sbUnitLabel;
906 KStatusBarLabel* m_sbZoomLabel;
907
908 // actions
909 TDEAction *actionEditCut;
910 TDEAction *actionEditCustomVars;
911 TDEAction *actionEditCopy;
912 TDEAction *actionEditPaste;
913 TDEAction *actionEditDelete;
914 TDEAction *actionEditSelectAll;
915 TDEAction *actionEditDeSelectAll;
916 TDEAction *actionEditCopyPage;
917 TDEAction *actionEditDuplicatePage;
918 TDEAction *actionEditDelPage;
919
920 TDEToggleAction *actionViewShowSideBar;
921 TDEToggleAction *actionViewShowNoteBar;
922 TDEToggleAction *actionViewSlideMaster;
923
924 TDEToggleAction *actionViewShowGuideLine;
925
926 TDEToggleAction *actionViewFormattingChars;
927 TDEToggleAction *actionViewShowGrid;
928 TDEToggleAction *actionViewSnapToGrid;
929
930 TDEAction *actionInsertPage;
931 TDEAction *actionInsertPicture;
932
933 TDEToggleAction *actionToolsMouse;
934 TDEToggleAction *actionToolsRotate;
935 TDEToggleAction *actionToolsZoom;
936 TDEToggleAction *actionToolsLine;
937 TDEToggleAction *actionToolsRectangle;
938 TDEToggleAction *actionToolsCircleOrEllipse;
939 TDEToggleAction *actionToolsPie;
940 TDEToggleAction *actionToolsText;
941 TDEToggleAction *actionToolsAutoform;
942 TDEToggleAction *actionToolsDiagramm;
943 TDEToggleAction *actionToolsTable;
944 TDEToggleAction *actionToolsFormula;
945 TDEToggleAction *actionToolsFreehand;
946 TDEToggleAction *actionToolsPolyline;
947 TDEToggleAction *actionToolsQuadricBezierCurve;
948 TDEToggleAction *actionToolsCubicBezierCurve;
949 TDEToggleAction *actionToolsConvexOrConcavePolygon;
950 TDEToggleAction *actionToolsClosedFreehand;
951 TDEToggleAction *actionToolsClosedPolyline;
952 TDEToggleAction *actionToolsClosedQuadricBezierCurve;
953 TDEToggleAction *actionToolsClosedCubicBezierCurve;
954 KoPartSelectAction *actionToolsObject;
955 TDEActionMenu *actionToolsLinePopup;
956 TDEActionMenu *actionToolsShapePopup;
957 TDEActionMenu *actionToolsClosedLinePopup;
958
959 TDEAction *actionTextFont;
960 TDEFontSizeAction *actionTextFontSize;
961 TDEFontAction *actionTextFontFamily;
962 TDEToggleAction *actionTextAlignLeft;
963 TDEToggleAction *actionTextAlignCenter;
964 TDEToggleAction *actionTextAlignRight;
965 TDEToggleAction *actionTextAlignBlock;
966
967 TDEActionMenu *actionFormatBullet;
968 TDEActionMenu *actionFormatNumber;
969
970
971 TDEAction *actionTextDepthPlus;
972 TDEAction *actionTextDepthMinus;
973 TDEAction *actionTextExtentCont2Height;
974 TDEAction *actionTextExtendObj2Cont;
975 TDEToggleAction *actionTextBold;
976 TDEToggleAction *actionTextItalic;
977 TDEToggleAction *actionTextUnderline;
978 TDEToggleAction *actionFormatStrikeOut;
979 TDEAction *actionTextInsertPageNum;
980
981 TDEAction *actionExtraProperties;
982 TDEAction *actionExtraRaise;
983 TDEAction *actionExtraLower;
984
985 TDEAction *actionExtraBringForward;
986 TDEAction *actionExtraSendBackward;
987 TDEActionMenu *actionExtraArrangePopup;
988
989 TDEAction *actionExtraRotate;
990 TDEAction *actionExtraShadow;
991 TDEActionMenu *actionExtraAlignObjsPopup;
992 TDEAction *actionExtraAlignObjLeft;
993 TDEAction *actionExtraAlignObjCenterH;
994 TDEAction *actionExtraAlignObjRight;
995 TDEAction *actionExtraAlignObjTop;
996 TDEAction *actionExtraAlignObjCenterV;
997 TDEAction *actionExtraAlignObjBottom;
998 TDEAction *actionExtraBackground;
999 TDEAction *actionExtraLayout;
1000 TDEAction *actionExtraConfigure;
1001 TDEAction *actionExtraWebPres;
1002 TDEAction *actionExtraMSPres;
1003 TDEAction *actionExtraCreateTemplate;
1004 TDEAction *actionExtraLineBegin;
1005 TDEAction *actionExtraLineEnd;
1006 TDEAction *actionExtraGroup;
1007 TDEAction *actionExtraUnGroup;
1008 KoLineStyleAction *actionExtraPenStyle;
1009 KoLineWidthAction *actionExtraPenWidth;
1010
1011 TDEAction *actionScreenConfigPages;
1012 TDEAction *actionScreenAssignEffect;
1013 TDEAction *actionScreenTransEffect;
1014 TDEAction *actionScreenStart;
1015 TDEAction *actionScreenStartFromFirst;
1016 TDEAction *actionScreenStop;
1017 TDEAction *actionScreenPause;
1018 TDEAction *actionScreenFirst;
1019 TDEAction *actionScreenPrev;
1020 TDEAction *actionScreenNext;
1021 TDEAction *actionScreenLast;
1022 TDEAction *actionScreenSkip;
1023
1024 TDEAction *actionEditFind;
1025 TDEAction *actionEditFindNext;
1026 TDEAction *actionEditFindPrevious;
1027 TDEAction *actionEditReplace;
1028
1029 TDEAction *actionCustomSlideShow;
1030
1031 TDEAction *actionColorBar;
1032 TDEAction *actionExtraDefaultTemplate;
1033
1034 TTDESelectColorAction* actionBrushColor;
1035 TTDESelectColorAction* actionPenColor;
1036 TTDESelectColorAction* actionTextColor;
1037
1038
1039 TDEAction *actionResizeTextObject;
1040 TDEAction *actionExtendObjectHeight;
1041 TDEAction *actionObjectProperties;
1042
1043 TDEAction *actionRenamePage;
1044
1045 TDEAction *actionPicOriginalSize;
1046 TDEAction *actionPic640x480;
1047 TDEAction *actionPic800x600;
1048 TDEAction *actionPic1024x768;
1049 TDEAction *actionPic1280x1024;
1050 TDEAction *actionPic1600x1200;
1051 TDEAction *actionChangePic;
1052 TDEAction *actionExtraSpellCheck;
1053 TDEAction *actionFormatDefault;
1054
1055 TDEAction *actionImageEffect;
1056
1057 TDEAction *actionInsertComment;
1058 TDEAction *actionEditComment;
1059 TDEAction *actionRemoveComment;
1060 TDEAction *actionCopyTextOfComment;
1061
1062 TDEAction *actionImportStyle;
1063
1064 DCOPObject *dcop;
1065
1066 TQToolButton *pgNext, *pgPrev;
1067 KPrSideBar *sidebar;
1068 KPrNoteBar *notebar;
1069 TQSplitter *splitter;
1070 PageBase *pageBase;
1071
1072 TDEToggleAction *actionFormatSuper;
1073 TDEToggleAction *actionFormatSub;
1074
1075 TDEToggleAction *m_actionExtraHeader;
1076 TDEToggleAction *m_actionExtraFooter;
1077
1078 TDEAction* actionInsertSpecialChar;
1079 TDEAction *actionInsertLink;
1080
1081 TDEAction * actionChangeLink;
1082 TDEAction *actionCopyLink;
1083 TDEAction *actionRemoveLink;
1084
1085 TDEAction *actionAddLinkToBookmak;
1086 TDEAction *actionFormatParag;
1087 TDEAction *actionOpenLink;
1088 TDEAction *actionIncreaseFontSize;
1089 TDEAction *actionDecreaseFontSize;
1090 TDEAction *actionChangeCase;
1091 TDEAction *actionRefreshAllVariable;
1092
1093 TDESelectAction *actionViewZoom;
1094
1095 TDESelectAction *actionFormatStyle;
1096
1097 TDEToggleAction *actionAllowAutoFormat;
1098
1099 TDEToggleAction *actionDisplayObjectFromMasterPage;
1100
1101 TDEToggleAction *actionDisplayBackgroundPage;
1102
1103 TDEAction *actionFormatStylist;
1104
1105 TDEAction *actionAddGuideLine;
1106
1107 TDEAction *actionConfigureCompletion;
1108
1109 TDEAction *actionZoomMinus;
1110 TDEAction *actionZoomPageWidth;
1111 TDEAction *actionZoomEntirePage;
1112 TDEAction *actionZoomPlus;
1113 TDEAction *actionZoomSelectedObject;
1114 TDEAction *actionZoomPageHeight;
1115 TDEAction *actionZoomAllObject;
1116
1117 TDEAction *actionFlipHorizontal;
1118 TDEAction *actionFlipVertical;
1119 TDEAction *actionCloseObject;
1120
1121 TDEAction *actionDuplicateObj;
1122 TDEAction *actionApplyAutoFormat;
1123
1124 TDEAction *actionCreateStyleFromSelection;
1125
1126 TDEAction *actionSavePicture;
1127
1128 TDEAction *actionSaveBackgroundPicture;
1129
1130
1131 TDEAction *actionInsertFile;
1132
1133 TDEAction *actionSpellIgnoreAll;
1134
1135 TDEToggleAction *actionAlignVerticalTop;
1136 TDEToggleAction *actionAlignVerticalBottom;
1137 TDEToggleAction *actionAlignVerticalCenter;
1138
1139 TDEToggleAction *actionAllowBgSpellCheck;
1140 TDEAction *actionEditCustomVarsEdit;
1141 TDEActionMenu *actionFormatStyleMenu;
1142 TDEToggleAction *actionInsertDirectCursor;
1143
1144 TDEAction *actionAddWordToPersonalDictionary;
1145
1147 TQTimer m_autoPresTimer;
1149 TQTime m_autoPresTime;
1151 int m_autoPresElapsedTime;
1153 int m_autoPresTimerValue;
1155 bool m_autoPresTimerConnected;
1156
1158 TQTime m_duration;
1160 TQValueList<int> m_presentationDurationList;
1161
1162 KoCharSelectDia *m_specialCharDlg;
1163
1164 // store the currently selected line-tool
1165 enum CurrentLineTool {
1166 LtLine = 1,
1167 LtFreehand = 2,
1168 LtPolyline = 4,
1169 LtQuadricBezier = 8,
1170 LtCubicBezier = 16
1171 };
1172
1173 CurrentLineTool m_currentLineTool;
1174
1175 // store the currently selected shape-tool
1176 enum CurrentShapeTool {
1177 StRectangle = 1,
1178 StCircle = 2,
1179 StPie = 4,
1180 StPolygon = 8
1181 };
1182
1183 CurrentShapeTool m_currentShapeTool;
1184
1185 // store the currently selected closed-line-tool
1186 enum CurrentClosedLineTool {
1187 CltFreehand = 1,
1188 CltPolyline = 2,
1189 CltQuadricBezier = 4,
1190 CltCubicBezier = 8
1191 };
1192
1193 CurrentClosedLineTool m_currentClosedLineTool;
1194
1195 // Spell-checking
1196 struct {
1197 KoSpell *kospell;
1198 KMacroCommand * macroCmdSpellCheck;
1199 TQStringList replaceAll;
1200 KoTextIterator * textIterator;
1201 KSpell2::Dialog *dlg;
1202 } m_spell;
1203
1204 KSpell2::Broker::Ptr m_broker;
1205
1206
1207
1208 TDEActionMenu *actionInsertVariable;
1209 TDEActionMenu *actionInsertCustom;
1210
1211 struct VariableDef {
1212 int type;
1213 int subtype;
1214 };
1215 typedef TQMap<TDEAction *, VariableDef> VariableDefMap;
1216 VariableDefMap m_variableDefMap;
1217
1218 KoSearchContext *m_searchEntry, *m_replaceEntry;
1219 KPrFindReplace *m_findReplace;
1220 KoFontDia *m_fontDlg;
1221 KoParagDia *m_paragDlg;
1222 int m_switchPage;
1223 int m_initSwitchPage;
1224
1225 int xOffsetSaved, yOffsetSaved; // saved when going fullscreen
1226 bool m_bDisplayFieldCode; //save state before to go to presentation mode
1227};
1228
1229#endif
Class KPCanvas - There is a single instance of this class for a given view.
Definition KPrCanvas.h:82
This class implements the 'find' functionality ( the "search next, prompt" loop ) and the 'replace' f...
A dialog that lets the user interactively choose an angle for rotation.