kspread_view.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef KSPREAD_VIEW
00028 #define KSPREAD_VIEW
00029
00030 #include <qpoint.h>
00031 #include <qptrlist.h>
00032 #include <qstringlist.h>
00033 #include <qvaluelist.h>
00034
00035 #include <koView.h>
00036
00037 class QScrollBar;
00038
00039 class KoDocumentEntry;
00040 class KoTabBar;
00041
00042 class KSpreadCanvas;
00043 class KSpreadCell;
00044 class KSpreadChild;
00045 class KSpreadDoc;
00046 class KSpreadEditWidget;
00047 class KSpreadHBorder;
00048 class KSpreadLocationEditWidget;
00049 class KSpreadSelection;
00050 class KSpreadSheet;
00051 class KSpreadVBorder;
00052 class KSpreadView;
00053 class KSpreadComboboxLocationEditWidget;
00054 class ViewPrivate;
00055
00056 namespace KSpread
00057 {
00058 class Damage;
00059 }
00060
00079 class KSPREAD_EXPORT KSpreadView : public KoView
00080 {
00081 friend class KSpreadCanvas;
00082
00083 Q_OBJECT
00084 public:
00085
00087 KSpreadView( QWidget *_parent, const char *_name,
00088 KSpreadDoc *doc );
00089
00091 ~KSpreadView();
00092
00093 KSpreadDoc* doc();
00094
00096 KSpreadCanvas* canvasWidget() const;
00097
00099 KSpreadHBorder* hBorderWidget() const;
00100
00102 KSpreadVBorder* vBorderWidget() const;
00103
00105 QScrollBar* horzScrollBar() const;
00106
00108 QScrollBar* vertScrollBar() const;
00109
00111 KSpreadEditWidget* editWidget() const;
00112
00114 KSpreadComboboxLocationEditWidget* posWidget() const;
00115
00117 KoTabBar* tabBar() const;
00118
00119 void setZoom( int zoom, bool updateViews );
00120
00121 void addSheet( KSpreadSheet *_t );
00122
00123 void removeAllSheets();
00124 void setActiveSheet( KSpreadSheet *_t,bool updatesheet=true );
00125
00126 const KSpreadSheet* activeSheet() const;
00127 KSpreadSheet* activeSheet();
00128
00129 void openPopupMenu( const QPoint &_global );
00130 void popupRowMenu(const QPoint & _point ) ;
00131 void popupColumnMenu( const QPoint & _point);
00132
00133
00134
00138 void setText( const QString& _text );
00139
00140 void enableUndo( bool _b );
00141 void enableRedo( bool _b );
00142 void enableInsertColumn( bool _b );
00143 void enableInsertRow( bool _b );
00144
00150 void insertChart( const QRect& _geometry, KoDocumentEntry& _entry );
00156 void insertChild( const QRect& _geometry, KoDocumentEntry& _entry );
00157
00158 virtual void print( KPrinter &printer );
00159 virtual void setupPrinter( KPrinter &printer );
00160
00166 void updateEditWidget();
00170 void updateEditWidgetOnPress();
00171
00172
00176 void deleteEditor( bool saveChanges = true );
00177 void closeEditor();
00178 virtual DCOPObject* dcopObject();
00179
00180 virtual QWidget *canvas();
00181 virtual int canvasXOffset() const;
00182 virtual int canvasYOffset() const;
00183
00187 KoDocument *hitTest( const QPoint &pos );
00188
00189
00190 void initConfig();
00191
00196 bool isLoading() const;
00197
00201 void resultOfCalc();
00202
00203 void initCalcMenu();
00204
00205 void changeNbOfRecentFiles(int _nb);
00206
00207 void updateBorderButton();
00208
00209 void removeSheet( KSpreadSheet *_t );
00210 void insertSheet( KSpreadSheet* sheet );
00211 QColor borderColor() const;
00212
00213 KSpreadSelection* selectionInfo() const;
00214 QRect selection(bool extend = true) const;
00215 QPoint marker() const;
00216
00217 void updateShowSheetMenu();
00218
00222 void paintUpdates();
00223
00227 void resetInsertHandle();
00228
00229 bool showSheet(const QString& sheetName);
00230
00231 QPoint markerFromSheet( KSpreadSheet *_sheet ) const;
00232
00233
00234
00235 void saveCurrentSheetSelection();
00236
00237 public slots:
00241 void refreshView();
00242 void initialPosition();
00246 void createTemplate();
00247 void transformPart();
00248 void copySelection();
00249 void cutSelection();
00250 void deleteSelection();
00251 void clearTextSelection();
00252 void clearCommentSelection();
00253 void clearValiditySelection();
00254 void clearConditionalSelection();
00255 void fillRight();
00256 void fillLeft();
00257 void fillUp();
00258 void fillDown();
00259 void recalcWorkBook();
00260 void recalcWorkSheet();
00261 void paste();
00262 void specialPaste();
00263 void editCell();
00264 void setAreaName();
00265 void showAreaName();
00266 void adjust();
00267 void defaultSelection();
00268 void paperLayoutDlg();
00269 void styleDialog();
00270 void definePrintRange();
00271 void resetPrintRange();
00272 void insertObject();
00273 void insertFromDatabase();
00274 void insertFromTextfile();
00275 void insertFromClipboard();
00276 void insertSpecialChar();
00277 void togglePageBorders( bool );
00278 void toggleProtectSheet( bool );
00279 void toggleProtectDoc( bool );
00280 void viewZoom( const QString & );
00281 void find();
00282 void findNext();
00283 void findPrevious();
00284 void replace();
00285 void conditional();
00286 void validity();
00287 void insertSeries();
00288 void sort();
00289 void insertHyperlink();
00290 void removeHyperlink();
00291 void goalSeek();
00292 void multipleOperations();
00293 void subtotals();
00294 void textToColumns();
00295 void consolidate();
00296 void insertSheet();
00297 void removeSheet();
00298 void hideSheet();
00299 void showSheet();
00300 void helpUsing();
00301 void insertChart();
00302 void moneyFormat(bool b);
00303 void alignLeft( bool b );
00304 void alignRight( bool b );
00305 void alignCenter( bool b );
00306 void alignTop( bool b );
00307 void alignMiddle( bool b );
00308 void alignBottom( bool b );
00309 void wrapText( bool b );
00310 void precisionMinus();
00311 void precisionPlus();
00312 void createStyleFromCell();
00313 void styleSelected( const QString & );
00314 void setSelectionPrecision(int delta);
00315 void percent(bool b);
00316 void fontSelected( const QString &_font );
00317 void fontSizeSelected( int size );
00318 void bold( bool b );
00319 void italic( bool b );
00320 void underline( bool b );
00321 void strikeOut( bool b );
00322 void deleteColumn();
00323 void insertColumn();
00324 void deleteRow();
00325 void insertRow();
00326 void hideRow();
00327 void showRow();
00328 void showSelRows();
00329 void hideColumn();
00330 void showColumn();
00331 void showSelColumns();
00332 void insertMathExpr();
00333 void formulaSelection( const QString &_math );
00334 void changeTextColor();
00335 void changeBackgroundColor();
00336 void sortInc();
00337 void sortDec();
00338 void layoutDlg();
00339 void borderBottom();
00340 void borderRight();
00341 void borderLeft();
00342 void borderTop();
00343 void borderOutline();
00344 void borderAll();
00345 void borderRemove();
00346 void changeBorderColor();
00347 void sheetFormat();
00348 void autoSum();
00349 void resizeRow();
00350 void resizeColumn();
00351 void increaseFontSize();
00352 void decreaseFontSize();
00353 void setSelectionFontSize(int size);
00354
00355 void setSelectionTextColor(const QColor &txtColor);
00356 void setSelectionBackgroundColor(const QColor &bgColor);
00357 void setSelectionBorderColor(const QColor &bdColor);
00358
00359 void setSelectionLeftBorderColor(const QColor &color);
00360 void setSelectionRightBorderColor(const QColor &color);
00361 void setSelectionTopBorderColor(const QColor &color);
00362 void setSelectionBottomBorderColor(const QColor &color);
00363 void setSelectionAllBorderColor(const QColor &color);
00364 void setSelectionOutlineBorderColor(const QColor &color);
00365
00366 void upper();
00367 void lower();
00368 void equalizeColumn();
00369 void equalizeRow();
00370 void preference();
00371 void firstLetterUpper();
00372 void verticalText(bool );
00373 void addModifyComment();
00374 void setSelectionComment(QString comment);
00375 void removeComment();
00376 void changeAngle();
00377 void setSelectionAngle(int angle);
00378
00385 void mergeCell();
00386
00392 void dissociateCell();
00393
00394 void gotoCell();
00395 void increaseIndent();
00396 void decreaseIndent();
00397 void copyAsText();
00398
00399 void moveSheet( unsigned sheet, unsigned target );
00400
00404 void sheetProperties();
00405
00410 void changeSheet( const QString& _name );
00411
00416 void nextSheet();
00417
00422 void previousSheet();
00423
00428 void firstSheet();
00429
00434 void lastSheet();
00435
00436 void sortList();
00437
00438 void statusBarClicked(int _id);
00439 void menuCalc(bool);
00440
00444 void showStatusBar( bool b );
00445
00449 void showTabBar( bool b );
00450
00454 void showFormulaBar( bool b );
00455
00460 void showCommentIndicator( bool b );
00461
00465 void popupTabBarMenu( const QPoint& );
00466
00467 void handleDamages( const QValueList<KSpread::Damage*>& damages );
00468
00469 void runInternalTests();
00470 void runInspector();
00471
00472 protected slots:
00476 void slotActivateTool( int _id );
00477 void slotInsert();
00478 void slotInsertCellCopy();
00479 void slotRemove();
00480 void slotRename();
00481
00485 void popupChildMenu( KoChild*, const QPoint& global_pos );
00486 void slotPopupDeleteChild();
00487
00491 void slotPopupAdjustColumn();
00492 void slotPopupAdjustRow();
00493
00497 void slotItemSelected( int );
00498 void slotListChoosePopupMenu( );
00499
00503 void slotHighlight( const QString &text, int matchingIndex, int matchedLength );
00507 void slotReplace( const QString &newText, int, int, int );
00508
00509 void slotSpecialChar( QChar c, const QString & _font );
00510 void slotSpecialCharDlgClosed();
00511
00512 protected slots:
00513
00514 void slotChildSelected( KoDocumentChild* ch );
00515 void slotChildUnselected( KoDocumentChild* );
00516
00517 public slots:
00518
00519 void slotRefreshView();
00520 void slotUpdateView( KSpreadSheet *_sheet );
00521 void slotUpdateView( KSpreadSheet *_sheet, const QRect& );
00522 void slotUpdateHBorder( KSpreadSheet *_sheet );
00523 void slotUpdateVBorder( KSpreadSheet *_sheet );
00524 void slotChangeSelection( KSpreadSheet *_sheet, const QRect &oldSelection,
00525 const QPoint &_oldMarker );
00526 void slotAddSheet( KSpreadSheet *_sheet );
00527 void slotRemoveChild( KSpreadChild *_child );
00528 void slotUpdateChildGeometry( KSpreadChild *_child );
00529 void slotSheetRenamed( KSpreadSheet* sheet, const QString& old_name );
00530 void slotSheetHidden( KSpreadSheet*_sheet );
00531 void slotSheetShown( KSpreadSheet*_sheet );
00532 void slotSheetRemoved( KSpreadSheet*_sheet );
00533 void refreshLocale();
00534 void extraSpelling();
00535
00536 void spellCheckerReady();
00537 void spellCheckerMisspelling( const QString &, const QStringList &, unsigned int);
00538 void spellCheckerCorrected( const QString &, const QString &, unsigned int);
00539 void spellCheckerDone( const QString & );
00540 void spellCheckerFinished( );
00541 void spellCheckerIgnoreAll( const QString & word);
00542 void spellCheckerReplaceAll( const QString &, const QString &);
00543 void startKSpell();
00544
00549 void commandExecuted();
00550
00551 virtual int leftBorder() const;
00552 virtual int rightBorder() const;
00553 virtual int topBorder() const;
00554 virtual int bottomBorder() const;
00555
00556 signals:
00557 void sig_selectionChanged( KSpreadSheet* _sheet, const QRect& _selection );
00558 void sig_chooseSelectionChanged(KSpreadSheet *sheet, const QRect& _selection);
00559
00560 protected:
00561
00562 virtual void keyPressEvent ( QKeyEvent * _ev );
00563 virtual void resizeEvent( QResizeEvent *_ev );
00564
00565 virtual QWMatrix matrix() const;
00566
00572 void activateFormulaEditor();
00573
00574 virtual void updateReadWrite( bool readwrite );
00575
00576 virtual void guiActivateEvent( KParts::GUIActivateEvent *ev );
00577
00578 void initFindReplace();
00579 KSpreadCell* findNextCell();
00580
00581 private:
00582
00583 ViewPrivate* d;
00584
00585
00586 KSpreadView( const KSpreadView& );
00587 KSpreadView& operator=( const KSpreadView& );
00588
00589 void initView();
00590
00591 bool spellSwitchToOtherSheet();
00592 void spellCleanup();
00593
00594 void endOperation( QRect const & rect );
00595 };
00596
00597 #endif // KSPREAD_VIEW
This file is part of the documentation for kspread Library Version 1.4.2.