Diffstat (limited to 'noncore/apps/opie-sheet/mainwindow.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.h b/noncore/apps/opie-sheet/mainwindow.h new file mode 100644 index 0000000..ac90504 --- a/dev/null +++ b/noncore/apps/opie-sheet/mainwindow.h | |||
@@ -0,0 +1,120 @@ | |||
1 | #ifndef MAINWINDOW_H | ||
2 | #define MAINWINDOW_H | ||
3 | |||
4 | #include <qpe/applnk.h> | ||
5 | #include <qpe/fileselector.h> | ||
6 | #include <qpe/qpemenubar.h> | ||
7 | #include <qpe/qpetoolbar.h> | ||
8 | #include <qmainwindow.h> | ||
9 | #include <qaction.h> | ||
10 | #include <qlineedit.h> | ||
11 | #include <qbutton.h> | ||
12 | #include <qcombobox.h> | ||
13 | #include <qtoolbutton.h> | ||
14 | |||
15 | #include "sheet.h" | ||
16 | |||
17 | typedef struct typeSheet | ||
18 | { | ||
19 | QString name; | ||
20 | QList<typeCellData> data; | ||
21 | }; | ||
22 | |||
23 | class MainWindow: public QMainWindow | ||
24 | { | ||
25 | Q_OBJECT | ||
26 | |||
27 | // QPE objects | ||
28 | DocLnk currentDoc; | ||
29 | QPEMenuBar *menu; | ||
30 | QPEToolBar *toolbarFunctions, *toolbarEdit, *toolbarStandard; | ||
31 | FileSelector *fileSelector; | ||
32 | |||
33 | // QT objects | ||
34 | QPopupMenu *menuFile, *menuEdit, *menuInsert, *menuFormat, *menuData, *menuHelp, | ||
35 | *submenuFunc, *submenuFuncStd, *submenuFuncMath, *submenuFuncStat, | ||
36 | *submenuRow, *submenuCol, *submenuSheet; | ||
37 | QAction *fileNew, *fileOpen, *fileSave, *fileSaveAs, *fileQuit, *helpAbout, *editAccept, *editCancel, *formatCells, | ||
38 | *funcPlus, *funcMinus, *funcCross, *funcDivide, *funcParanOpen, *funcParanClose, *funcComma, *funcEqual, | ||
39 | *editCut, *editCopy, *editPaste, *editPasteContents, *editClear, *insertCols, *insertRows, *insertSheets, *insertCells, | ||
40 | *rowHeight, *rowShow, *rowHide, *rowAdjust, *colWidth, *colShow, *colHide, *colAdjust, *sheetRename, *sheetRemove, | ||
41 | *dataSort, *dataFindReplace, *editCellSelect, *helpGeneral; | ||
42 | QLineEdit *editData; | ||
43 | QButton *buttonUp, *buttonDown, *buttonLeft, *buttonRight; | ||
44 | QComboBox *comboSheets; | ||
45 | QToolButton *toolFunction; | ||
46 | QList<typeSheet> listSheets; | ||
47 | QString helpFile; | ||
48 | |||
49 | // Other objects | ||
50 | Sheet *sheet; | ||
51 | |||
52 | // Variables | ||
53 | bool documentModified; | ||
54 | |||
55 | // Private functions | ||
56 | void initMenu(); | ||
57 | void initActions(); | ||
58 | void initFunctionsToolbar(); | ||
59 | void initEditToolbar(); | ||
60 | void initStandardToolbar(); | ||
61 | void initSheet(); | ||
62 | void addToData(const QString &data); | ||
63 | int saveCurrentFile(bool ask=TRUE); | ||
64 | void documentOpen(const DocLnk &lnkDoc); | ||
65 | void copyDocLnk(const DocLnk &source, DocLnk &target); | ||
66 | void documentSave(DocLnk &lnkDoc); | ||
67 | void closeEvent(QCloseEvent *e); | ||
68 | void addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w); | ||
69 | typeSheet *createNewSheet(); | ||
70 | typeSheet *findSheet(const QString &name); | ||
71 | |||
72 | private slots: | ||
73 | void slotFileNew(); | ||
74 | void slotFileOpen(); | ||
75 | void slotFileSave(); | ||
76 | void slotFileSaveAs(); | ||
77 | void slotHelpAbout(); | ||
78 | void slotHelpGeneral(); | ||
79 | void slotEditAccept(); | ||
80 | void slotEditCancel(); | ||
81 | void slotEditPaste(); | ||
82 | void slotEditPasteContents(); | ||
83 | void slotFormatCells(); | ||
84 | void slotInsertCells(); | ||
85 | void slotInsertRows(); | ||
86 | void slotInsertCols(); | ||
87 | void slotInsertSheets(); | ||
88 | void slotDataSort(); | ||
89 | void slotDataFindReplace(); | ||
90 | void slotRowHeight(); | ||
91 | void slotRowAdjust(); | ||
92 | void slotRowShow(); | ||
93 | void slotRowHide(); | ||
94 | void slotColumnWidth(); | ||
95 | void slotColumnAdjust(); | ||
96 | void slotColumnShow(); | ||
97 | void slotColumnHide(); | ||
98 | void slotSheetRename(); | ||
99 | void slotSheetRemove(); | ||
100 | void slotFuncOutput(); | ||
101 | void slotCellSelect(bool lock); | ||
102 | void slotCellClicked(const QString &cell); | ||
103 | void slotSheetChanged(const QString &name); | ||
104 | void slotDocModified(); | ||
105 | void selectorShow(); | ||
106 | void selectorHide(); | ||
107 | void selectorFileNew(const DocLnk &lnkDoc); | ||
108 | void selectorFileOpen(const DocLnk &lnkDoc); | ||
109 | |||
110 | public: | ||
111 | MainWindow(); | ||
112 | ~MainWindow(); | ||
113 | |||
114 | void setHelpFile(const QString &help_filename) { helpFile=help_filename; } | ||
115 | |||
116 | public slots: | ||
117 | void setDocument(const QString &applnk_filename); | ||
118 | }; | ||
119 | |||
120 | #endif | ||