kspread

kspread_dlg_formula.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2003 Ariya Hidayat <ariya@kde.org>
00003              (C) 2002-2003 Norbert Andres <nandres@web.de>
00004              (C) 1999-2003 Laurent Montel <montel@kde.org>
00005              (C) 2002 Philipp Mueller <philipp.mueller@gmx.de>
00006              (C) 2002 John Dailey <dailey@vt.edu>
00007              (C) 2002 Daniel Herring <herring@eecs.ku.edu>
00008              (C) 2000-2001 Werner Trobin <trobin@kde.org>
00009              (C) 1998-2000 Torben Weis <weis@kde.org>
00010 
00011    This library is free software; you can redistribute it and/or
00012    modify it under the terms of the GNU Library General Public
00013    License as published by the Free Software Foundation; either
00014    version 2 of the License, or (at your option) any later version.
00015 
00016    This library is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019    Library General Public License for more details.
00020 
00021    You should have received a copy of the GNU Library General Public License
00022    along with this library; see the file COPYING.LIB.  If not, write to
00023    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00024  * Boston, MA 02110-1301, USA.
00025 */
00026 
00027 #ifndef __kspread_dlg_formula__
00028 #define __kspread_dlg_formula__
00029 
00030 #include <qframe.h>
00031 
00032 #include <kcompletion.h>
00033 #include <kdialogbase.h>
00034 
00035 class QComboBox;
00036 class QLabel;
00037 class QLineEdit;
00038 class QListBox;
00039 class QPushButton;
00040 class QTabWidget;
00041 class QTextBrowser;
00042 class KLineEdit;
00043 
00044 namespace KSpread
00045 {
00046 class FunctionDescription;
00047 class Sheet;
00048 class View;
00049 
00050 class FormulaDialog : public KDialogBase
00051 {
00052     Q_OBJECT
00053 public:
00054   FormulaDialog( View* parent, const char* name,const QString& formulaName=0);
00055   ~FormulaDialog();
00056 private:
00061     QString createParameter( const QString& _text, int param );
00066     QString createFormula();
00067 
00068 private slots:
00072     void slotOk();
00076     void slotClose();
00081     void slotSelected( const QString& function );
00087     void slotShowFunction( const QString& function );
00093     void slotDoubleClicked( QListBoxItem* item );
00097     void slotActivated(const QString& category );
00101     void slotChangeText(const QString& text );
00106     void slotSelectionChanged();
00111     void slotSelectButton();
00115     void slotSearchText(const QString& text );
00119     void slotPressReturn();
00120 
00121 public:
00125     bool eventFilter( QObject* obj, QEvent* ev );
00126 protected:
00127        virtual void closeEvent ( QCloseEvent * );
00128 private:
00129     View* m_pView;
00130 
00131     QTabWidget* m_tabwidget;
00132     QTextBrowser* m_browser;
00133     QWidget* m_input;
00134 
00135     QPushButton *selectFunction;
00136     QComboBox *typeFunction;
00137     QListBox *functions;
00138     QLineEdit *result;
00139 
00140     KLineEdit *searchFunct;
00141     KCompletion listFunct;
00142 
00143     QLabel* label1;
00144     QLabel* label2;
00145     QLabel* label3;
00146     QLabel* label4;
00147     QLabel* label5;
00148     QLineEdit *firstElement;
00149     QLineEdit *secondElement;
00150     QLineEdit *thirdElement;
00151     QLineEdit *fourElement;
00152     QLineEdit *fiveElement;
00158     QLineEdit* m_focus;
00159 
00160     int m_column;
00161     int m_row;
00162     QString m_oldText;
00163 
00164     QString m_funcName;
00165     QString m_sheetName;
00166 
00167     QString m_rightText;
00168     QString m_leftText;
00172     bool refresh_result;
00173 
00174     KSpread::FunctionDescription* m_desc;
00175 };
00176 
00177 } // namespace KSpread
00178 
00179 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys