kword

KWView.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003    Copyright (C) 2005 Thomas Zander <zander@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 kwview_h
00022 #define kwview_h
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027 
00028 #include <kprinter.h>
00029 
00030 #include <KoBorder.h>
00031 #include "defs.h"
00032 #include "KWTextParag.h"
00033 
00034 #include <KoPageLayoutDia.h>
00035 #include <KoView.h>
00036 #include <KoPoint.h>
00037 #include <kshortcut.h>
00038 #include <KoZoomMode.h>
00039 
00040 #include <qbrush.h>
00041 #include <qhbox.h>
00042 
00043 class KWPage;
00044 class KWViewMode;
00045 class KWDocStruct;
00046 class KWCanvas;
00047 class KWDocument;
00048 class KWGUI;
00049 class KWFrame;
00050 class KWFrameView;
00051 class KWFrameViewManager;
00052 class KWTextFrameSetEdit;
00053 class KMacroCommand;
00054 class KWFrameSet;
00055 class KWFindReplace;
00056 class KWFrameStyle;
00057 class KWTableStyle;
00058 class KWTableFrameSet;
00059 
00060 class KoPicture;
00061 class KoSearchContext;
00062 class KoTextFormatInterface;
00063 class KoRuler;
00064 class TKSelectColorAction;
00065 class KoPartSelectAction;
00066 class KoCharSelectDia;
00067 class KoTextFormat;
00068 class KoFontDia;
00069 class KoParagDia;
00070 class KoTextIterator;
00071 
00072 class DCOPObject;
00073 class KStatusBarLabel;
00074 class KoSpell;
00075 class KURL;
00076 class KAction;
00077 class KActionMenu;
00078 class KSelectAction;
00079 class KToggleAction;
00080 class KFontSizeAction;
00081 class KFontAction;
00082 class QResizeEvent;
00083 class QSplitter;
00084 
00085 #include <kspell2/broker.h>
00086 namespace KSpell2 {
00087     class Dialog;
00088 }
00089 
00090 
00091 /******************************************************************/
00092 /* Class: KWView                                                  */
00093 /******************************************************************/
00094 
00095 class KWView : public KoView
00096 {
00097     Q_OBJECT
00098 
00099 public:
00100     KWView( const QString& viewMode, QWidget *parent, const char *name, KWDocument *doc );
00101     virtual ~KWView();
00102 
00103     virtual DCOPObject* dcopObject();
00104 
00105     // Those methods update the UI (from the given formatting info)
00106     // They do NOT do anything to the text
00107     void showFormat( const KoTextFormat &currentFormat );
00108     void showAlign( int align );
00109     void showCounter( KoParagCounter &c );
00110     void showSpacing( int spacing );
00118     void updateBorderButtons( const KoBorder& left, const KoBorder& right,
00119                           const KoBorder& top, const KoBorder& bottom );
00120 
00121     void showStyle( const QString & styleName );
00122     void showRulerIndent( double leftMargin, double firstLine, double rightMargin, bool rtl );
00123     void showZoom( int zoom ); // show a zoom value in the combo
00124     void showZoom( const QString& zoom ); // show a zoom value in the combo
00125     void setZoom( int zoom, bool updateViews ); // change the zoom value
00126 
00127     bool viewFrameBorders() const { return m_viewFrameBorders; }
00128     void setViewFrameBorders(bool b);
00129 
00133     KSpell2::Broker *broker() const;
00134 
00135     void setNoteType(NoteType nt, bool change=true);
00136 
00137     KWDocument *kWordDocument()const { return m_doc; }
00138     KWGUI *getGUI()const { return m_gui; }
00139     KWViewMode* viewMode() const;
00140 
00141     void updateStyleList();
00142     void updateFrameStyleList();
00143     void updateTableStyleList();
00144 
00145     void initGui();
00146 
00148     int currentPage() const;
00149 
00153     bool doubleClickActivation() const;
00157     QWidget* canvas() const;
00161     int canvasXOffset() const;
00165     int canvasYOffset() const;
00169     void canvasAddChild( KoViewChild *child );
00170 
00171     virtual void setupPrinter( KPrinter &printer );
00172     virtual void print( KPrinter &printer );
00173 
00174     virtual QPoint applyViewTransformations( const QPoint& ) const;
00175     virtual QPoint reverseViewTransformations( const QPoint& ) const;
00176 
00177     void changeNbOfRecentFiles(int nb);
00178 
00179     void changeZoomMenu( int zoom=-1);
00180 
00181     void refreshMenuExpression();
00182 
00183     void updateGridButton();
00184 
00185     void deleteFrame(bool warning=true);
00186 
00187     QPopupMenu * popupMenu( const QString& name );
00188 
00189     QPtrList<KAction> &dataToolActionList() { return m_actionList; }
00190     QPtrList<KAction> &variableActionList() { return m_variableActionList; }
00191     QPtrList<KAction> &tableActions() { return m_tableActionList; }
00192 
00193     enum { // bitfield
00194         ProvidesImage = 1,
00195         ProvidesPlainText = 2,
00196         ProvidesOasis = 4,
00197         ProvidesFormula = 8
00198     };
00199     static int checkClipboard( QMimeSource *data );
00200 
00201     bool insertInlinePicture();
00202 
00203     void displayFrameInlineInfo();
00204 
00205     void initGUIButton();
00206 
00207     void updateHeaderFooterButton();
00208     void updateFooter();
00209     void updateHeader();
00210     void switchModeView();
00211     void changeFootNoteMenuItem( bool b);
00212     void insertFile(const KURL& url);
00213     void testAndCloseAllFrameSetProtectedContent();
00214     void updateBgSpellCheckingState();
00215     void updateRulerInProtectContentMode();
00216     void deselectAllFrames();
00217     void autoSpellCheck(bool b);
00218     void insertDirectCursor(bool b);
00219     void updateDirectCursorButton();
00220 
00221     void deleteFrameSet( KWFrameSet *);
00222 
00223     QPtrList<KAction> listOfResultOfCheckWord( const QString &word );
00224 
00225     int  tableSelectCell(const QString &tableName, uint row, uint col);
00226     void tableInsertRow(uint row, KWTableFrameSet *table = 0);
00227     void tableInsertCol(uint col, KWTableFrameSet *table = 0);
00228     int tableDeleteRow(const QValueList<uint>& rows, KWTableFrameSet *table = 0);
00229     int tableDeleteCol(const QValueList<uint>& cols, KWTableFrameSet *table = 0);
00230 
00231     void pasteData( QMimeSource* data, bool drop );
00232 
00233     KWFrameViewManager* frameViewManager() const;
00234 
00235 public slots:
00236     void fileStatistics();
00237     void editCut();
00238     void editCopy();
00239     void editPaste();
00240     void editSelectAll();
00241     void editSelectAllFrames();
00242     void editSelectCurrentFrame();
00243     void editFind();
00244     void editFindNext();
00245     void editFindPrevious();
00246     void editReplace();
00247     void editDeleteFrame();
00248     void editCustomVariable();
00249     void editCustomVars();
00250     void editMailMergeDataBase();
00251     void createLinkedFrame();
00252 
00253     void viewTextMode();
00254     void viewPageMode();
00255     void viewPreviewMode();
00256     void slotViewFormattingChars();
00257     void slotViewFrameBorders();
00258     void viewHeader();
00259     void viewFooter();
00260     void viewZoom( const QString &s );
00261     void updateZoom();
00262 
00263     void insertTable();
00264     void insertPicture();
00265     void insertSpecialChar();
00266     void insertFrameBreak();
00267     void insertVariable();
00268     void insertFootNote();
00269     void insertContents();
00270     void insertLink();
00271     void insertComment();
00272     void removeComment();
00273     void copyTextOfComment();
00274 
00275     void insertPage();
00276     void deletePage();
00277 
00278     void formatFont();
00279     void formatParagraph();
00280     void formatPage();
00281     void formatFrameSet();
00282 
00283     void slotSpellCheck();
00284     void extraAutoFormat();
00285     void extraFrameStylist();
00286     void extraStylist();
00287     void extraCreateTemplate();
00288 
00289     void toolsCreateText();
00290     void insertFormula( QMimeSource* source=0 );
00291     void toolsPart();
00292 
00293     void tableProperties();
00294     void tableInsertRow();
00295     void tableInsertCol();
00296     void tableResizeCol();
00297     void tableDeleteRow();
00298     void tableDeleteCol();
00299     void tableJoinCells();
00300     void tableSplitCells();
00301     void tableSplitCells(int col, int row);
00302     void tableProtectCells(bool);
00303     void tableUngroupTable();
00304     void tableDelete();
00305     void tableStylist();
00306     void convertTableToText();
00307     void sortText();
00308     void addPersonalExpression();
00309 
00310     void slotStyleSelected();
00311     void slotFrameStyleSelected();
00312     void slotTableStyleSelected();
00313     void textStyleSelected( int );
00314     void frameStyleSelected( int );
00315     void tableStyleSelected( int );
00316     void textSizeSelected( int );
00317     void increaseFontSize();
00318     void decreaseFontSize();
00319     void textFontSelected( const QString & );
00320     void textBold();
00321     void textItalic();
00322     void textUnderline();
00323     void textStrikeOut();
00324     void textColor();
00325     void textAlignLeft();
00326     void textAlignCenter();
00327     void textAlignRight();
00328     void textAlignBlock();
00329     void textSpacingSingle();
00330     void textSpacingOneAndHalf();
00331     void textSpacingDouble();
00332     void textSuperScript();
00333     void textSubScript();
00334     void textIncreaseIndent();
00335     void textDecreaseIndent();
00336     void textDefaultFormat();
00337     void slotCounterStyleSelected();
00338 
00339     // Text and Frame borders.
00340     void borderOutline();
00341     void borderLeft();
00342     void borderRight();
00343     void borderTop();
00344     void borderBottom();
00345     void backgroundColor();
00346 
00347     void showFormulaToolbar( bool show );
00348 
00349     void configure();
00350     void configureCompletion();
00351 
00352     void newPageLayout( const KoPageLayout &layout );
00353     void newLeftIndent( double leftIndent);
00354     void newFirstIndent( double firstIndent);
00355     void newRightIndent( double rightIndent);
00356 
00357     void clipboardDataChanged();
00358     void tabListChanged( const KoTabulatorList & tabList );
00359 
00360     void updatePageInfo();
00361     void updateFrameStatusBarItem();
00362     void setTemporaryStatusBarText(const QString &text);
00363 
00364     void slotSpecialChar(QChar , const QString &);
00365     void slotFrameSetEditChanged();
00366     void showMouseMode( int /*KWCanvas::MouseMode*/ mouseMode );
00367     void frameSelectedChanged();
00368     void docStructChanged(int type);
00369     void documentModified( bool );
00370     void changeOverwriteMode( bool );
00371     void slotHRulerDoubleClicked();
00372     void slotHRulerDoubleClicked( double );
00373     void slotUnitChanged(KoUnit::Unit);
00374 
00375     void numPagesChanged();
00376 
00377     void insertExpression();
00378 
00379     void updateTocActionText(bool hasToc);
00380 
00381     void changeCaseOfText();
00382 
00383     void editPersonalExpr();
00384 
00385     void slotUpdateRuler();
00386     void slotEmbedImage( const QString &filename );
00387 
00388     void insertCustomVariable();
00389     void insertNewCustomVariable();
00390     void slotSpecialCharDlgClosed();
00391 
00392     void refreshCustomMenu();
00393 
00394     void changePicture();
00395 
00396     void configureHeaderFooter();
00397 
00398     void inlineFrame();
00399 
00401     void raiseFrame() { adjustZOrderOfSelectedFrames(RaiseFrame); };
00403     void lowerFrame() { adjustZOrderOfSelectedFrames(LowerFrame); };
00405     void bringToFront() { adjustZOrderOfSelectedFrames(BringToFront); };
00407     void sendToBack() { adjustZOrderOfSelectedFrames(SendToBack); };
00408 
00409     void openLink();
00410     void changeLink();
00411     void copyLink();
00412     void removeLink();
00413     void addToBookmark();
00414     void editComment();
00415     void showDocStructure();
00416     void showRuler();
00417     void viewGrid();
00418     void viewSnapToGrid();
00419 
00420     void slotSoftHyphen();
00421     void slotLineBreak();
00422     void slotNonbreakingSpace();
00423     void slotNonbreakingHyphen();
00424 
00425     void slotIncreaseNumberingLevel();
00426     void slotDecreaseNumberingLevel();
00427 
00428     void refreshAllVariable();
00429 
00430     void slotAllowAutoFormat();
00431 
00432     void slotCompletion();
00433 
00434     void applyAutoFormat();
00435     void createStyleFromSelection();
00436 
00437     void configureFootEndNote();
00438     void editFootEndNote();
00439     void changeFootNoteType();
00440     void savePicture();
00441 
00442     void autoSpellCheck();
00443     void goToFootEndNote();
00444 
00445     // Document Structure Area popup menu.
00446     void docStructEdit();
00447     void docStructSpeak();
00448     void docStructSelect();
00449     void docStructDelete();
00450     void docStructProperties();
00451     void openDocStructurePopupMenu( const QPoint &p, KWFrameSet *frameset, KWTextParag *parag);
00452 
00453     void insertFile();
00454 
00455     void addBookmark();
00456     void selectBookmark();
00457     void importStyle();
00458 
00459     void createFrameStyle();
00460 
00461     void insertDirectCursor();
00462 
00463     void convertToTextBox();
00464 
00465     void slotAddIgnoreAllWord();
00466 
00467     void embeddedStoreInternal();
00468 
00469     void goToDocumentStructure();
00470     void goToDocument();
00471 
00472     void addWordToDictionary();
00473 
00474     void insertPicture( const KoPicture& picture, const bool makeInline, const bool keepRatio, int suggestedWidth, int suggestedHeight );
00475 
00476     // end of public methods
00477 protected slots:
00478     virtual void slotChildActivated( bool a ); 
00479     void slotSetInitialPosition();
00480 
00481     void spellCheckerMisspelling( const QString &, int );
00482     void spellCheckerCorrected( const QString &, int, const QString & );
00483     void spellCheckerDone( const QString & );
00484     void spellCheckerCancel();
00485 
00486     void spellAddAutoCorrect (const QString & originalword, const QString & newword);
00487     void slotApplyFont();
00488     void slotApplyParag();
00489     void slotPageLayoutChanged( const KoPageLayout& layout );
00490     void slotChangeCaseState(bool b);
00491     void slotChangeCutState(bool b);
00492     void slotCorrectWord();
00493 
00495     void slotDocumentLoadingCompleted();
00496 
00497 protected:
00498     void addVariableActions( int type, const QStringList & texts,
00499                              KActionMenu * parentMenu, const QString & menuText );
00500 
00501     void loadexpressionActions( KActionMenu * parentMenu);
00502 
00503     void createExpressionActions( KActionMenu * parentMenu,const QString& filename,int &i , bool insertSepar, const QMap<QString, KShortcut>& personalShortCut );
00504 
00505     void showParagraphDialog( int initialPage = -1, double initialTabPos = 0.0 );
00506 
00507     KWTextFrameSetEdit *currentTextEdit() const;
00510     QPtrList<KoTextFormatInterface> applicableTextInterfaces() const;
00511 
00512     void setupActions();
00513 
00514     virtual void resizeEvent( QResizeEvent *e );
00515     virtual void guiActivateEvent( KParts::GUIActivateEvent *ev );
00516 
00517     virtual void updateReadWrite( bool readwrite );
00523     void updateTableActions( QValueList<KWFrameView*> selectFrames);
00524 
00525 
00526     void startKSpell();
00527     void clearSpellChecker(bool cancelSpellCheck = false );
00528 
00529     QValueList<QString> getInlineFramesets( const QDomNode &framesetElem );
00530 
00531     // Helper stuff for the frame adjustment;
00532     enum MoveFrameType  { RaiseFrame, LowerFrame, BringToFront, SendToBack };
00533     void adjustZOrderOfSelectedFrames(MoveFrameType moveType);
00534     void increaseAllZOrdersAbove(int refZOrder, int pageNum, const QPtrList<KWFrame>& frameSelection);
00535     void decreaseAllZOrdersUnder(int refZOrder, int pageNum, const QPtrList<KWFrame>& frameSelection);
00536     int raiseFrame(const QPtrList<KWFrame>& frameSelection, const KWFrame *frame);
00537     int lowerFrame(const QPtrList<KWFrame>& frameSelection, const KWFrame *frame);
00538     int bringToFront(const QPtrList<KWFrame>& frameSelection, const KWFrame *frame);
00539     int sendToBack(const QPtrList<KWFrame>& frameSelection, const KWFrame *frame);
00540     void textStyleSelected( KoParagStyle *sty );
00541     void frameStyleSelected( KWFrameStyle *sty );
00542     void tableStyleSelected( KWTableStyle *sty );
00543     void changeFootEndNoteState();
00544     void refreshDeletePageAction();
00545 
00546     void spellCheckerRemoveHighlight();
00547 
00548     void setSpacing( KoParagLayout::SpacingType spacing, const QString &commandName );
00549 
00550 private:  // methods
00551     void deleteSelectedFrames();
00552     void borderChanged(KoBorder::BorderType type);
00553     void updateZoomControls();
00554 
00555 private: // variables
00556     KWDocument *m_doc;
00557 
00558     KAction *m_actionFileStatistics;
00559     KAction *m_actionEditCut;
00560     KAction *m_actionEditCopy;
00561     KAction *m_actionEditPaste;
00562     KAction *m_actionEditSelectAll;
00563     KAction *m_actionEditSelectCurrentFrame;
00564     KAction *m_actionEditDelFrame;
00565     KAction *m_actionCreateLinkedFrame;
00566     KAction *m_actionRaiseFrame;
00567     KAction *m_actionLowerFrame;
00568     KAction *m_actionSendBackward;
00569     KAction *m_actionBringToFront;
00570 
00571     KAction *m_actionEditCustomVars;
00572     KAction *m_actionEditCustomVarsEdit;
00573     KAction *m_actionEditFind;
00574     KAction *m_actionEditFindNext;
00575     KAction *m_actionEditFindPrevious;
00576     KAction *m_actionEditReplace;
00577     KAction *m_actionApplyAutoFormat;
00578 
00579     KToggleAction *m_actionViewTextMode;
00580     KToggleAction *m_actionViewPageMode;
00581     KToggleAction *m_actionViewPreviewMode;
00582 
00583     KToggleAction *m_actionViewFormattingChars;
00584     KToggleAction *m_actionViewFrameBorders;
00585     KToggleAction *m_actionViewHeader;
00586     KToggleAction *m_actionViewFooter;
00587     KToggleAction *m_actionViewFootNotes;
00588     KToggleAction *m_actionViewEndNotes;
00589     KToggleAction *m_actionShowDocStruct;
00590     KToggleAction *m_actionShowRuler;
00591     KToggleAction *m_actionViewShowGrid;
00592     KToggleAction *m_actionViewSnapToGrid;
00593     KToggleAction *m_actionAllowAutoFormat;
00594 
00595     KToggleAction *m_actionAllowBgSpellCheck;
00596 
00597     KSelectAction *m_actionViewZoom;
00598 
00599     KAction *m_actionInsertFrameBreak;
00600     KAction *m_actionInsertFootEndNote;
00601     KAction *m_actionInsertContents;
00602     KAction *m_actionInsertLink;
00603     KAction *m_actionInsertComment;
00604     KAction *m_actionEditComment;
00605     KAction *m_actionRemoveComment;
00606     KAction *m_actionCopyTextOfComment;
00607     //KAction *actionInsertPage;
00608     KAction *m_actionDeletePage;
00609 
00610     KActionMenu *actionInsertVariable;
00611     struct VariableDef {
00612         int type;
00613         int subtype;
00614     };
00615     typedef QMap<KAction *, VariableDef> VariableDefMap;
00616     KActionMenu *m_actionInsertExpression;
00617 
00618     KActionMenu *m_actionInsertCustom;
00619 
00620     VariableDefMap m_variableDefMap;
00621     KAction *m_actionInsertFormula;
00622     KAction *m_actionInsertTable;
00623     KAction *m_actionAutoFormat;
00624 
00625     KToggleAction *m_actionToolsCreateText;
00626     KToggleAction *m_actionToolsCreatePix;
00627     KoPartSelectAction *m_actionToolsCreatePart;
00628 
00629     KAction *m_actionFormatFont;
00630     KAction *m_actionFormatDefault;
00631     KAction *m_actionFormatFrameStylist;
00632     KAction *m_actionFormatStylist;
00633     KAction *m_actionFormatPage;
00634 
00635     KAction *m_actionFontSizeIncrease;
00636     KAction *m_actionFontSizeDecrease;
00637 
00638     KFontSizeAction *m_actionFormatFontSize;
00639     KFontAction *m_actionFormatFontFamily;
00640     KSelectAction *m_actionFormatStyle;
00641     KActionMenu *m_actionFormatStyleMenu;
00642     KToggleAction *m_actionFormatBold;
00643     KToggleAction *m_actionFormatItalic;
00644     KToggleAction *m_actionFormatUnderline;
00645     KToggleAction *m_actionFormatStrikeOut;
00646     TKSelectColorAction *m_actionFormatColor;
00647     KToggleAction *m_actionFormatAlignLeft;
00648     KToggleAction *m_actionFormatAlignCenter;
00649     KToggleAction *m_actionFormatAlignRight;
00650     KToggleAction *m_actionFormatAlignBlock;
00651     KToggleAction *m_actionFormatSpacingSingle;
00652     KToggleAction *m_actionFormatSpacingOneAndHalf;
00653     KToggleAction *m_actionFormatSpacingDouble;
00654     KAction *m_actionFormatParag;
00655     KAction *m_actionFormatFrameSet;
00656     KAction *m_actionFormatIncreaseIndent;
00657     KAction *m_actionFormatDecreaseIndent;
00658     KActionMenu *m_actionFormatBullet;
00659     KActionMenu *m_actionFormatNumber;
00660     KToggleAction *m_actionFormatSuper;
00661     KToggleAction *m_actionFormatSub;
00662     KAction* m_actionInsertSpecialChar;
00663 
00664     // Text and Frame borders.
00665     KSelectAction *m_actionFrameStyle;
00666     KActionMenu *m_actionFrameStyleMenu;
00667     KSelectAction *m_actionTableStyle;
00668     KActionMenu *m_actionTableStyleMenu;
00669     KToggleAction *m_actionBorderLeft;
00670     KToggleAction *m_actionBorderRight;
00671     KToggleAction *m_actionBorderTop;
00672     KToggleAction *m_actionBorderBottom;
00673     KToggleAction *m_actionBorderOutline;
00674     TKSelectColorAction *m_actionBorderColor;
00675     KSelectAction *m_actionBorderWidth;
00676     KSelectAction *m_actionBorderStyle;
00677     TKSelectColorAction *m_actionBackgroundColor;
00678 
00679     KAction *m_actionTableDelRow;
00680     KAction *m_actionTableDelCol;
00681     KAction *m_actionTableInsertRow;
00682     KAction *m_actionTableInsertCol;
00683     KAction *m_actionTableResizeCol;
00684     KAction *m_actionTableJoinCells;
00685     KAction *m_actionTableSplitCells;
00686     KAction *m_actionConvertTableToText;
00687     KAction *m_actionSortText;
00688     KAction *m_actionAddPersonalExpression;
00689     KToggleAction *m_actionTableProtectCells;
00690 
00691     KAction *m_actionTableUngroup;
00692     KAction *m_actionTableDelete;
00693 
00694     KAction *m_actionTableStylist;
00695     KAction *m_actionTablePropertiesMenu;
00696     KAction *m_actionTableProperties;
00697 
00698     KAction *m_actionExtraCreateTemplate;
00699 
00700     KAction *m_actionChangeCase;
00701 
00702     KAction *m_actionEditPersonnalExpr;
00703 
00704     KAction *m_actionConfigure;
00705 
00706     KAction *m_actionConfigureCompletion;
00707 
00708     KAction *m_actionSavePicture;
00709 
00710     KAction *m_actionConfigureHeaderFooter;
00711     KToggleAction *m_actionInlineFrame;
00712 
00713     KAction *m_actionOpenLink;
00714     KAction *m_actionChangeLink;
00715     KAction *m_actionCopyLink;
00716     KAction *m_actionAddLinkToBookmak;
00717     KAction *m_actionRemoveLink;
00718 
00719     KAction *m_actionRefreshAllVariable;
00720     KAction *m_actionCreateStyleFromSelection;
00721 
00722     KAction *m_actionConfigureFootEndNote;
00723 
00724     KAction *m_actionEditFootEndNote;
00725 
00726     KAction *m_actionChangeFootNoteType;
00727 
00728     KAction *m_actionGoToFootEndNote;
00729 
00730     // Document Structure Area popup menu.
00731     KAction *m_actionDocStructEdit;
00732     KAction *m_actionDocStructSpeak;
00733     KAction *m_actionDocStructSelect;
00734     KAction *m_actionDocStructDelete;
00735     KAction *m_actionDocStructProperties;
00736 
00737     KAction *m_actionInsertFile;
00738 
00739     KAction *m_actionAddBookmark;
00740     KAction *m_actionSelectBookmark;
00741 
00742     KAction *m_actionImportStyle;
00743 
00744     KAction *m_actionCreateFrameStyle;
00745 
00746     KAction *m_actionConvertToTextBox;
00747 
00748     KAction *m_actionSpellIgnoreAll;
00749     KAction *m_actionSpellCheck;
00750 
00751     KToggleAction *m_actionEmbeddedStoreInternal;
00752 
00753     KAction *m_actionAddWordToPersonalDictionary;
00754 
00755     KToggleAction *m_actionInsertDirectCursor;
00756 
00757     KAction *m_actionGoToDocumentStructure;
00758     KAction *m_actionGoToDocument;
00759 
00760 
00761     KoCharSelectDia *m_specialCharDlg;
00762     KoFontDia *m_fontDlg;
00763     KoParagDia *m_paragDlg;
00764 
00765     KWGUI *m_gui;
00766 
00767     DCOPObject *m_dcop;
00768 
00769     KoSearchContext *m_searchEntry, *m_replaceEntry;
00770     KWFindReplace *m_findReplace;
00771 
00772     QPtrList<KAction> m_actionList; // for the kodatatools
00773     QPtrList<KAction> m_variableActionList;
00774     QPtrList<KAction> m_tableActionList;
00775 
00776     KWPage *m_currentPage; 
00777 
00778     // Statusbar items
00779     KStatusBarLabel* m_sbPageLabel; 
00780     KStatusBarLabel* m_sbModifiedLabel;
00781     KStatusBarLabel* m_sbFramesLabel; 
00782     KStatusBarLabel* m_sbOverwriteLabel;
00783     KStatusBarLabel* m_sbUnitLabel;
00784     KStatusBarLabel* m_sbZoomLabel;
00785 
00786     // Zoom values for each viewmode ( todo a viewmode enum and a qmap or so )
00787     struct KWZoomValueStore {
00788         int m_zoom;
00789         KoZoomMode::Mode m_zoomMode;
00790     };
00791     KWZoomValueStore m_zoomViewModeNormal;
00792     KWZoomValueStore m_zoomViewModePreview;
00793 
00794     bool m_viewFrameBorders /*, m_viewTableGrid*/;
00795 
00797     struct {
00798         KoSpell *kospell;
00799         KMacroCommand * macroCmdSpellCheck;
00800         QStringList replaceAll;
00801         KoTextIterator * textIterator;
00802         KSpell2::Dialog *dlg;
00803      } m_spell;
00804     KSpell2::Broker::Ptr m_broker;
00805 
00806 
00807     KWFrameSet *m_fsInline;
00808 
00809     // Split cell in table
00810     struct {
00811         unsigned int columns, rows;
00812     } m_tableSplit;
00813 };
00814 
00815 /******************************************************************/
00816 /* Class: KWViewWidget                                            */
00817 /******************************************************************/
00818 class KWViewWidget : public QWidget
00819 {
00820     Q_OBJECT
00821 
00822 public:
00823     KWViewWidget( QWidget *parent, KWView *view );
00824 
00825 protected:
00826     void resizeEvent( QResizeEvent *e );
00827 
00828     // A pointer to the view.
00829     KWView          *m_view;
00830 };
00831 
00832 /******************************************************************/
00833 /* Class: KWGUI                                                   */
00834 /******************************************************************/
00835 
00836 class KWGUI : public QHBox
00837 {
00838     Q_OBJECT
00839 
00840 public:
00841     KWGUI( const QString& viewMode, QWidget *parent, KWView *view );
00842 
00843     void showGUI();
00844 
00845     KWView *getView()const { return m_view; }
00846     KWCanvas *canvasWidget()const { return m_canvas; }
00847     KoRuler *getVertRuler()const { return m_vertRuler; }
00848     KoRuler *getHorzRuler()const { return m_horRuler; }
00849     KoTabChooser *getTabChooser()const { return m_tabChooser; }
00850     KWDocStruct *getDocStruct()const { return m_docStruct; }
00851 
00852 public slots:
00853     void reorganize();
00854 
00855 protected slots:
00856     void unitChanged( KoUnit::Unit );
00857 
00858 protected:
00859     void resizeEvent( QResizeEvent *e );
00860 
00861     // A pointer to the view.
00862     KWView          *m_view;
00863 
00864     // The left side
00865     KWDocStruct     *m_docStruct;
00866 
00867     // The right side
00868     QWidget         *m_right;   // The layout widget.
00869 
00870     KoTabChooser    *m_tabChooser;
00871     KoRuler         *m_vertRuler;
00872     KoRuler         *m_horRuler;
00873     KWCanvas        *m_canvas;
00874 
00875     QSplitter       *m_panner;
00876 
00877 };
00878 
00879 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys