summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-sheet/mainwindow.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-sheet/mainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/mainwindow.h153
1 files changed, 88 insertions, 65 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.h b/noncore/apps/opie-sheet/mainwindow.h
index eacbe36..642b7ae 100644
--- a/noncore/apps/opie-sheet/mainwindow.h
+++ b/noncore/apps/opie-sheet/mainwindow.h
@@ -1,100 +1,123 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef MAINWINDOW_H 34#ifndef MAINWINDOW_H
16#define MAINWINDOW_H 35#define MAINWINDOW_H
17 36
37#include "Excel.h"
38#include "sheet.h"
39
40/* OPIE */
18#include <qpe/applnk.h> 41#include <qpe/applnk.h>
19#include <qpe/fileselector.h> 42#include <qpe/fileselector.h>
43
44/* QT */
20#include <qmenubar.h> 45#include <qmenubar.h>
21#include <qtoolbar.h> 46#include <qtoolbar.h>
22#include <qmainwindow.h> 47#include <qmainwindow.h>
23#include <qaction.h> 48#include <qaction.h>
24#include <qlineedit.h> 49#include <qlineedit.h>
25#include <qbutton.h> 50#include <qbutton.h>
26#include <qcombobox.h> 51#include <qcombobox.h>
27#include <qtoolbutton.h> 52#include <qtoolbutton.h>
28#include "Excel.h"
29#include "sheet.h"
30 53
31typedef struct typeSheet 54typedef struct typeSheet
32{ 55{
33 QString name; 56 QString name;
34 QList<typeCellData> data; 57 QList<typeCellData> data;
35}; 58};
36 59
37class MainWindow: public QMainWindow 60class MainWindow: public QMainWindow
38{ 61{
39 Q_OBJECT 62 Q_OBJECT
40 63
41 // QPE objects 64 // QPE objects
42 DocLnk* currentDoc; 65 DocLnk* currentDoc;
43 QMenuBar *menu; 66 QMenuBar *menu;
44 QToolBar *toolbarFunctions, *toolbarEdit, *toolbarStandard; 67 QToolBar *toolbarFunctions, *toolbarEdit, *toolbarStandard;
45 FileSelector *fileSelector; 68 FileSelector *fileSelector;
46 FileSelector *ExcelSelector; 69 FileSelector *ExcelSelector;
47 70
48 // QT objects 71 // QT objects
49 QPopupMenu *menuFile, *menuEdit, *menuInsert, *menuFormat, *menuData, *menuHelp, 72 QPopupMenu *menuFile, *menuEdit, *menuInsert, *menuFormat, *menuData, *menuHelp,
50 *submenuFunc, *submenuFuncStd, *submenuFuncStandard, *submenuFuncLogic, 73 *submenuFunc, *submenuFuncStd, *submenuFuncStandard, *submenuFuncLogic,
51 *submenuFuncTrig, *submenuFuncString, *submenuFuncScientific, *submenuFuncDistr, 74 *submenuFuncTrig, *submenuFuncString, *submenuFuncScientific, *submenuFuncDistr,
52 *submenuFuncStat, 75 *submenuFuncStat,
53 *submenuRow, *submenuCol, *submenuSheet; 76 *submenuRow, *submenuCol, *submenuSheet;
54 QAction *fileNew, *fileOpen, *fileSave, *fileSaveAs, *fileExcelImport, *fileQuit, *helpAbout, *editAccept, *editCancel, *formatCells, 77 QAction *fileNew, *fileOpen, *fileSave, *fileSaveAs, *fileExcelImport, *fileQuit, *helpAbout, *editAccept, *editCancel, *formatCells,
55 *funcPlus, *funcMinus, *funcCross, *funcDivide, *funcParanOpen, *funcParanClose, *funcComma, *funcEqual, 78 *funcPlus, *funcMinus, *funcCross, *funcDivide, *funcParanOpen, *funcParanClose, *funcComma, *funcEqual,
56 *editCut, *editCopy, *editPaste, *editPasteContents, *editClear, *insertCols, *insertRows, *insertSheets, *insertCells, 79 *editCut, *editCopy, *editPaste, *editPasteContents, *editClear, *insertCols, *insertRows, *insertSheets, *insertCells,
57 *rowHeight, *rowShow, *rowHide, *rowAdjust, *colWidth, *colShow, *colHide, *colAdjust, *sheetRename, *sheetRemove, 80 *rowHeight, *rowShow, *rowHide, *rowAdjust, *colWidth, *colShow, *colHide, *colAdjust, *sheetRename, *sheetRemove,
58 *dataSort, *dataFindReplace, *editCellSelect, *helpGeneral; 81 *dataSort, *dataFindReplace, *editCellSelect, *helpGeneral;
59 QLineEdit *editData; 82 QLineEdit *editData;
60 QButton *buttonUp, *buttonDown, *buttonLeft, *buttonRight; 83 QButton *buttonUp, *buttonDown, *buttonLeft, *buttonRight;
61 QComboBox *comboSheets; 84 QComboBox *comboSheets;
62 QToolButton *toolFunction; 85 QToolButton *toolFunction;
63 QList<typeSheet> listSheets; 86 QList<typeSheet> listSheets;
64 QString helpFile; 87 QString helpFile;
65 88
66 // Other objects 89 // Other objects
67 Sheet *sheet; 90 Sheet *sheet;
68 91
69 // Variables 92 // Variables
70 bool documentModified; 93 bool documentModified;
71 94
72 // Private functions 95 // Private functions
73 void initMenu(); 96 void initMenu();
74 void initActions(); 97 void initActions();
75 void initFunctionsToolbar(); 98 void initFunctionsToolbar();
76 void initEditToolbar(); 99 void initEditToolbar();
77 void initStandardToolbar(); 100 void initStandardToolbar();
78 void initSheet(); 101 void initSheet();
79 void addToData(const QString &data); 102 void addToData(const QString &data);
80 int saveCurrentFile(bool ask=TRUE); 103 int saveCurrentFile(bool ask=TRUE);
81 void documentOpen(const DocLnk &lnkDoc); 104 void documentOpen(const DocLnk &lnkDoc);
82 void documentSave(DocLnk *lnkDoc); 105 void documentSave(DocLnk *lnkDoc);
83 void closeEvent(QCloseEvent *e); 106 void closeEvent(QCloseEvent *e);
84 void addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w); 107 void addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w);
85 typeSheet *createNewSheet(); 108 typeSheet *createNewSheet();
86 typeSheet *findSheet(const QString &name); 109 typeSheet *findSheet(const QString &name);
87 110
88 private slots: 111private slots:
89 void slotFileNew(); 112 void slotFileNew();
90 void slotFileOpen(); 113 void slotFileOpen();
91 void slotFileSave(); 114 void slotFileSave();
92 void slotFileSaveAs(); 115 void slotFileSaveAs();
93 116
94 void slotImportExcel(const DocLnk &lnkDoc); 117 void slotImportExcel(const DocLnk &lnkDoc);
95 void slotImportExcelOpen(); 118 void slotImportExcelOpen();
96 void ExcelSelectorHide(); 119 void ExcelSelectorHide();
97 120
98 void slotHelpAbout(); 121 void slotHelpAbout();
99 void slotEditAccept(); 122 void slotEditAccept();
100 void slotEditCancel(); 123 void slotEditCancel();
@@ -118,24 +141,24 @@ class MainWindow: public QMainWindow
118 void slotSheetRename(); 141 void slotSheetRename();
119 void slotSheetRemove(); 142 void slotSheetRemove();
120 void slotFuncOutput(); 143 void slotFuncOutput();
121 void slotCellSelect(bool lock); 144 void slotCellSelect(bool lock);
122 void slotCellClicked(const QString &cell); 145 void slotCellClicked(const QString &cell);
123 void slotSheetChanged(const QString &name); 146 void slotSheetChanged(const QString &name);
124 void slotDocModified(); 147 void slotDocModified();
125 void selectorShow(); 148 void selectorShow();
126 void selectorHide(); 149 void selectorHide();
127 void selectorFileNew(const DocLnk &lnkDoc); 150 void selectorFileNew(const DocLnk &lnkDoc);
128 void selectorFileOpen(const DocLnk &lnkDoc); 151 void selectorFileOpen(const DocLnk &lnkDoc);
129 152
130 public: 153public:
131 static QString appName() { return QString::fromLatin1("sheetqt"); } 154static QString appName() { return QString::fromLatin1("sheetqt"); }
132 MainWindow(QWidget *p, const char*, WFlags); 155 MainWindow(QWidget *p, const char*, WFlags);
133 ~MainWindow(); 156 ~MainWindow();
134 157
135 void setHelpFile(const QString &help_filename) { helpFile=help_filename; } 158 void setHelpFile(const QString &help_filename) { helpFile=help_filename; }
136 159
137 public slots: 160public slots:
138 void setDocument(const QString &applnk_filename); 161 void setDocument(const QString &applnk_filename);
139}; 162};
140 163
141#endif 164#endif