32#include "KWTextParag.h"
34#include <KoPageLayoutDia.h>
37#include <tdeshortcut.h>
38#include <KoZoomMode.h>
62class KoTextFormatInterface;
64class TTDESelectColorAction;
65class KoPartSelectAction;
80class TDEFontSizeAction;
85#include <tdespell2/broker.h>
95class KWView :
public KoView
101 KWView(
const TQString& viewMode, TQWidget *parent,
const char *name, KWDocument *doc );
104 virtual DCOPObject* dcopObject();
108 void showFormat(
const KoTextFormat ¤tFormat );
109 void showAlign(
int align );
110 void showCounter( KoParagCounter &c );
111 void showSpacing(
int spacing );
119 void updateBorderButtons(
const KoBorder& left,
const KoBorder& right,
120 const KoBorder& top,
const KoBorder& bottom );
122 void showStyle(
const TQString & styleName );
123 void showRulerIndent(
double leftMargin,
double firstLine,
double rightMargin,
bool rtl );
124 void showZoom(
int zoom );
125 void showZoom(
const TQString& zoom );
126 void setZoom(
int zoom,
bool updateViews );
128 bool viewFrameBorders()
const {
return m_viewFrameBorders; }
129 void setViewFrameBorders(
bool b);
134 KSpell2::Broker *broker()
const;
136 void setNoteType(NoteType nt,
bool change=
true);
138 KWDocument *kWordDocument()
const {
return m_doc; }
139 KWGUI *getGUI()
const {
return m_gui; }
142 void updateStyleList();
143 void updateFrameStyleList();
144 void updateTableStyleList();
149 int currentPage()
const;
154 bool doubleClickActivation()
const;
158 TQWidget* canvas()
const;
162 int canvasXOffset()
const;
166 int canvasYOffset()
const;
170 void canvasAddChild( KoViewChild *child );
172 virtual void setupPrinter( KPrinter &printer );
173 virtual void print( KPrinter &printer );
175 virtual TQPoint applyViewTransformations(
const TQPoint& )
const;
176 virtual TQPoint reverseViewTransformations(
const TQPoint& )
const;
178 void changeNbOfRecentFiles(
int nb);
180 void changeZoomMenu(
int zoom=-1);
182 void refreshMenuExpression();
184 void updateGridButton();
186 void deleteFrame(
bool warning=
true);
188 TQPopupMenu * popupMenu(
const TQString& name );
190 TQPtrList<TDEAction> &dataToolActionList() {
return m_actionList; }
191 TQPtrList<TDEAction> &variableActionList() {
return m_variableActionList; }
192 TQPtrList<TDEAction> &tableActions() {
return m_tableActionList; }
196 ProvidesPlainText = 2,
200 static int checkClipboard( TQMimeSource *data );
202 bool insertInlinePicture();
204 void displayFrameInlineInfo();
206 void initGUIButton();
208 void updateHeaderFooterButton();
211 void switchModeView();
212 void changeFootNoteMenuItem(
bool b);
213 void insertFile(
const KURL& url);
214 void testAndCloseAllFrameSetProtectedContent();
215 void updateBgSpellCheckingState();
216 void updateRulerInProtectContentMode();
217 void deselectAllFrames();
218 void autoSpellCheck(
bool b);
219 void insertDirectCursor(
bool b);
220 void updateDirectCursorButton();
224 TQPtrList<TDEAction> listOfResultOfCheckWord(
const TQString &word );
226 int tableSelectCell(
const TQString &tableName, uint row, uint col);
229 int tableDeleteRow(
const TQValueList<uint>& rows,
KWTableFrameSet *table = 0);
230 int tableDeleteCol(
const TQValueList<uint>& cols,
KWTableFrameSet *table = 0);
232 void pasteData( TQMimeSource* data,
bool drop );
237 void fileStatistics();
241 void editSelectAll();
242 void editSelectAllFrames();
243 void editSelectCurrentFrame();
246 void editFindPrevious();
248 void editDeleteFrame();
249 void editCustomVariable();
250 void editCustomVars();
251 void editMailMergeDataBase();
252 void createLinkedFrame();
256 void viewPreviewMode();
257 void slotViewFormattingChars();
258 void slotViewFrameBorders();
261 void viewZoom(
const TQString &s );
265 void insertPicture();
266 void insertSpecialChar();
267 void insertFrameBreak();
268 void insertVariable();
269 void insertFootNote();
270 void insertContents();
272 void insertComment();
273 void removeComment();
274 void copyTextOfComment();
280 void formatParagraph();
282 void formatFrameSet();
284 void slotSpellCheck();
285 void extraAutoFormat();
286 void extraFrameStylist();
288 void extraCreateTemplate();
290 void toolsCreateText();
291 void insertFormula( TQMimeSource* source=0 );
294 void tableProperties();
295 void tableInsertRow();
296 void tableInsertCol();
297 void tableResizeCol();
298 void tableDeleteRow();
299 void tableDeleteCol();
300 void tableJoinCells();
301 void tableSplitCells();
302 void tableSplitCells(
int col,
int row);
303 void tableProtectCells(
bool);
304 void tableUngroupTable();
307 void convertTableToText();
309 void addPersonalExpression();
311 void slotStyleSelected();
312 void slotFrameStyleSelected();
313 void slotTableStyleSelected();
314 void textStyleSelected(
int );
315 void frameStyleSelected(
int );
316 void tableStyleSelected(
int );
317 void textSizeSelected(
int );
318 void increaseFontSize();
319 void decreaseFontSize();
320 void textFontSelected(
const TQString & );
323 void textUnderline();
324 void textStrikeOut();
326 void textAlignLeft();
327 void textAlignCenter();
328 void textAlignRight();
329 void textAlignBlock();
330 void textSpacingSingle();
331 void textSpacingOneAndHalf();
332 void textSpacingDouble();
333 void textSuperScript();
334 void textSubScript();
335 void textIncreaseIndent();
336 void textDecreaseIndent();
337 void textDefaultFormat();
338 void slotCounterStyleSelected();
341 void borderOutline();
346 void backgroundColor();
348 void showFormulaToolbar(
bool show );
351 void configureCompletion();
353 void newPageLayout(
const KoPageLayout &layout );
354 void newLeftIndent(
double leftIndent);
355 void newFirstIndent(
double firstIndent);
356 void newRightIndent(
double rightIndent);
358 void clipboardDataChanged();
359 void tabListChanged(
const KoTabulatorList & tabList );
361 void updatePageInfo();
362 void updateFrameStatusBarItem();
363 void setTemporaryStatusBarText(
const TQString &text);
365 void slotSpecialChar(TQChar ,
const TQString &);
366 void slotFrameSetEditChanged();
367 void showMouseMode(
int mouseMode );
368 void frameSelectedChanged();
369 void docStructChanged(
int type);
370 void documentModified(
bool );
371 void changeOverwriteMode(
bool );
372 void slotHRulerDoubleClicked();
373 void slotHRulerDoubleClicked(
double );
374 void slotUnitChanged(KoUnit::Unit);
376 void numPagesChanged();
378 void insertExpression();
380 void updateTocActionText(
bool hasToc);
382 void changeCaseOfText();
384 void editPersonalExpr();
386 void slotUpdateRuler();
387 void slotEmbedImage(
const TQString &filename );
389 void insertCustomVariable();
390 void insertNewCustomVariable();
391 void slotSpecialCharDlgClosed();
393 void refreshCustomMenu();
395 void changePicture();
397 void configureHeaderFooter();
402 void raiseFrame() { adjustZOrderOfSelectedFrames(RaiseFrame); };
404 void lowerFrame() { adjustZOrderOfSelectedFrames(LowerFrame); };
406 void bringToFront() { adjustZOrderOfSelectedFrames(BringToFront); };
408 void sendToBack() { adjustZOrderOfSelectedFrames(SendToBack); };
414 void addToBookmark();
416 void showDocStructure();
419 void viewSnapToGrid();
421 void slotSoftHyphen();
422 void slotLineBreak();
423 void slotNonbreakingSpace();
424 void slotNonbreakingHyphen();
426 void slotIncreaseNumberingLevel();
427 void slotDecreaseNumberingLevel();
429 void refreshAllVariable();
431 void slotAllowAutoFormat();
433 void slotCompletion();
435 void applyAutoFormat();
436 void createStyleFromSelection();
438 void configureFootEndNote();
439 void editFootEndNote();
440 void changeFootNoteType();
443 void autoSpellCheck();
444 void goToFootEndNote();
447 void docStructEdit();
448 void docStructSpeak();
449 void docStructSelect();
450 void docStructDelete();
451 void docStructProperties();
457 void selectBookmark();
460 void createFrameStyle();
462 void insertDirectCursor();
464 void convertToTextBox();
466 void slotAddIgnoreAllWord();
468 void embeddedStoreInternal();
470 void goToDocumentStructure();
473 void addWordToDictionary();
475 void insertPicture(
const KoPicture& picture,
const bool makeInline,
const bool keepRatio,
int suggestedWidth,
int suggestedHeight );
479 virtual void slotChildActivated(
bool a );
480 void slotSetInitialPosition();
482 void spellCheckerMisspelling(
const TQString &,
int );
483 void spellCheckerCorrected(
const TQString &,
int,
const TQString & );
484 void spellCheckerDone(
const TQString & );
485 void spellCheckerCancel();
487 void spellAddAutoCorrect (
const TQString & originalword,
const TQString & newword);
488 void slotApplyFont();
489 void slotApplyParag();
490 void slotPageLayoutChanged(
const KoPageLayout& layout );
491 void slotChangeCaseState(
bool b);
492 void slotChangeCutState(
bool b);
493 void slotCorrectWord();
496 void slotDocumentLoadingCompleted();
499 void addVariableActions(
int type,
const TQStringList & texts,
500 TDEActionMenu * parentMenu,
const TQString & menuText );
502 void loadexpressionActions( TDEActionMenu * parentMenu);
504 void createExpressionActions( TDEActionMenu * parentMenu,
const TQString& filename,
int &i ,
bool insertSepar,
const TQMap<TQString, TDEShortcut>& personalShortCut );
506 void showParagraphDialog(
int initialPage = -1,
double initialTabPos = 0.0 );
511 TQPtrList<KoTextFormatInterface> applicableTextInterfaces()
const;
515 virtual void resizeEvent( TQResizeEvent *e );
516 virtual void guiActivateEvent( KParts::GUIActivateEvent *ev );
518 virtual void updateReadWrite(
bool readwrite );
524 void updateTableActions( TQValueList<KWFrameView*> selectFrames);
528 void clearSpellChecker(
bool cancelSpellCheck =
false );
530 TQValueList<TQString> getInlineFramesets(
const TQDomNode &framesetElem );
533 enum MoveFrameType { RaiseFrame, LowerFrame, BringToFront, SendToBack };
534 void adjustZOrderOfSelectedFrames(MoveFrameType moveType);
535 void increaseAllZOrdersAbove(
int refZOrder,
int pageNum,
const TQPtrList<KWFrame>& frameSelection);
536 void decreaseAllZOrdersUnder(
int refZOrder,
int pageNum,
const TQPtrList<KWFrame>& frameSelection);
537 int raiseFrame(
const TQPtrList<KWFrame>& frameSelection,
const KWFrame *frame);
538 int lowerFrame(
const TQPtrList<KWFrame>& frameSelection,
const KWFrame *frame);
539 int bringToFront(
const TQPtrList<KWFrame>& frameSelection,
const KWFrame *frame);
540 int sendToBack(
const TQPtrList<KWFrame>& frameSelection,
const KWFrame *frame);
541 void textStyleSelected( KoParagStyle *sty );
544 void changeFootEndNoteState();
545 void refreshDeletePageAction();
547 void spellCheckerRemoveHighlight();
549 void setSpacing( KoParagLayout::SpacingType spacing,
const TQString &commandName );
552 void deleteSelectedFrames();
553 void borderChanged(KoBorder::BorderType type);
554 void updateZoomControls();
559 TDEAction *m_actionFileStatistics;
560 TDEAction *m_actionEditCut;
561 TDEAction *m_actionEditCopy;
562 TDEAction *m_actionEditPaste;
563 TDEAction *m_actionEditSelectAll;
564 TDEAction *m_actionEditSelectCurrentFrame;
565 TDEAction *m_actionEditDelFrame;
566 TDEAction *m_actionCreateLinkedFrame;
567 TDEAction *m_actionRaiseFrame;
568 TDEAction *m_actionLowerFrame;
569 TDEAction *m_actionSendBackward;
570 TDEAction *m_actionBringToFront;
572 TDEAction *m_actionEditCustomVars;
573 TDEAction *m_actionEditCustomVarsEdit;
574 TDEAction *m_actionEditFind;
575 TDEAction *m_actionEditFindNext;
576 TDEAction *m_actionEditFindPrevious;
577 TDEAction *m_actionEditReplace;
578 TDEAction *m_actionApplyAutoFormat;
580 TDEToggleAction *m_actionViewTextMode;
581 TDEToggleAction *m_actionViewPageMode;
582 TDEToggleAction *m_actionViewPreviewMode;
584 TDEToggleAction *m_actionViewFormattingChars;
585 TDEToggleAction *m_actionViewFrameBorders;
586 TDEToggleAction *m_actionViewHeader;
587 TDEToggleAction *m_actionViewFooter;
588 TDEToggleAction *m_actionViewFootNotes;
589 TDEToggleAction *m_actionViewEndNotes;
590 TDEToggleAction *m_actionShowDocStruct;
591 TDEToggleAction *m_actionShowRuler;
592 TDEToggleAction *m_actionViewShowGrid;
593 TDEToggleAction *m_actionViewSnapToGrid;
594 TDEToggleAction *m_actionAllowAutoFormat;
596 TDEToggleAction *m_actionAllowBgSpellCheck;
598 TDESelectAction *m_actionViewZoom;
600 TDEAction *m_actionInsertFrameBreak;
601 TDEAction *m_actionInsertFootEndNote;
602 TDEAction *m_actionInsertContents;
603 TDEAction *m_actionInsertLink;
604 TDEAction *m_actionInsertComment;
605 TDEAction *m_actionEditComment;
606 TDEAction *m_actionRemoveComment;
607 TDEAction *m_actionCopyTextOfComment;
609 TDEAction *m_actionDeletePage;
611 TDEActionMenu *actionInsertVariable;
616 typedef TQMap<TDEAction *, VariableDef> VariableDefMap;
617 TDEActionMenu *m_actionInsertExpression;
619 TDEActionMenu *m_actionInsertCustom;
621 VariableDefMap m_variableDefMap;
622 TDEAction *m_actionInsertFormula;
623 TDEAction *m_actionInsertTable;
624 TDEAction *m_actionAutoFormat;
626 TDEToggleAction *m_actionToolsCreateText;
627 TDEToggleAction *m_actionToolsCreatePix;
628 KoPartSelectAction *m_actionToolsCreatePart;
630 TDEAction *m_actionFormatFont;
631 TDEAction *m_actionFormatDefault;
632 TDEAction *m_actionFormatFrameStylist;
633 TDEAction *m_actionFormatStylist;
634 TDEAction *m_actionFormatPage;
636 TDEAction *m_actionFontSizeIncrease;
637 TDEAction *m_actionFontSizeDecrease;
639 TDEFontSizeAction *m_actionFormatFontSize;
640 TDEFontAction *m_actionFormatFontFamily;
641 TDESelectAction *m_actionFormatStyle;
642 TDEActionMenu *m_actionFormatStyleMenu;
643 TDEToggleAction *m_actionFormatBold;
644 TDEToggleAction *m_actionFormatItalic;
645 TDEToggleAction *m_actionFormatUnderline;
646 TDEToggleAction *m_actionFormatStrikeOut;
647 TTDESelectColorAction *m_actionFormatColor;
648 TDEToggleAction *m_actionFormatAlignLeft;
649 TDEToggleAction *m_actionFormatAlignCenter;
650 TDEToggleAction *m_actionFormatAlignRight;
651 TDEToggleAction *m_actionFormatAlignBlock;
652 TDEToggleAction *m_actionFormatSpacingSingle;
653 TDEToggleAction *m_actionFormatSpacingOneAndHalf;
654 TDEToggleAction *m_actionFormatSpacingDouble;
655 TDEAction *m_actionFormatParag;
656 TDEAction *m_actionFormatFrameSet;
657 TDEAction *m_actionFormatIncreaseIndent;
658 TDEAction *m_actionFormatDecreaseIndent;
659 TDEActionMenu *m_actionFormatBullet;
660 TDEActionMenu *m_actionFormatNumber;
661 TDEToggleAction *m_actionFormatSuper;
662 TDEToggleAction *m_actionFormatSub;
663 TDEAction* m_actionInsertSpecialChar;
666 TDESelectAction *m_actionFrameStyle;
667 TDEActionMenu *m_actionFrameStyleMenu;
668 TDESelectAction *m_actionTableStyle;
669 TDEActionMenu *m_actionTableStyleMenu;
670 TDEToggleAction *m_actionBorderLeft;
671 TDEToggleAction *m_actionBorderRight;
672 TDEToggleAction *m_actionBorderTop;
673 TDEToggleAction *m_actionBorderBottom;
674 TDEToggleAction *m_actionBorderOutline;
675 TTDESelectColorAction *m_actionBorderColor;
676 TDESelectAction *m_actionBorderWidth;
677 TDESelectAction *m_actionBorderStyle;
678 TTDESelectColorAction *m_actionBackgroundColor;
680 TDEAction *m_actionTableDelRow;
681 TDEAction *m_actionTableDelCol;
682 TDEAction *m_actionTableInsertRow;
683 TDEAction *m_actionTableInsertCol;
684 TDEAction *m_actionTableResizeCol;
685 TDEAction *m_actionTableJoinCells;
686 TDEAction *m_actionTableSplitCells;
687 TDEAction *m_actionConvertTableToText;
688 TDEAction *m_actionSortText;
689 TDEAction *m_actionAddPersonalExpression;
690 TDEToggleAction *m_actionTableProtectCells;
692 TDEAction *m_actionTableUngroup;
693 TDEAction *m_actionTableDelete;
695 TDEAction *m_actionTableStylist;
696 TDEAction *m_actionTablePropertiesMenu;
697 TDEAction *m_actionTableProperties;
699 TDEAction *m_actionExtraCreateTemplate;
701 TDEAction *m_actionChangeCase;
703 TDEAction *m_actionEditPersonnalExpr;
705 TDEAction *m_actionConfigure;
707 TDEAction *m_actionConfigureCompletion;
709 TDEAction *m_actionSavePicture;
711 TDEAction *m_actionConfigureHeaderFooter;
712 TDEToggleAction *m_actionInlineFrame;
714 TDEAction *m_actionOpenLink;
715 TDEAction *m_actionChangeLink;
716 TDEAction *m_actionCopyLink;
717 TDEAction *m_actionAddLinkToBookmak;
718 TDEAction *m_actionRemoveLink;
720 TDEAction *m_actionRefreshAllVariable;
721 TDEAction *m_actionCreateStyleFromSelection;
723 TDEAction *m_actionConfigureFootEndNote;
725 TDEAction *m_actionEditFootEndNote;
727 TDEAction *m_actionChangeFootNoteType;
729 TDEAction *m_actionGoToFootEndNote;
732 TDEAction *m_actionDocStructEdit;
733 TDEAction *m_actionDocStructSpeak;
734 TDEAction *m_actionDocStructSelect;
735 TDEAction *m_actionDocStructDelete;
736 TDEAction *m_actionDocStructProperties;
738 TDEAction *m_actionInsertFile;
740 TDEAction *m_actionAddBookmark;
741 TDEAction *m_actionSelectBookmark;
743 TDEAction *m_actionImportStyle;
745 TDEAction *m_actionCreateFrameStyle;
747 TDEAction *m_actionConvertToTextBox;
749 TDEAction *m_actionSpellIgnoreAll;
750 TDEAction *m_actionSpellCheck;
752 TDEToggleAction *m_actionEmbeddedStoreInternal;
754 TDEAction *m_actionAddWordToPersonalDictionary;
756 TDEToggleAction *m_actionInsertDirectCursor;
758 TDEAction *m_actionGoToDocumentStructure;
759 TDEAction *m_actionGoToDocument;
762 KoCharSelectDia *m_specialCharDlg;
763 KoFontDia *m_fontDlg;
764 KoParagDia *m_paragDlg;
770 KoSearchContext *m_searchEntry, *m_replaceEntry;
773 TQPtrList<TDEAction> m_actionList;
774 TQPtrList<TDEAction> m_variableActionList;
775 TQPtrList<TDEAction> m_tableActionList;
780 KStatusBarLabel* m_sbPageLabel;
781 KStatusBarLabel* m_sbModifiedLabel;
782 KStatusBarLabel* m_sbFramesLabel;
783 KStatusBarLabel* m_sbOverwriteLabel;
784 KStatusBarLabel* m_sbUnitLabel;
785 KStatusBarLabel* m_sbZoomLabel;
788 struct KWZoomValueStore {
790 KoZoomMode::Mode m_zoomMode;
792 KWZoomValueStore m_zoomViewModeNormal;
793 KWZoomValueStore m_zoomViewModePreview;
795 bool m_viewFrameBorders ;
800 KMacroCommand * macroCmdSpellCheck;
801 TQStringList replaceAll;
802 KoTextIterator * textIterator;
803 KSpell2::Dialog *dlg;
805 KSpell2::Broker::Ptr m_broker;
812 unsigned int columns, rows;
819class KWViewWidget :
public TQWidget
825 KWViewWidget( TQWidget *parent, KWView *view );
828 void resizeEvent( TQResizeEvent *e );
838class KWGUI :
public TQHBox
844 KWGUI(
const TQString& viewMode, TQWidget *parent, KWView *view );
848 KWView *getView()
const {
return m_view; }
849 KWCanvas *canvasWidget()
const {
return m_canvas; }
850 KoRuler *getVertRuler()
const {
return m_vertRuler; }
851 KoRuler *getHorzRuler()
const {
return m_horRuler; }
852 KoTabChooser *getTabChooser()
const {
return m_tabChooser; }
853 KWDocStruct *getDocStruct()
const {
return m_docStruct; }
859 void unitChanged( KoUnit::Unit );
862 void resizeEvent( TQResizeEvent *e );
868 KWDocStruct *m_docStruct;
873 KoTabChooser *m_tabChooser;
874 KoRuler *m_vertRuler;
878 TQSplitter *m_panner;
Class: KWCanvas This class is responsible for the rendering of the frames to the screen as well as th...
This class implements the 'find' functionality ( the "search next, prompt" loop ) and the 'replace' f...
Class: KWFrameSet Base type, a frameset holds content as well as frames to show that content.
The user-visible style for frames (borders and background)
Class that knows about all the (visible) frames in the document and will act as a manager between the...
an instance of a KWFrameView represents the view in the MVC model of a frame; there can be multiple K...
This class represents a single frame.
This class represents a printed page of the document.
This class implements tables by acting as the manager for the frame(set)s which make up the table cel...
Table style (can created/modified/deleted by the user) A table style is simply a paragraph style and ...
Object that is created to edit a Text frame set (KWTextFrameSet).
This class extends KoTextParag for KWord-specific formatting stuff, custom items, loading and saving.
Abstract base class for KWCanvas's view modes.