summaryrefslogtreecommitdiffstats
path: root/src/kqalculate.h
blob: 6f1d8748294e519a1748d489ee9207af87b1ad8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
/***************************************************************************
 *   Copyright (C) 2005-2007 by Niklas Knutsson                            *
 *   nq@altern.org                                                         *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef KQALCULATE_H
#define KQALCULATE_H

#include <tqvariant.h>
#include <tdemainwindow.h>
#include <tqvaluevector.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include <tqstylesheet.h>
#include <ktextbrowser.h>
#include <tdelistview.h>
#include <kdialogbase.h>
#include <tdeshortcut.h>

class Prefix;
class QalculatePrecisionDialog;
class Variable;
class MathFunction;
class Unit;
class QalculateDecimalsDialog;
class QalculateEditVariableDialog;
class QalculateEditMatrixVectorDialog;
class QalculateEditUnitDialog;
class QalculateEditFunctionDialog;
class QalculateEditDataSetDialog;
class QalculateEditUnknownVariableDialog;
class QalculateVariablesDialog;
class QalculateFunctionsDialog;
class QalculateUnitsDialog;
class QalculateDataSetsDialog;
class QalculateConvertUnitsDialog;
class TDEAction;
class TDERadioAction;
class TDEToggleAction;
class TQToolBar;
class TQPopupMenu;
class KPushButton;
class QalculateExpressionEdit;
class QalculateResultDisplay;
class TQFrame;
class TQWidgetStack;
class TQWidget;
class TQComboBox;
class QalculateHistoryBrowser;
class QalculateConvertNumberBasesDialog;
class QalculatePeriodicTableDialog;
class QalculatePlotDialog;
class QalculateSetBaseDialog;
class KLineEdit;
class MathStructure;
class QalculateImportCSVDialog;
class QalculateExportCSVDialog;
class QalculatePreferencesDialog;
class QalculateInsertMatrixVectorDialog;
class KSystemTray;
class QalculateParseLabel;
class TQButtonGroup;
class TQRadioButton;
class QalculateButton;
class TQVBoxLayout;
class KSeparator;
class KUniqueApplication;
class TDEConfig;
class TQListViewItem;
class QalculateRPNStackListView;
class TDEGlobalAccel;
class KKeyButton;

void *view_proc(void *pipe);
void *command_proc(void *pipe);

enum {
	COMMAND_FACTORIZE,
	COMMAND_SIMPLIFY
};


class ModeObject : public TQObject {

	Q_OBJECT
	
	public:

		ModeObject(int mode);
		int i_mode;

	public slots:

		void loadMode();
		
};

class KQalculate : public TDEMainWindow {
	
	Q_OBJECT

public:

	KQalculate(KUniqueApplication *parent = 0, const char* name = 0, WFlags fl = WType_TopLevel | WDestructiveClose);
	virtual ~KQalculate();

	void setupActions();
	void setAssumptionsMenu();
	void setModeActions();
	void execute_expression(bool force = true);
	void setResult(Prefix *prefix = NULL, bool update_history = true, bool update_parse = false, bool force = false, TQString transformation = "", size_t stack_index = 0, bool register_moved = false);
	void executeCommand(int command_type);
	void result_display_updated();
	void result_format_updated();
	void result_action_executed();
	void result_prefix_changed(Prefix *prefix = NULL);
	void expression_calculation_updated();
	void expression_format_updated(bool recalculate = false);
	void display_errors(TQString *new_text = NULL, int *inhistory_index = NULL);
	void update_status_text();
	void display_function_hint(MathFunction *f, int arg_index = 1);
	void clearresult();
	void create_fmenu();
	void create_vmenu();
	void create_umenu();
	void create_toumenu();
	void create_setpmenu();
	void recreate_recent_functions();
	void recreate_recent_variables();
	void recreate_recent_units();
	void function_inserted(MathFunction *object);
	void variable_inserted(Variable *object);
	void unit_inserted(Unit *object);
	void updateStatusLabelFonts();
	void set_unicode_buttons();
	void insertButtonFunction(TQString text, bool append_space = true);
	void insertButtonFunction(MathFunction *f);
	const MathStructure *getResultPart(int);
	void insertMatrixVector(const MathStructure *m = NULL, bool do_vector = false, bool is_text_struct = false, bool is_result = false);

	void calculateRPN(int op);
	void calculateRPN(MathFunction *f);
	void RPNStackEnter(Variable *v);
	void RPNRegisterAdded(const TQString &text, size_t index = 0);
	void RPNRegisterRemoved(size_t index);
	void RPNRegisterChanged(const TQString &text, size_t index = 0);

	QalculateInsertMatrixVectorDialog *insert_matrix_dialog;
	QalculatePrecisionDialog *precisionDialog;
	QalculateDecimalsDialog *decimalsDialog;
	QalculateConvertUnitsDialog *convert_to_unit_expression_dialog;
	QalculateEditVariableDialog *variable_edit_dialog, *store_dialog;
	QalculateEditMatrixVectorDialog *matrix_edit_dialog;
	QalculateEditUnitDialog *unit_edit_dialog;
	QalculateEditFunctionDialog *function_edit_dialog;
	QalculateEditDataSetDialog *dataset_edit_dialog;
	QalculateEditUnknownVariableDialog *unknown_edit_dialog;
	QalculateVariablesDialog *variables_dialog;
	QalculateFunctionsDialog *functions_dialog;
	QalculateUnitsDialog *units_dialog;
	QalculateDataSetsDialog *datasets_dialog;
	QalculateConvertNumberBasesDialog *convert_number_bases_dialog;
	QalculatePeriodicTableDialog *periodic_table_dialog;
	QalculateImportCSVDialog *import_csv_dialog;
	QalculateExportCSVDialog *export_csv_dialog;
	QalculatePlotDialog *plot_dialog;
	QalculateSetBaseDialog *set_base_dialog;
	QalculatePreferencesDialog *preferences_dialog;
	TQMap <int, Variable*> menu_variables_ids;
	TQMap <int, MathFunction*> menu_functions_ids;
	TQMap <int, Unit*> menu_units_ids, menu_to_unit_ids;
	TQMap <int, Prefix*> menu_units_prefixes_ids, menu_set_prefix_ids;
	TQValueVector<int> recent_function_ids;
	TQValueVector<int> recent_variable_ids;
	TQValueVector<int> recent_unit_ids;

	QalculateRPNStackListView *stackList;
	TQVBoxLayout *stackPageButtonsLayout;
	QalculateButton *registerUpButton, *registerDownButton, *deleteRegisterButton, *editRegisterButton, *clearStackButton;
	TQPopupMenu *stackMenu;
	KUniqueApplication *m_parent;
	KSystemTray *trayicon;
	QalculateButton *executeButton, *storeButton, *convertButton;
	QalculateButton *functionsButton;
	TQVBoxLayout *leftButtonsLayout;
	KSeparator *leftButtonsSeparator;
	QalculateExpressionEdit* expressionEdit;
	TQLabel *statusLabel_r;
	QalculateParseLabel *statusLabel_l;
	QalculateResultDisplay* resultLabel;
	TQWidgetStack* mainStack;
	TQFrame *bottomLine;
	TQWidget *keypadPage, *historyPage, *stackPage;
	TQComboBox* kpNumericCombo, *kpBaseCombo;
	TQRadioButton *kpDegreesButton, *kpRadiansButton, *kpGradiansButton, *kpNoAngleUnitButton;
	TQButtonGroup *kpAngleGroup;
	TQPushButton *kpExact, *kpFraction;
	QalculateButton *kpSquare, *kpLog, *kpHyp, *kpSqrt, *kpCos, *kpRaise, *kpInv, *kpSin;
	QalculateButton *kpTan, *kpLn, *kpFactorial, *kpMod, *kpAns, *kp8, *kp0, *kp7, *kpDel, *kpDot, *kp5, *kpEquals, *kpClear;
	QalculateButton *kp3, *kp1, *kp4, *kp9, *kpDivision, *kpExp, *kp6, *kp2, *kpMinus, *kpTimes, *kpPlus;
	QalculateHistoryBrowser *historyBrowser;
	TQPushButton *historyButton, *keypadButton, *stackButton;
	KMenuBar *menubar;
	TQPopupMenu *menu_functions, *menu_variables, *menu_units, *menu_to_unit, *menu_set_prefix, *menu_modes;
	TDEToggleAction *ActionAbbreviateNames, *ActionReadPrecision, *ActionNonZeroDenominators, *ActionWarnAboutDenominatorsAssumedNonZero;
	TDEToggleAction *ActionLimitImplicitMultiplication, *ActionRPNMode, *ActionRPNSyntax, *ActionIndicateInfiniteSeries, *ActionNegativeExponents, *ActionSortMinusLast;
	TDEToggleAction *ActionShowEndingZeroes, *ActionRoundHalfwayNumbersToEven, *ActionEnablePrefixes;
	TDEToggleAction *ActionEnableUseOfAllPrefixes, *ActionEnableDenominatorPrefixes, *ActionPlaceUnitsSeparately;
	TDEToggleAction *ActionEnableVariables, *ActionEnableFunctions, *ActionEnableUnits, *ActionEnableUnknowns;
	TDEToggleAction *ActionCalculateVariables, *ActionAllowComplexResult, *ActionAllowInfiniteResult;
	TDERadioAction *ActionApproximationAlwaysExact, *ActionApproximationTryExact, *ActionApproximationApproximate;
	TDERadioAction *ActionAlgebraicModeSimplify, *ActionAlgebraicModeFactorize, *ActionAlgebraicModeNone;
	TDERadioAction *ActionFractionalDisplayDecimal, *ActionFractionalDisplayDecimalTryExact;
	TDERadioAction *ActionFractionalDisplayFraction, *ActionFractionalDisplayCombined;
	TDERadioAction *ActionNumericalDisplayEngineering, *ActionNumericalDisplayScientific, *ActionNumericalDisplayPurelyScientific, *ActionNumericalDisplaySimple, *ActionNumericalDisplayNormal;
	TDERadioAction *ActionNumberBaseBinary, *ActionNumberBaseOctal, *ActionNumberBaseDecimal, *ActionNumberBaseHexadecimal, *ActionNumberBaseOther;
	TDERadioAction *ActionNumberBaseSexagesimal, *ActionNumberBaseTimeFormat, *ActionNumberBaseRomanNumerals;
	TDERadioAction *ActionAssumptionTypeUnknown, *ActionAssumptionTypeNonMatrix, *ActionAssumptionTypeNumber, *ActionAssumptionTypeComplex, *ActionAssumptionTypeReal;
	TDERadioAction *ActionAssumptionTypeRational, *ActionAssumptionTypeInteger, *ActionAssumptionSignUnknown, *ActionAssumptionSignNonZero;
	TDERadioAction *ActionAssumptionSignPositive, *ActionAssumptionSignNonNegative, *ActionAssumptionSignNegative;
	TDERadioAction *ActionAssumptionSignNonPositive, *ActionAngleUnitDegrees, *ActionAngleUnitRadians, *ActionAngleUnitGradians;
	TDERadioAction *ActionAngleUnitNone, *ActionAutoNoConversion, *ActionAutoConvertToBaseUnits, *ActionAutoConvertToBestUnit;
	TDEAction *ActionSetBase, *ActionPrecision, *ActionDecimals, *ActionSaveModeAs, *ActionDeleteMode, *ActionSaveMode, *ActionQuit;
	TDEAction *ActionUpdateExchangeRates, *ActionManageVariables, *ActionConvertToUnitExpression, *ActionStoreResult, *ActionClose;
	TDEAction *ActionConvertNumberBases, *ActionManageFunctions, *ActionConvertToBaseUnits, *ActionConvertToBestUnit;
	TDEAction *ActionManageUnits, *ActionManageDataSets, *ActionFactorize, *ActionSimplify, *ActionSetUnknowns, *ActionCopyResult;
	TDEAction *ActionPreferences, *ActionSaveAsImage, *ActionImportCSVFile, *ActionExportCSVFile, *ActionPeriodicTable;
	TDEAction *ActionPlotFunctionsData, *ActionSaveDefinitions, *ActionNewVariable, *ActionNewMatrix, *ActionNewVector;
	TDEAction *ActionNewUnknownVariable, *ActionNewFunction, *ActionNewUnit, *ActionNewDataSet;
	TDEAction *ActionInsertMatrix, *ActionInsertVector;
	TDEAction *ActionClearHistory;
	TDEAction *ActionHideSystemTrayIcon, *ActionHide;
	TDEAction *ActionClearStack, *ActionDeleteRegister, *ActionEditRegister;
	TDEAction *ActionConfigureGlobalShortcuts;

	TDEGlobalAccel *globalAccel;

	TQValueVector<int>::size_type current_history_index;
	TQValueVector<ModeObject*> mode_objects;

public slots:

	void executeCommand2();
	void setResult2();
	void execute_expression2();

	void showHide();
	void configureGlobalShortcuts();

	void update_fmenu();
	void update_vmenu();	
	void update_umenus();
	void insertVariable(Variable*);
	void insertFunction(MathFunction*, TQWidget *parent);
	void applyFunction(MathFunction*, TQWidget *parent);
	void onExpressionChanged();
	void onErrorTimeout();
	bool fetch_exchange_rates(int);
	void update_completion();
	void insert_text(TQString);
	void aboutToQuit();
	void onVariableMenuItemActivated(int);
	void onFunctionMenuItemActivated(int);
	void onUnitMenuItemActivated(int);
	void onUnitsPrefixMenuItemActivated(int);
	void precisionRecalculate();
	void setMaxDecimals(int);
	void setMinDecimals(int);
	void execute();
	void toggleHistory(bool);
	void toggleStack(bool);
	void toggleKeypad(bool);
	void showEndingZeroes(bool);
	void approximationTryExact();
	void approximationAlwaysExact();
	void approximationApproximate();
	void fractionalDisplayDecimal();
	void fractionalDisplayDecimalTryExact();
	void fractionalDisplayFraction();
	void fractionalDisplayCombined();
	void numericalDisplayNormal();
	void numericalDisplayEngineering();
	void numericalDisplayScientific();
	void numericalDisplayPurelyScientific();
	void numericalDisplaySimple();
	void indicateInfiniteSeries(bool);
	void sortMinusLast(bool);
	void negativeExponents(bool);
	void roundHalfwayNumbersToEven(bool);
	void abbreviateNames(bool);
	void updateBaseOther();
	void numberBaseBinary();
	void numberBaseOctal();
	void numberBaseDecimal();
	void numberBaseOther();
	void numberBaseHexadecimal();
	void numberBaseSexagesimal();
	void numberBaseTimeFormat();
	void numberBaseRomanNumerals();
	void setBaseInResultFromDialogGroup(int);
	void setBaseInResultFromDialogBox(int);
	void setBaseInExpressionFromDialogGroup(int);
	void setBaseInExpressionFromDialogBox(int);
	void setBase();
	void nonZeroDenominators(bool);
	void warnAboutDenominatorsAssumedNonZero(bool);
	void algebraicModeSimplify();
	void algebraicModeFactorize();
	void algebraicModeNone();
	void readPrecision(bool);
	void limitImplicitMultiplication(bool);
	void setPrecision(int);
	void precision();
	void decimals();
	void rpnMode(bool);
	void rpnSyntax(bool);
	void assumptionSignUnknown();
	void assumptionSignNonZero();
	void assumptionSignPositive();
	void assumptionSignNonNegative();
	void assumptionSignNegative();
	void assumptionSignNonPositive();
	void assumptionTypeUnknown();
	void assumptionTypeNonMatrix();
	void assumptionTypeNumber();
	void assumptionTypeComplex();
	void assumptionTypeReal();
	void assumptionTypeRational();
	void assumptionTypeInteger();
	void loadMode(int);
	void onModesMenuItemActivated(int);
	void saveModeAs();
	void deleteMode();
	void saveMode();
	void angleUnitDegrees();
	void angleUnitRadians();
	void angleUnitGradians();
	void angleUnitNone();
	void autoNoConversion();
	void autoConvertToBaseUnits();
	void autoConvertToBestUnit();
	void enablePrefixes(bool);
	void enableUseOfAllPrefixes(bool);
	void enableDenominatorPrefixes(bool);
	void placeUnitsSeparately(bool);
	void enableVariables(bool);
	void enableFunctions(bool);
	void enableUnits(bool);
	void enableUnknowns(bool);
	void calculateVariables(bool);
	void allowComplexResult(bool);
	void allowInfiniteResult(bool);
	void updateExchangeRates();
	void insertKP1();
	void insertKP2();
	void insertKP3();
	void insertKP4();
	void insertKP5();
	void insertKP6();
	void insertKP7();
	void insertKP8();
	void insertKP9();
	void insertKP0();
	void insertDot();
	void insertExp();
	void insertAns();
	void insertMinus();
	void insertPlus();
	void insertTimes();
	void insertDivision();
	void insertCos();
	void insertSin();
	void insertTan();
	void insertSqrt();
	void insertLog();
	void insertLn();
	void insertRaise();
	void clearExpression();
	void expressionDel();
	void insertSquare();
	void setExactMode(bool);
	void setFractionMode(bool);
	void kpSetAngleUnit(int);
	void kpSetBaseSelected(int);
	void kpSetBase(int);
	void kpSetNumericalMode(int);
	void insertFactorial();
	void insertMod();
	void storeResult();
	void manageVariables();
	void convertToUnitConvertToDialogExpression();
	void convertToUnitExpression();
	void convertNumberBases();
	void insertManagedFunction(MathFunction*);
	void applyManagedFunction(MathFunction*);
	void manageFunctions();
	void manageUnits();
	void insertUnit(Unit *u);
	void convertResult(Unit *u);
	void factorize();
	void simplify();
	void manageDataSets();
	void setUnknownsApplyClicked();
	void setUnknowns();
	void convertToBaseUnits();
	void convertToBestUnit();
	void copyResult();
	void clearHistory();
	void preferences();
	void applyPreferences();
	void onConvertToUnitMenuItemActivated(int);
	void onSetPrefixMenuItemActivated(int);
	void periodicTable();
	void plotFunctionsData();
	void saveDefinitions();
	void saveAsImage();
	void importCSVFile();
	void exportCSVFile();
	void newVariable();
	void newMatrix();
	void newVector();
	void newUnknownVariable();
	void newFunction();
	void newDataSet();
	void newUnit();
	void insertMatrix();
	void insertVector();
	void showSystemTrayIcon(bool);
	void hideSystemTrayIcon();
	void displayParseStatus();
	void registerUp();
	void registerDown();
	void clearStack();
	void deleteRegister();
	void editRegister();
	void updateRPNIndexes();
	TQListViewItem *getRPNRegister(size_t index);
	void stackRegisterMoved();
	void stackRegisterSet(TQListViewItem*);
	void popupStackMenu(TDEListView*, TQListViewItem*, const TQPoint&);
	void registerSelected();
	void editHistoryExpression();
	void editHistoryParse();
	void editHistoryResult();
	void insertHistoryResultVariable();

protected:

	void updateButtonWidths();
	void applySetUnknowns(bool okclicked);
	bool b_unknowns_changed;
	TQValueVector<bool> unknown_changed;
	MathStructure *mstruct_before_unknowns, *unknowns_mstruct;
	TQValueVector<KLineEdit*> unknowns_entries;
	bool queryClose();
	TQString parsed_expression;
	void keyPressEvent(TQKeyEvent *e);
	void fontChange(const TQFont &old_font);
	void saveProperties(TDEConfig *cfg);
	void readProperties(TDEConfig *cfg);
	
private:

	bool close_to_systray_was;
	bool display_expression_status_was;
	int history_height;

};

class QalculateHistoryBrowser : public KTextBrowser {

	Q_OBJECT
	
public:

	QalculateHistoryBrowser(TQWidget *parent, const char *name);
	~QalculateHistoryBrowser();

protected:

	TQPopupMenu *createPopupMenu(const TQPoint &pos);

};

class QalculateParseLabel : public TQLabel {

	Q_OBJECT

public:

	QalculateParseLabel(TQWidget *parent = 0, const char *name = 0);
	virtual ~QalculateParseLabel();
	
	void setText(TQString text, bool break_begin, bool error_color, bool warning_color);
	
protected:

	TQString parsetext;
	bool bb, ec, wc;
	void drawContents(TQPainter *p);

};

class QalculateButton : public TQPushButton {

	Q_OBJECT

public:

	QalculateButton(TQWidget *parent = 0, const char *name = 0);
	QalculateButton(const TQString &text, TQWidget *parent = 0, const char *name = 0);
	QalculateButton(const TQIconSet &icon, const TQString &text, TQWidget *parent = 0, const char *name = 0);
	virtual ~QalculateButton();
	
	void setUseMinThreeCharWidth(bool b);
	void setMarkup(const TQString &str);
	TQSize sizeHint() const;
	
private:

	bool umtcw;

};

class QalculateStyleSheet : public TQStyleSheet {

	Q_OBJECT

public:

	QalculateStyleSheet(TQObject *parent = 0, const char *name = 0);
	virtual ~QalculateStyleSheet();
	
	void scaleFont(TQFont &font, int logicalSize) const;

};

class QalculateRPNStackListView : public TDEListView {

	Q_OBJECT

public:

	QalculateRPNStackListView(TQWidget *parent = 0, const char *name = 0);
	virtual ~QalculateRPNStackListView();

protected:

	void keyPressEvent(TQKeyEvent *e);

};

class QalculateModeDialog : public KDialogBase {
	
	Q_OBJECT
	
	protected:

		KKeyButton *keyButton;
		KComboBox *modeCombo;
		
	public:
		
		QalculateModeDialog(TQWidget *parent);
		virtual ~QalculateModeDialog();

		TQString modeName();
		const TDEShortcut &modeShortcut();

	public slots:
		
		void slotOk();
		void updateShortcut(const TDEShortcut&);
		void modeSelected(int);
		
};

#endif // QALCULATE_KWINDOW_H