~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to kspread/kspread_view.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of the KDE project
2
 
   Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
 
2
   Copyright (C) 2002-2004 Ariya Hidayat <ariya@kde.org>
 
3
             (C) 1999-2003 Laurent Montel <montel@kde.org>
 
4
             (C) 2002-2003 Norbert Andres <nandres@web.de>
 
5
             (C) 2002-2003 Philipp Mueller <philipp.mueller@gmx.de>
 
6
             (C) 2002-2003 John Dailey <dailey@vt.edu>
 
7
             (C) 1999-2003 David Faure <faure@kde.org>
 
8
             (C) 1999-2001 Simon Hausmann <hausmann@kde.org>
 
9
             (C) 1998-2000 Torben Weis <weis@kde.org>
3
10
 
4
11
   This library is free software; you can redistribute it and/or
5
12
   modify it under the terms of the GNU Library General Public
17
24
   Boston, MA 02111-1307, USA.
18
25
*/
19
26
 
20
 
#ifndef __kspread_gui_h__
21
 
#define __kspread_gui_h__
22
 
 
23
 
class QFrame;
 
27
#ifndef KSPREAD_VIEW
 
28
#define KSPREAD_VIEW
 
29
 
 
30
#include <qpoint.h>
 
31
#include <qptrlist.h>
 
32
#include <qstringlist.h>
 
33
#include <qvaluelist.h>
 
34
 
 
35
#include <koView.h>
 
36
 
24
37
class QScrollBar;
25
 
class QButton;
26
 
 
27
 
class KSpreadView;
28
 
class KSpreadEditWidget;
 
38
 
 
39
class KoDocumentEntry;
 
40
class KoTabBar;
 
41
 
29
42
class KSpreadCanvas;
30
 
class KSpreadHBorder;
31
 
class KSpreadVBorder;
32
 
class KSpreadScripts;
33
 
class KSpreadSheet;
 
43
class KSpreadCell;
 
44
class KSpreadChild;
34
45
class KSpreadDoc;
35
 
class KSpreadPaperLayout;
36
 
class KSpreadChildPicture;
37
 
class KSpreadChildFrame;
38
 
class KSpreadShell;
39
 
class KSpreadTabBar;
40
46
class KSpreadEditWidget;
41
 
class KSpreadCanvas;
42
47
class KSpreadHBorder;
43
 
class KSpreadVBorder;
44
 
class KSpreadChild;
45
 
class KSpreadCell;
46
48
class KSpreadLocationEditWidget;
47
 
class KoDocumentEntry;
48
 
class KoCharSelectDia;
49
 
class KStatusBarLabel;
50
 
class TKSelectColorAction;
51
 
class KAction;
52
 
class KSelectAction;
53
 
class KFontAction;
54
 
class KFontSizeAction;
55
 
class KToggleAction;
56
 
class KoPartSelectAction;
57
 
class KSpreadSpell;
58
 
class KSpreadMacroUndoAction;
59
 
class KSpreadInsertHandler;
60
 
 
61
 
class KActionMenu;
62
 
 
63
 
class DCOPObject;
64
 
class KReplace;
65
 
class KFind;
66
 
 
67
 
#include <qptrlist.h>
68
 
#include <qpoint.h>
69
 
#include <qguardedptr.h>
70
 
#include <qstringlist.h>
71
 
 
72
 
#include <koView.h>
73
 
#include <koDocument.h>
74
 
#include <koToolBox.h>
75
 
#include <kdatatool.h>
76
 
#include <kglobalsettings.h>
77
 
 
78
 
#include "kspread_selection.h"
 
49
class KSpreadSelection;
 
50
class KSpreadSheet;
 
51
class KSpreadVBorder;
 
52
class KSpreadView;
 
53
class KSpreadComboboxLocationEditWidget;
 
54
class ViewPrivate;
 
55
 
 
56
namespace KSpread
 
57
{
 
58
class Damage;
 
59
}
 
60
 
79
61
/**
 
62
 * \brief
 
63
 * The KSpreadView class displays a KSpread document.
 
64
 *
 
65
 *
 
66
 * KSpreadView is used to display a spreadsheet document and provide
 
67
 * the interface for the user to perform editing and data analysis.
 
68
 *
 
69
 * A view consists of several parts:
 
70
 *  \li canvas to display cells in a sheet
 
71
 *  \li line editor to display and edit cell contents
 
72
 *  \li location editor to show marker and/or selection
 
73
 *  \li column header to show columns
 
74
 *  \li row header to show rows
 
75
 *  \li horizontal and vertical scrollbars for navigation
 
76
 *  \li tab bar to select active worksheet
 
77
 *
80
78
 */
