summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/infowin.h2
-rw-r--r--noncore/apps/opie-sheet/sheet.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/infowin.h b/noncore/apps/opie-reader/infowin.h
index 6f0fb99..c003998 100644
--- a/noncore/apps/opie-reader/infowin.h
+++ b/noncore/apps/opie-reader/infowin.h
@@ -1,39 +1,39 @@
1#ifndef __INFOWIN_H 1#ifndef __INFOWIN_H
2#define __INFOWIN_H 2#define __INFOWIN_H
3 3
4#include <qlabel.h> 4#include <qlabel.h>
5class QString; 5class QString;
6class QMultiLineEdit; 6class QMultiLineEdit;
7 7
8class infowin : public QWidget 8class infowin : public QWidget
9{ 9{
10Q_OBJECT 10Q_OBJECT
11 QLabel* fileSize; 11 QLabel* fileSize;
12 QLabel* textSize; 12 QLabel* textSize;
13 QLabel* ratio; 13 QLabel* ratio;
14 QLabel* location; 14 QLabel* location;
15 QLabel* read; 15 QLabel* read;
16 QLabel* docread; 16 QLabel* docread;
17 QLabel* docSize; 17 QLabel* docSize;
18 QLabel* docLocation; 18 QLabel* docLocation;
19 QLabel* zoom; 19 QLabel* zoom;
20 QMultiLineEdit* aboutbox; 20 QMultiLineEdit* aboutbox;
21public: 21public:
22 infowin::infowin( QWidget *parent=0, const char *name=0, WFlags f = 0); 22 infowin( QWidget *parent=0, const char *name=0, WFlags f = 0);
23 void setFileSize(int sz) { fileSize->setNum(sz); } 23 void setFileSize(int sz) { fileSize->setNum(sz); }
24 void setTextSize(int sz) { textSize->setNum(sz); } 24 void setTextSize(int sz) { textSize->setNum(sz); }
25 void setRatio(int sz) { ratio->setText(QString().setNum(sz)+"%"); } 25 void setRatio(int sz) { ratio->setText(QString().setNum(sz)+"%"); }
26 void setLocation(int sz) { location->setNum(sz); } 26 void setLocation(int sz) { location->setNum(sz); }
27 void setRead(int sz) { read->setText(QString().setNum(sz)+"%"); } 27 void setRead(int sz) { read->setText(QString().setNum(sz)+"%"); }
28 void setDocRead(int sz) { docread->setText(QString().setNum(sz)+"%"); } 28 void setDocRead(int sz) { docread->setText(QString().setNum(sz)+"%"); }
29 void setZoom(int sz) { zoom->setText(QString().setNum(sz)+"%"); } 29 void setZoom(int sz) { zoom->setText(QString().setNum(sz)+"%"); }
30 void setDocSize(int sz) { docSize->setNum(sz); } 30 void setDocSize(int sz) { docSize->setNum(sz); }
31 void setDocLocation(int sz) { docLocation->setNum(sz); } 31 void setDocLocation(int sz) { docLocation->setNum(sz); }
32 void setAbout(const QString& s); 32 void setAbout(const QString& s);
33private slots: 33private slots:
34 void infoClose() { emit Close(); } 34 void infoClose() { emit Close(); }
35 signals: 35 signals:
36 void Close(); 36 void Close();
37}; 37};
38 38
39#endif 39#endif
diff --git a/noncore/apps/opie-sheet/sheet.h b/noncore/apps/opie-sheet/sheet.h
index 92c8061..8938511 100644
--- a/noncore/apps/opie-sheet/sheet.h
+++ b/noncore/apps/opie-sheet/sheet.h
@@ -1,231 +1,231 @@
1/* 1/*
2 =. This file is part of the Opie Project 2 =. This file is part of the Opie Project
3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 .>+-= 4 .>+-=
5 _;:, .> :=|. This program is free software; you can 5 _;:, .> :=|. This program is free software; you can
6.> <`_, > . <= redistribute it and/or modify it under 6.> <`_, > . <= redistribute it and/or modify it under
7:`=1 )Y*s>-.-- : the terms of the GNU General Public 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8.="- .-=="i, .._ License as published by the Free Software 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License, 9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version. 10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_. 11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that 12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of 14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more 17..}^=.= = ; Library General Public License for more
18++= -. .` .: details. 18++= -. .` .: details.
19 : = ...= . :.=- 19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU 20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with 21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB. 22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29/* 29/*
30 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
31 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
32 */ 32 */
33 33
34#ifndef SHEET_H 34#ifndef SHEET_H
35#define SHEET_H 35#define SHEET_H
36 36
37/* QT */ 37/* QT */
38#include <qtable.h> 38#include <qtable.h>
39#include <qstack.h> 39#include <qstack.h>
40 40
41typedef struct typeCellBorders 41typedef struct typeCellBorders
42{ 42{
43 QPen right, bottom; 43 QPen right, bottom;
44}; 44};
45 45
46typedef struct typeCellData 46typedef struct typeCellData
47{ 47{
48 int col, row; 48 int col, row;
49 typeCellBorders borders; 49 typeCellBorders borders;
50 QBrush background; 50 QBrush background;
51 Qt::AlignmentFlags alignment; 51 Qt::AlignmentFlags alignment;
52 QColor fontColor; 52 QColor fontColor;
53 QFont font; 53 QFont font;
54 QString data; 54 QString data;
55}; 55};
56 56
57 57
58#define NONE_TOKEN 0 58#define NONE_TOKEN 0
59#define NUMBER_TOKEN 1 59#define NUMBER_TOKEN 1
60#define VARIABLE_TOKEN 2 60#define VARIABLE_TOKEN 2
61#define FUNCTION_TOKEN 3 61#define FUNCTION_TOKEN 3
62#define SYMBOL_TOKEN 4 62#define SYMBOL_TOKEN 4
63#define STRING_TOKEN 5 63#define STRING_TOKEN 5
64 64
65class Expression 65class Expression
66{ 66{
67public: 67public:
68 QString Body; 68 QString Body;
69 QList<QString> CompiledBody; 69 QList<QString> CompiledBody;
70 QList<int> CompiledBodyType; 70 QList<int> CompiledBodyType;
71 QString SYMBOL; 71 QString SYMBOL;
72 QString MATHSYMBOL; 72 QString MATHSYMBOL;
73 QArray<int> ArgsOfFunc; 73 QArray<int> ArgsOfFunc;
74 int FuncDepth; 74 int FuncDepth;
75 bool ErrorFound; 75 bool ErrorFound;
76 int n; // holds the current parser position 76 int n; // holds the current parser position
77 QString chunk; // the piece in the parser we are on 77 QString chunk; // the piece in the parser we are on
78 int SymbGroup; // the current type 78 int SymbGroup; // the current type
79 79
80 QString InExpr; 80 QString InExpr;
81 81
82 QChar chunk0(void); // retunrs the first char of expression; 82 QChar chunk0(void); // retunrs the first char of expression;
83 Expression(QString expr1);// constructor 83 Expression(QString expr1);// constructor
84 84
85 bool isSymbol(QChar ch); 85 bool isSymbol(QChar ch);
86 bool isMathSymbol(QChar ch); 86 bool isMathSymbol(QChar ch);
87 void GetNext(); 87 void GetNext();
88 void First(); 88 void First();
89 void Third(); 89 void Third();
90 void Fourth(); 90 void Fourth();
91 void Fifth(); 91 void Fifth();
92 void Sixth(); 92 void Sixth();
93 void Seventh(); 93 void Seventh();
94 void Eighth(); 94 void Eighth();
95 void Ninth(); 95 void Ninth();
96 96
97 bool Expression::Parse(); //parses the expression in RPN format; 97 bool Parse(); //parses the expression in RPN format;
98 98
99}; 99};
100 100
101 101
102 102
103class Sheet: public QTable 103class Sheet: public QTable
104{ 104{
105 Q_OBJECT 105 Q_OBJECT
106 106
107 // Variables 107 // Variables
108 bool clicksLocked; 108 bool clicksLocked;
109 int selectionNo; 109 int selectionNo;
110 typeCellBorders defaultBorders; 110 typeCellBorders defaultBorders;
111 typeCellData defaultCellData; 111 typeCellData defaultCellData;
112 112
113 // QT objects 113 // QT objects
114 QList<typeCellData> sheetData, clipboardData; 114 QList<typeCellData> sheetData, clipboardData;
115 QString pressedCell, releasedCell, sheetName; 115 QString pressedCell, releasedCell, sheetName;
116 QStringList listDataParser; 116 QStringList listDataParser;
117 117
118 // Private functions 118 // Private functions
119 bool findRowColumn(const QString &variable, int *row, int *col, bool giveError=FALSE); 119 bool findRowColumn(const QString &variable, int *row, int *col, bool giveError=FALSE);
120 QString findCellName(int row, int col); 120 QString findCellName(int row, int col);
121 bool findRange(const QString &variable1, const QString &variable2, int *row1, int *col1, int *row2, int *col2); 121 bool findRange(const QString &variable1, const QString &variable2, int *row1, int *col1, int *row2, int *col2);
122 QString calculateVariable(const QString &variable); 122 QString calculateVariable(const QString &variable);
123 QString calculateFunction(const QString &func, const QString &parameters, int NumOfParams); 123 QString calculateFunction(const QString &func, const QString &parameters, int NumOfParams);
124 QString getParameter(const QString &parameters, int paramNo, bool giveError=FALSE, const QString funcName=""); 124 QString getParameter(const QString &parameters, int paramNo, bool giveError=FALSE, const QString funcName="");
125 QString dataParser(const QString &cell, const QString &data); 125 QString dataParser(const QString &cell, const QString &data);
126 QString dataParserHelper(const QString &data); 126 QString dataParserHelper(const QString &data);
127 typeCellData *createCellData(int row, int col); 127 typeCellData *createCellData(int row, int col);
128 typeCellData *findCellData(int row, int col); 128 typeCellData *findCellData(int row, int col);
129 129
130 130
131 //LOGICAL / INFO 131 //LOGICAL / INFO
132 double functionCountIf(const QString &param1, const QString &param2, const QString &param3); 132 double functionCountIf(const QString &param1, const QString &param2, const QString &param3);
133 double functionSumSQ(const QString &param1, const QString &param2); //sum of squares 133 double functionSumSQ(const QString &param1, const QString &param2); //sum of squares
134 QString functionIndex(const QString &param1, const QString &param2, int indx); 134 QString functionIndex(const QString &param1, const QString &param2, int indx);
135 //math functions computations 135 //math functions computations
136 double BesselI0(double x); 136 double BesselI0(double x);
137 double BesselI(int n, double x); 137 double BesselI(int n, double x);
138 double BesselK0(double x); 138 double BesselK0(double x);
139 double BesselI1(double x); 139 double BesselI1(double x);
140 double BesselK1(double x); 140 double BesselK1(double x);
141 double BesselK(int n, double x); 141 double BesselK(int n, double x);
142 double BesselJ0(double x); 142 double BesselJ0(double x);
143 double BesselY0(double x); 143 double BesselY0(double x);
144 double BesselJ1(double x); 144 double BesselJ1(double x);
145 double BesselY1(double x); 145 double BesselY1(double x);
146 double BesselY(int n, double x); 146 double BesselY(int n, double x);
147 double BesselJ(int n, double x); 147 double BesselJ(int n, double x);
148 double GammaLn(double xx); 148 double GammaLn(double xx);
149 double Factorial(double n); 149 double Factorial(double n);
150 double GammaP(double a, double x); 150 double GammaP(double a, double x);
151 double GammaQ(double a,double x); 151 double GammaQ(double a,double x);
152 void GammaSeries(double *gamser, double a, double x, double *gln); 152 void GammaSeries(double *gamser, double a, double x, double *gln);
153 void GammaContinuedFraction(double *gammcf, double a, double x, double *gln); 153 void GammaContinuedFraction(double *gammcf, double a, double x, double *gln);
154 double ErrorFunction(double x); 154 double ErrorFunction(double x);
155 double ErrorFunctionComplementary(double x); 155 double ErrorFunctionComplementary(double x);
156 double Beta(double z, double w); 156 double Beta(double z, double w);
157 double BetaContinuedFraction(double a, double b, double x); 157 double BetaContinuedFraction(double a, double b, double x);
158 double BetaIncomplete(double a, double b, double x); 158 double BetaIncomplete(double a, double b, double x);
159 double functionVariance(const QString &param1, const QString &param2); 159 double functionVariance(const QString &param1, const QString &param2);
160 double functionVariancePopulation(const QString &param1, const QString &param2); 160 double functionVariancePopulation(const QString &param1, const QString &param2);
161 double functionSkew(const QString &param1, const QString &param2); 161 double functionSkew(const QString &param1, const QString &param2);
162 double functionKurt(const QString &param1, const QString &param2); 162 double functionKurt(const QString &param1, const QString &param2);
163 163
164 // Sheet/Qt parser functions 164 // Sheet/Qt parser functions
165 double functionSum(const QString &param1, const QString &param2); 165 double functionSum(const QString &param1, const QString &param2);
166 double functionAvg(const QString &param1, const QString &param2); 166 double functionAvg(const QString &param1, const QString &param2);
167 double functionMax(const QString &param1, const QString &param2); 167 double functionMax(const QString &param1, const QString &param2);
168 double functionMin(const QString &param1, const QString &param2); 168 double functionMin(const QString &param1, const QString &param2);
169 double functionCount(const QString &param1, const QString &param2); 169 double functionCount(const QString &param1, const QString &param2);
170 170
171 // Reimplemented QTable functions 171 // Reimplemented QTable functions
172 void paintCell(QPainter *p, int row, int col, const QRect & cr, bool selected); 172 void paintCell(QPainter *p, int row, int col, const QRect & cr, bool selected);
173 void viewportMousePressEvent(QMouseEvent *e); 173 void viewportMousePressEvent(QMouseEvent *e);
174 void viewportMouseMoveEvent(QMouseEvent *e); 174 void viewportMouseMoveEvent(QMouseEvent *e);
175 void viewportMouseReleaseEvent(QMouseEvent *e); 175 void viewportMouseReleaseEvent(QMouseEvent *e);
176 176
177public slots: 177public slots:
178 void slotCellSelected(int row, int col); 178 void slotCellSelected(int row, int col);
179 void slotCellChanged(int row, int col); 179 void slotCellChanged(int row, int col);
180 180
181public: 181public:
182 Sheet(int numRows, int numCols, QWidget *parent); 182 Sheet(int numRows, int numCols, QWidget *parent);
183 ~Sheet(); 183 ~Sheet();
184 void ReCalc(void); 184 void ReCalc(void);
185 void setData(const QString &data); 185 void setData(const QString &data);
186 QString getData(); 186 QString getData();
187 187
188 void setName(const QString &data); 188 void setName(const QString &data);
189 QString getName(); 189 QString getName();
190 190
191 void setPen(int row, int col, int vertical, const QPen &pen); 191 void setPen(int row, int col, int vertical, const QPen &pen);
192 QPen getPen(int row, int col, int vertical); 192 QPen getPen(int row, int col, int vertical);
193 193
194 void setBrush(int row, int col, const QBrush &brush); 194 void setBrush(int row, int col, const QBrush &brush);
195 QBrush getBrush(int row, int col); 195 QBrush getBrush(int row, int col);
196 196
197 void setTextAlign(int row, int col, Qt::AlignmentFlags flags); 197 void setTextAlign(int row, int col, Qt::AlignmentFlags flags);
198 Qt::AlignmentFlags getAlignment(int row, int col); 198 Qt::AlignmentFlags getAlignment(int row, int col);
199 199
200 void setTextFont(int row, int col, const QFont &font, const QColor &color); 200 void setTextFont(int row, int col, const QFont &font, const QColor &color);
201 QFont getFont(int row, int col); 201 QFont getFont(int row, int col);
202 QColor getFontColor(int row, int col); 202 QColor getFontColor(int row, int col);
203 203
204 void lockClicks(bool lock=TRUE); 204 void lockClicks(bool lock=TRUE);
205 void copySheetData(QList<typeCellData> *destSheetData); 205 void copySheetData(QList<typeCellData> *destSheetData);
206 void setSheetData(QList<typeCellData> *srcSheetData); 206 void setSheetData(QList<typeCellData> *srcSheetData);
207 void getSelection(int *row1, int *col1, int *row2, int *col2); 207 void getSelection(int *row1, int *col1, int *row2, int *col2);
208 208
209 void insertRows(int no=1, bool allColumns=TRUE); 209 void insertRows(int no=1, bool allColumns=TRUE);
210 void insertColumns(int no=1, bool allRows=TRUE); 210 void insertColumns(int no=1, bool allRows=TRUE);
211 211
212 void dataFindReplace(const QString &find, const QString &replace, bool matchCase=TRUE, bool allCells=TRUE, bool entireCell=FALSE, bool replace=FALSE, bool replaceAll=FALSE); 212 void dataFindReplace(const QString &find, const QString &replace, bool matchCase=TRUE, bool allCells=TRUE, bool entireCell=FALSE, bool replace=FALSE, bool replaceAll=FALSE);
213 213
214 // Static functions 214 // Static functions
215 static int getHeaderColumn(const QString &section); 215 static int getHeaderColumn(const QString &section);
216 static QString getHeaderString(int section); 216 static QString getHeaderString(int section);
217 217
218public slots: 218public slots:
219 void editCut(); 219 void editCut();
220 void editCopy(); 220 void editCopy();
221 void editPaste(bool onlyContents=FALSE); 221 void editPaste(bool onlyContents=FALSE);
222 void editClear(); 222 void editClear();
223 void swapCells(int row1, int col1, int row2, int col2); 223 void swapCells(int row1, int col1, int row2, int col2);
224 224
225signals: 225signals:
226 void currentDataChanged(const QString &data); 226 void currentDataChanged(const QString &data);
227 void cellClicked(const QString &cell); 227 void cellClicked(const QString &cell);
228 void sheetModified(); 228 void sheetModified();
229}; 229};
230 230
231#endif 231#endif