81
 
class KSpreadView : public KoView
 
79
class KSPREAD_EXPORT KSpreadView : public KoView
82
80
{
83
81
    friend class KSpreadCanvas;
84
82
 
85
83
    Q_OBJECT
86
84
public:
87
 
    KSpreadView( QWidget *_parent, const char *_name, KSpreadDoc *_doc );
 
85
 
 
86
    /** Creates a new view */
 
87
    KSpreadView( QWidget *_parent, const char *_name,
 
88
        KSpreadDoc *doc );
 
89
 
 
90
    /** Destroys the view */
88
91
    ~KSpreadView();
89
 
 
90
 
    KSpreadCanvas* canvasWidget() const { return m_pCanvas; }
91
 
    KSpreadHBorder* hBorderWidget()const { return m_pHBorderWidget; }
92
 
    KSpreadVBorder* vBorderWidget()const { return m_pVBorderWidget; }
93
 
    QScrollBar* horzScrollBar()const { return m_pHorzScrollBar; }
94
 
    QScrollBar* vertScrollBar()const { return m_pVertScrollBar; }
95
 
    KSpreadEditWidget* editWidget()const { return m_pEditWidget; }
96
 
    KSpreadLocationEditWidget* posWidget()const { return m_pPosWidget; }
97
 
 
98
 
    KSpreadDoc* doc()const { return m_pDoc; }
99
 
    void changeZoomMenu( int zoom );
 
92
    
 
93
    KSpreadDoc* doc();
 
94
 
 
95
    /** Returns the canvas of the view */
 
96
    KSpreadCanvas* canvasWidget() const;
 
97
 
 
98
    /** Returns the column header */
 
99
    KSpreadHBorder* hBorderWidget() const;
 
100
 
 
101
    /** Returns the row header */
 
102
    KSpreadVBorder* vBorderWidget() const;
 
103
 
 
104
    /** Returns the horizontal scrollbar */
 
105
    QScrollBar* horzScrollBar() const;
 
106
 
 
107
    /** Returns the vertical scrollbar */
 
108
    QScrollBar* vertScrollBar() const;
 
109
 
 
110
    /** Returns the editor widget */
 
111
    KSpreadEditWidget* editWidget() const;
 
112
 
 
113
    /** Returns the location widget */
 
114
    KSpreadComboboxLocationEditWidget* posWidget() const;
 
115
 
 
116
    /** Returns the tab bar */
 
117
    KoTabBar* tabBar() const;
 
118
 
100
119
    void setZoom( int zoom, bool updateViews ); // change the zoom value
101
120
 
102
 
    void addTable( KSpreadSheet *_t );
103
 
    //void removeTable( KSpreadSheet *_t );
104
 
    void removeAllTables();
105
 
    void setActiveTable( KSpreadSheet *_t,bool updateTable=true );
 
121
    void addSheet( KSpreadSheet *_t );
 
122
    //void removesheet( KSpreadSheet *_t );
 
123
    void removeAllSheets();
 
124
    void setActiveSheet( KSpreadSheet *_t,bool updatesheet=true );
106
125
 
107
 
    const KSpreadSheet* activeTable() const { return m_pTable; }
108
 
    KSpreadSheet* activeTable() { return m_pTable; }
109
 
    KSpreadTabBar* tabBar()const { return  m_pTabBar;}
 
126
    const KSpreadSheet* activeSheet() const;
 
127
    KSpreadSheet* activeSheet();
110
128
 
111
129
    void openPopupMenu( const QPoint &_global );
112
130
    void popupRowMenu(const QPoint & _point ) ;
171
189
 
172
190
    void initConfig();
173
191
 
174
 
    bool isLoading()const {return m_bLoading;}
 
192
    /**
 
193
     * Returns true if document is being loaded. It is useful to be checked for
 
194
     * when doing view update.
 
195
     */
 
196
    bool isLoading() const;
175
197
 
176
198
    /**
177
199
     * write in statusBar result of calc (Min, or Max, average, sum, count)
181
203
    void initCalcMenu();
182
204
 
183
205
    void changeNbOfRecentFiles(int _nb);
184
 
    void openPopupMenuMenuPage( const QPoint & _point );
185
206
 
186
207
    void updateBorderButton();
187
 
    void removeTable( KSpreadSheet *_t );
188
 
    void insertTable( KSpreadSheet* table );
 
208
 
 
209
    void removeSheet( KSpreadSheet *_t );
 
210
    void insertSheet( KSpreadSheet* sheet );
189
211
    QColor borderColor() const;
190
212
 
191
 
    KSpreadSelection* selectionInfo()const { return m_selectionInfo; }
192
 
    QRect selection() const { return selectionInfo()->selection(); }
193
 
    QPoint marker() const { return selectionInfo()->marker(); }
194
 
    void updateShowTableMenu();
 
213
    KSpreadSelection* selectionInfo() const;
 
214
    QRect selection(bool extend = true) const;
 
215
    QPoint marker() const;
 
216
 
 
217
    void updateShowSheetMenu();
195
218
 
196
219
    /**
197
220
     * Repaint any cell with the paintDirty flag that is visible in this view
201
224
    /**
202
225
     * Resets the internal handle pointer, called from KSpreadInsertHandler destructor
203
226
     */
204
 
    void resetInsertHandle() { m_pInsertHandle = 0L; }
205
 
 
206
 
    bool showTable(const QString& tableName);
 
227
    void resetInsertHandle();
 
228
 
 
229
    bool showSheet(const QString& sheetName);
 
230
 
 
231
    QPoint markerFromSheet( KSpreadSheet *_sheet ) const;
 
232
    /*
 
233
     * Save current sheet selection. Call when we change sheet, or save in oasis format
 
234
     */
 
235
    void saveCurrentSheetSelection();
207
236
 
208
237
public slots:
209
238
    /**
234
263
    void editCell();
235
264
    void setAreaName();
236
265
    void showAreaName();
237
 
    void undo();
238
 
    void redo();
239
266
    void adjust();
240
267
    void defaultSelection();
241
268
    void paperLayoutDlg();
247
274
    void insertFromTextfile();
248
275
    void insertFromClipboard();
249
276
    void insertSpecialChar();
250
 
    void editGlobalScripts();
251
 
    void editLocalScripts();
252
 
    void reloadScripts();
253
 
    void runLocalScript();
254
277
    void togglePageBorders( bool );
255
278
    void toggleProtectSheet( bool );
256
279
    void toggleProtectDoc( bool );
257
 
    void toggleRecordChanges( bool );
258
 
    void toggleProtectChanges( bool );
259
 
    void filterChanges();
260
 
    void acceptRejectChanges();
261
 
    void commentChanges();
262
 
    void mergeDocument();
263
280
    void viewZoom( const QString & );
264
281
    void find();
265
282
    void findNext();
270
287
    void insertSeries();
271
288
    void sort();
272
289
    void insertHyperlink();
 
290
    void removeHyperlink();
273
291
    void goalSeek();
274
292
    void multipleOperations();
275
293
    void subtotals();
276
294
    void textToColumns();
277
295
    void consolidate();
278
 
    void insertTable();
279
 
    void removeTable();
280
 
    void hideTable();
281
 
    void showTable();
 
296
    void insertSheet();
 
297
    void removeSheet();
 
298
    void hideSheet();
 
299
    void showSheet();
282
300
    void helpUsing();
283
301
    void insertChart();
284
302
    void moneyFormat(bool b);
288
306
    void alignTop( bool b );
289
307
    void alignMiddle( bool b );
290
308
    void alignBottom( bool b );
291
 
    void multiRow( bool b );
 
309
    void wrapText( bool b );
292
310
    void precisionMinus();
293
311
    void precisionPlus();
294
312
    void createStyleFromCell();
326
344
    void borderAll();
327
345
    void borderRemove();
328
346
    void changeBorderColor();
329
 
    void tableFormat();
 
347
    void sheetFormat();
330
348
    void autoSum();
331
349
    void resizeRow();
332
350
    void resizeColumn();
358
376
    void changeAngle();
359
377
    void setSelectionAngle(int angle);
360
378
 
 
379
    /**
 
380
     * Merges selected cells into one cell. This will not work if only one
 
381
     * cell is selected. An entire row or column can't be merged as well.
 
382
     *
 
383
     * \sa dissociateCell
 
384
     */
361
385
    void mergeCell();
 
386
 
 
387
    /**
 
388
     * Breaks merged cell. Obviously this can be done only on merged cells.
 
389
     *
 
390
     * \sa mergeCell
 
391
     */
362
392
    void dissociateCell();
 
393
 
363
394
    void gotoCell();
364
395
    void increaseIndent();
365
396
    void decreaseIndent();
366
397
    void copyAsText();
367
 
    /**
368
 
     * @ref #tabBar is connected to this slot.
369
 
     * When the user selects a new table using the @ref #tabBar this slot
370
 
     * is signaled.
371
 
     */
372
 
    void changeTable( const QString& _name );
373
 
    void nextTable();
374
 
    void previousTable();
375
 
    void firstTable();
376
 
    void lastTable();
 
398
 
 
399
    void moveSheet( unsigned sheet, unsigned target );
 
400
 
 
401
    /**
 
402
     * Shows the sheet properties dialog.
 
403
     */
 
404
    void sheetProperties();
 
405
 
 
406
    /**
 
407
     * Switch the active sheet to the name. This slot is connected to the tab bar
 
408
     * and activated when the user selects a new sheet in the tab bar.
 
409
     */
 
410
    void changeSheet( const QString& _name );
 
411
 
 
412
    /**
 
413
     * Switch the active sheet to the next visible sheet. Does nothing if the current
 
414
     * active sheet is the last visible sheet in the workbook.
 
415
     */
 
416
    void nextSheet();
 
417
 
 
418
    /**
 
419
     * Switch the active sheet to the previous visible sheet. Does nothing if the current
 
420
     * active sheet is the first visible sheet in the workbook.
 
421
     */
 
422
    void previousSheet();
 
423
 
 
424
    /**
 
425
     * Switch the active sheet to the first visible sheet in the workbook. Does nothing
 
426
     * if the current active sheet is already the first one.
 
427
     */
 
428
    void firstSheet();
 
429
 
 
430
    /**
 
431
     * Switch the active sheet to the last visible sheet in the workbook. Does nothing
 
432
     * if the current active sheet is already the last one.
 
433
     */
 
434
    void lastSheet();
377
435
 
378
436
    void sortList();
379
437
 
380
438
    void statusBarClicked(int _id);
381
439
    void menuCalc(bool);
382
440
 
 
441
    /**
 
442
     * Shows the status bar if b is true, otherwise the status bar will be hidden.
 
443
     */
 
444
    void showStatusBar( bool b );
 
445
 
 
446
    /**
 
447
     * Shows the tab bar if b is true, otherwise the tab bar will be hidden.
 
448
     */
 
449
    void showTabBar( bool b );
 
450
 
 
451
    /**
 
452
     * Shows the formula bar if b is true, otherwise the formula bar will be hidden.
 
453
     */
 
454
    void showFormulaBar( bool b );
 
455
 
 
456
    /**
 
457
     * If b is true, a red triangle is displayed on the corner of cells
 
458
     * which have comments.
 
459
     */
 
460
    void showCommentIndicator( bool b );
 
461
 
 
462
    /**
 
463
     * Shows context menu when tabbar is double-clicked.
 
464
     */
 
465
    void popupTabBarMenu( const QPoint& );
 
466
    
 
467
    void handleDamages( const QValueList<KSpread::Damage*>& damages );
 
468
 
 
469
    void runInternalTests();
 
470
    void runInspector();
 
471
 
383
472
protected slots:
384
473
    /**
385
474
     * Popup menu
403
492
    void slotPopupAdjustRow();
404
493
 
405
494
    /**
406
 
     * Scroll @ref #tabBar.
407
 
     */
408
 
    void slotScrollToFirstTable();
409
 
    /**
410
 
     * Scroll @ref #tabBar.
411
 
     */
412
 
    void slotScrollToLeftTable();
413
 
    /**
414
 
     * Scroll @ref #tabBar.
415
 
     */
416
 
    void slotScrollToRightTable();
417
 
    /**
418
 
     * Scroll @ref #tabBar.
419
 
     */
420
 
    void slotScrollToLastTable();
421
 
 
422
 
    /**
423
495
     * list from list choose
424
496
     */
425
497
    void slotItemSelected( int );
445
517
public slots:
446
518
    // Document signals
447
519
    void slotRefreshView();
448
 
    void slotUpdateView( KSpreadSheet *_table );
449
 
    void slotUpdateView( KSpreadSheet *_table, const QRect& );
450
 
    void slotUpdateHBorder( KSpreadSheet *_table );
451
 
    void slotUpdateVBorder( KSpreadSheet *_table );
452
 
    void slotChangeSelection( KSpreadSheet *_table, const QRect &oldSelection,
 
520
    void slotUpdateView( KSpreadSheet *_sheet );
 
521
    void slotUpdateView( KSpreadSheet *_sheet, const QRect& );
 
522
    void slotUpdateHBorder( KSpreadSheet *_sheet );
 
523
    void slotUpdateVBorder( KSpreadSheet *_sheet );
 
524
    void slotChangeSelection( KSpreadSheet *_sheet, const QRect &oldSelection,
453
525
                              const QPoint &_oldMarker );
454
 
    void slotAddTable( KSpreadSheet *_table );
 
526
    void slotAddSheet( KSpreadSheet *_sheet );
455
527
    void slotRemoveChild( KSpreadChild *_child );
456
528
    void slotUpdateChildGeometry( KSpreadChild *_child );
457
 
    void slotTableRenamed( KSpreadSheet* table, const QString& old_name );
458
 
    void slotTableHidden( KSpreadSheet*_table );
459
 
    void slotTableShown( KSpreadSheet*_table );
460
 
    void slotTableRemoved( KSpreadSheet*_table );
 
529
    void slotSheetRenamed( KSpreadSheet* sheet, const QString& old_name );
 
530
    void slotSheetHidden( KSpreadSheet*_sheet );
 
531
    void slotSheetShown( KSpreadSheet*_sheet );
 
532
    void slotSheetRemoved( KSpreadSheet*_sheet );
461
533
    void refreshLocale();
462
534
    void extraSpelling();
463
535
 
470
542
    void spellCheckerReplaceAll( const QString &,  const QString &);
471
543
    void startKSpell();
472
544
 
 
545
    /**
 
546
     * Updates the view and the action. This is typically connected
 
547
     * to KoCommandHistory::commandExecuted() signal.
 
548
     */
 
549
    void commandExecuted();
 
550
 
473
551
    virtual int leftBorder() const;
474
552
    virtual int rightBorder() const;
475
553
    virtual int topBorder() const;
476
554
    virtual int bottomBorder() const;
477
555
 
478
556
signals:
479
 
    void sig_selectionChanged( KSpreadSheet* _table, const QRect& _selection );
480
 
    void sig_chooseSelectionChanged(KSpreadSheet *table, const QRect& _selection);
 
557
    void sig_selectionChanged( KSpreadSheet* _sheet, const QRect& _selection );
 
558
    void sig_chooseSelectionChanged(KSpreadSheet *sheet, const QRect& _selection);
481
559
 
482
560
protected:
483
561
 
501
579
    KSpreadCell* findNextCell();
502
580
 
503
581
private:
504
 
    // GUI stuff
505
 
    QButton* newIconButton( const char *_file, bool _kbutton = false, QWidget *_parent = 0L );
506
 
    void updateButton(KSpreadCell *cell, int column, int row);
507
 
    QScrollBar *m_pHorzScrollBar;
508
 
    QScrollBar *m_pVertScrollBar;
509
 
    KSpreadCanvas *m_pCanvas;
510
 
    KSpreadVBorder *m_pVBorderWidget;
511
 
    KSpreadHBorder *m_pHBorderWidget;
512
 
    KSpreadEditWidget *m_pEditWidget;
513
 
    QWidget *m_pFrame;
514
 
    QFrame *m_pToolWidget;
515
 
    QButton *m_pTabBarFirst;
516
 
    QButton *m_pTabBarLeft;
517
 
    QButton *m_pTabBarRight;
518
 
    QButton *m_pTabBarLast;
519
 
    QButton *m_pOkButton;
520
 
    QButton *m_pCancelButton;
521
 
    KSpreadTabBar *m_pTabBar;
522
 
    KSpreadLocationEditWidget *m_pPosWidget;
523
 
    KoCharSelectDia * m_specialCharDlg;
524
 
    KToggleAction* m_bold;
525
 
    KToggleAction* m_italic;
526
 
    KToggleAction* m_underline;
527
 
    KToggleAction* m_strikeOut;
528
 
    KToggleAction* m_percent;
529
 
    KSelectAction* m_selectStyle;
530
 
    KAction* m_createStyle;
531
 
    KAction* m_precplus;
532
 
    KAction* m_precminus;
533
 
    KToggleAction* m_money;
534
 
    KToggleAction* m_alignLeft;
535
 
    KToggleAction* m_alignCenter;
536
 
    KToggleAction* m_alignRight;
537
 
    KToggleAction* m_alignTop;
538
 
    KToggleAction* m_alignMiddle;
539
 
    KToggleAction* m_alignBottom;
540
 
    KAction* m_insertSeries;
541
 
    KAction* m_insertLink;
542
 
    KAction* m_insertFunction;
543
 
    KAction* m_insertSpecialChar;
544
 
    KAction* m_transform;
545
 
    KAction* m_copy;
546
 
    KAction* m_findAction;
547
 
    KAction* m_replaceAction;
548
 
    KAction* m_paste;
549
 
    KAction* m_cut;
550
 
    KAction* m_specialPaste;
551
 
    KAction* m_delete;
552
 
    KAction* m_clearText;
553
 
    KAction* m_clearComment;
554
 
    KAction* m_clearValidity;
555
 
    KAction* m_clearConditional;
556
 
    KAction* m_fillRight;
557
 
    KAction* m_fillLeft;
558
 
    KAction* m_fillUp;
559
 
    KAction* m_fillDown;
560
 
    KAction* m_recalc_workbook;
561
 
    KAction* m_recalc_worksheet;
562
 
    KAction* m_adjust;
563
 
    KAction* m_editCell;
564
 
    KAction* m_undo;
565
 
    KAction* m_redo;
566
 
    KAction* m_paperLayout;
567
 
    KAction* m_styleDialog;
568
 
    KAction* m_definePrintRange;
569
 
    KAction* m_resetPrintRange;
570
 
    KAction* m_insertFromDatabase;
571
 
    KAction* m_insertFromTextfile;
572
 
    KAction* m_insertFromClipboard;
573
 
    KAction* m_insertTable;
574
 
    KAction* m_menuInsertTable;
575
 
    KAction* m_removeTable;
576
 
    KAction* m_renameTable;
577
 
    KAction* m_nextTable;
578
 
    KAction* m_prevTable;
579
 
    KAction* m_firstTable;
580
 
    KAction* m_lastTable;
581
 
    KAction* m_editGlobalScripts;
582
 
    KAction* m_editLocalScripts;
583
 
    KAction* m_reloadScripts;
584
 
    KAction* m_conditional;
585
 
    KAction* m_validity;
586
 
    KAction* m_sort;
587
 
    KAction* m_goalSeek;
588
 
    KAction* m_subTotals;
589
 
    KAction* m_multipleOperations;
590
 
    KAction* m_textToColumns;
591
 
    KAction* m_consolidate;
592
 
    KAction* m_help;
593
 
    KAction* m_insertCellCopy;
594
 
    KToggleAction* m_multiRow;
595
 
    KFontAction* m_selectFont;
596
 
    KFontSizeAction* m_selectFontSize;
597
 
    KAction* m_deleteColumn;
598
 
    KAction* m_hideColumn;
599
 
    KAction* m_showColumn;
600
 
    KAction* m_showSelColumns;
601
 
    KAction* m_insertColumn;
602
 
    KAction* m_deleteRow;
603
 
    KAction* m_insertRow;
604
 
    KAction* m_hideRow;
605
 
    KAction* m_showRow;
606
 
    KAction* m_showSelRows;
607
 
    KSelectAction* m_formulaSelection;
608
 
    KSelectAction* m_viewZoom;
609
 
    KAction* m_sortDec;
610
 
    KAction* m_sortInc;
611
 
    TKSelectColorAction* m_textColor;
612
 
    TKSelectColorAction* m_bgColor;
613
 
    KAction* m_cellLayout;
614
 
    KAction* m_hideTable;
615
 
    KAction* m_showTable;
616
 
    KAction* m_borderLeft;
617
 
    KAction* m_borderRight;
618
 
    KAction* m_borderTop;
619
 
    KAction* m_borderBottom;
620
 
    KAction* m_borderAll;
621
 
    KAction* m_borderOutline;
622
 
    KAction* m_borderRemove;
623
 
    TKSelectColorAction* m_borderColor;
624
 
    KAction* m_tableFormat;
625
 
    KAction* m_autoSum;
626
 
    KToggleAction* m_showPageBorders;
627
 
    KActionMenu* m_scripts;
628
 
    KAction* m_default;
629
 
    KAction* m_areaName;
630
 
    KAction* m_showArea;
631
 
    KAction* m_resizeRow;
632
 
    KAction* m_resizeColumn;
633
 
    KAction* m_fontSizeUp;
634
 
    KAction* m_fontSizeDown;
635
 
    KAction* m_upper;
636
 
    KAction* m_lower;
637
 
    KAction* m_equalizeRow;
638
 
    KAction* m_equalizeColumn;
639
 
    KAction* m_preference;
640
 
    KAction* m_firstLetterUpper;
641
 
    KToggleAction* m_verticalText;
642
 
    KAction* m_addModifyComment;
643
 
    KAction* m_removeComment;
644
 
    KAction* m_insertCell;
645
 
    KAction* m_removeCell;
646
 
    KAction* m_changeAngle;
647
 
    KAction* m_mergeCell;
648
 
    KAction* m_dissociateCell;
649
 
    KAction* m_gotoCell;
650
 
    KAction* m_increaseIndent;
651
 
    KAction* m_decreaseIndent;
652
 
    KAction* m_sortList;
653
 
    KAction* m_spellChecking;
654
 
 
655
 
    KAction* m_createTemplate;
656
 
 
657
 
    KAction* m_insertChartFrame;
658
 
 
659
 
    KToggleAction* m_protectSheet;
660
 
    KToggleAction* m_protectDoc;
661
 
 
662
 
    KToggleAction* m_recordChanges;
663
 
    KToggleAction* m_protectChanges;
664
 
    KAction* m_filterChanges;
665
 
    KAction* m_acceptRejectChanges;
666
 
    KAction* m_commentChanges;
667
 
    KAction* m_mergeDocument;
668
 
 
669
 
    KToggleAction* m_menuCalcMin;
670
 
    KToggleAction* m_menuCalcMax;
671
 
    KToggleAction* m_menuCalcAverage;
672
 
    KToggleAction* m_menuCalcCount;
673
 
    KToggleAction* m_menuCalcSum;
674
 
    KToggleAction* m_menuCalcNone;
675
 
 
676
 
    KoPartSelectAction *m_insertPart;
677
 
 
678
 
    struct
679
 
    {
680
 
      KSpreadSpell *   kspell;
681
 
      KSpreadSheet *  firstSpellTable;
682
 
      KSpreadSheet *  currentSpellTable;
683
 
      KSpreadCell  *  currentCell;
684
 
      KSpreadMacroUndoAction *macroCmdSpellCheck;
685
 
      unsigned int    spellCurrCellX;
686
 
      unsigned int    spellCurrCellY;
687
 
      unsigned int    spellStartCellX;
688
 
      unsigned int    spellStartCellY;
689
 
      unsigned int    spellEndCellX;
690
 
      unsigned int    spellEndCellY;
691
 
      bool            spellCheckSelection;
692
 
        QStringList replaceAll;
693
 
    } m_spell;
694
 
 
695
 
    bool spellSwitchToOtherTable();
 
582
 
 
583
    ViewPrivate* d;
 
584
 
 
585
    // don't allow copy or assignment
 
586
    KSpreadView( const KSpreadView& );
 
587
    KSpreadView& operator=( const KSpreadView& );
 
588
    
 
589
    void initView();    
 
590
 
 
591
    bool spellSwitchToOtherSheet();
696
592
    void spellCleanup();
697
593
 
698
 
    /**
699
 
     * Pointer to the last popup menu.
700
 
     * Since only one popup menu can be opened at once, its pointer is stored here.
701
 
     * Delete the old one before you store a pointer to anotheron here.
702
 
     * May be 0L.
703
 
     */
704
 
    QPopupMenu *m_pPopupMenu;
705
 
    int m_popupMenuFirstToolId;
706
 
 
707
 
    QPopupMenu *m_pPopupRow;
708
 
    QPopupMenu *m_pPopupColumn;
709
 
 
710
 
    /**
711
 
     * Used for embedded children.
712
 
     */
713
 
    QPopupMenu* m_popupChild;
714
 
 
715
 
    /**
716
 
     * used for list of choose
717
 
     */
718
 
    QPopupMenu* m_popupListChoose;
719
 
 
720
 
    /**
721
 
     * Holds a pointer of the child for which the popup menu has been opened.
722
 
     */
723
 
    KSpreadChild* m_popupChildObject;
724
 
 
725
 
    /**
726
 
     * This DCOP object represents the view.
727
 
     */
728
 
    DCOPObject* m_dcop;
729
 
 
730
 
 
731
 
    /**
732
 
     * Tells whether the user modfied the current cell.
733
 
     * Some key events are passed to the @ref EditWindow. When this flag is set and you
734
 
     * want to leave the cell with the marker then you must first save the new text
735
 
     * in the cell before moving the marker.
736
 
     */
737
 
    bool m_bEditDirtyFlag;
738
 
 
739
 
    /**
740
 
     * The active KSpreadSheet. This table has the input focus. It may be 0L, too.
741
 
     */
742
 
    KSpreadSheet* m_pTable;
743
 
 
744
 
    KSpreadDoc *m_pDoc;
745
 
 
746
 
    /**
747
 
     * Flags that indicate whether we should display additional
748
 
     * GUI stuff like rulers and scrollbars.
749
 
     *
750
 
     * @see #showGUI
751
 
     */
752
 
    bool m_bShowGUI;
753
 
 
754
 
    /**
755
 
     * If @ref #updateEditWidget is called it changes some KToggleActions.
756
 
     * That causes them to emit a signal. If this lock is TRUE, then these
757
 
     * signals are ignored.
758
 
     */
759
 
    bool m_toolbarLock;
760
 
 
761
 
   struct ToolEntry
762
 
   {
763
 
     QString command;
764
 
     KDataToolInfo info;
765
 
   };
766
 
   QPtrList<ToolEntry> m_lstTools;
767
 
 
768
 
   static KSpreadScripts *m_pGlobalScriptsDialog;
769
 
   //used to allow to refresh menubar
770
 
   //otherwise kspread crash when I try to refresh menubar
771
 
   //when I start kspread
772
 
   bool m_bLoading;
773
 
 
774
 
    /**
775
 
     * Holds a guarded pointer to the transformation toolbox.
776
 
     */
777
 
    QGuardedPtr<KoTransformToolBox> m_transformToolBox;
778
 
 
779
 
    /**
780
 
     * Find and Replace context. We remember the options and the strings used
781
 
     * previously.
782
 
     */
783
 
    long m_findOptions;
784
 
    QStringList m_findStrings;
785
 
    QStringList m_replaceStrings;
786
 
    /**
787
 
     * Current "find" operation
788
 
     */
789
 
    KFind* m_find;
790
 
    KReplace* m_replace;
791
 
    int m_findLeftColumn;
792
 
    int m_findRightColumn;
793
 
    QPoint m_findPos;
794
 
    QPoint m_findEnd;
795
 
 
796
 
    KStatusBarLabel* m_sbCalcLabel;
797
 
 
798
 
  KSpreadSelection* m_selectionInfo;
799
 
  QMap<KSpreadSheet*, QPoint> savedAnchors;
800
 
  QMap<KSpreadSheet*, QPoint> savedMarkers;
801
 
 
802
 
  KSpreadInsertHandler* m_pInsertHandle;
803
 
 
804
 
  /* helper functions */
805
 
  void initializeCalcActions();
806
 
  void initializeInsertActions();
807
 
  void initializeEditActions();
808
 
  void initializeAreaOperationActions();
809
 
  void initializeGlobalOperationActions();
810
 
  void initializeCellOperationActions();
811
 
  void initializeCellPropertyActions();
812
 
  void initializeTextFormatActions();
813
 
  void initializeTextLayoutActions();
814
 
  void initializeTextPropertyActions();
815
 
  void initializeTableActions();
816
 
  void initializeSpellChecking();
817
 
  void initializeRowColumnActions();
818
 
  void initializeBorderActions();
819
 
  void adjustMapActions( bool mode );
820
 
  void adjustActions( bool mode );
821
 
  void adjustActions( KSpreadSheet const * const table,
822
 
                      KSpreadCell const * const cell );
823
 
  bool checkChangeRecordPassword();
824
 
  void endOperation( QRect const & rect );
825
 
 
 
594
    void endOperation( QRect const & rect );
826
595
};
827
596
 
828
 
#endif
 
597
#endif // KSPREAD_VIEW