1
/* This file is part of the KDE project
2
Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
Copyright (C) 1999 Montel Laurent <montell@club-internet.fr>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
21
#ifndef __kspread_dlg_formula__
22
#define __kspread_dlg_formula__
25
#include <kdialogbase.h>
27
#include <kcompletion.h>
42
#include "kspread_functions.h"
44
class KSpreadDlgFormula : public KDialogBase
48
KSpreadDlgFormula( KSpreadView* parent, const char* name,const QString& formulaName=0);
52
* Turns the @p text into a parameter that koscript can understand. The type
53
* of this parameter is extracted by looking at parameter number @p param in @ref #m_desc.
55
QString createParameter( const QString& _text, int param );
57
* Reads the text out of @ref #firstElement and friends and creates a parameter
58
* list for the function.
60
QString createFormula();
64
* Called by the Ok button.
68
* Called by the Close button.
72
* Called if a function name was selected but not double clicked.
73
* This will just show the help page for the function.
75
void slotSelected( const QString& function );
77
* Called if the user clicked on one of the "related function"
78
* This will switch the active function and show help page
79
* of the function as well.
81
void slotShowFunction( const QString& function );
83
* Called if the user double clicked on some method name.
84
* That will switch into editing mode, allowing the user
85
* to enter the parameters for the function.
87
void slotDoubleClicked( QListBoxItem* item );
89
* Called if a category of methods has been selected.
91
void slotActivated(const QString& category );
93
* Called if the text of @ref #firstElement, @ref #secondElement etc. changes.
95
void slotChangeText(const QString& text );
97
* Connected to @ref KSpreadView to get notified if the selection in the
100
void slotSelectionChanged( KSpreadSheet* _table, const QRect& _selection );
102
* Called if the button @ref #selectFunction was clicked. That
103
* insertes a new function call to the result.
105
void slotSelectButton();
107
* Called if the user changes some character in @ref #searchFunct.
109
void slotSearchText(const QString& text );
111
* Called if the user pressed return in @ref #searchFunct.
113
void slotPressReturn();
117
* Find out which widget got focus.
119
bool eventFilter( QObject* obj, QEvent* ev );
121
virtual void closeEvent ( QCloseEvent * );
123
KSpreadView* m_pView;
125
QTabWidget* m_tabwidget;
126
QTextBrowser* m_browser;
129
QPushButton *selectFunction;
130
QComboBox *typeFunction;
134
KLineEdit *searchFunct;
135
KCompletion listFunct;
142
QLineEdit *firstElement;
143
QLineEdit *secondElement;
144
QLineEdit *thirdElement;
145
QLineEdit *fourElement;
146
QLineEdit *fiveElement;
148
* Tells which of the lineedits has the logical focus currently.
149
* It may happen that a lineedit does not have qt focus but
150
* logical focus but not the other way round.
164
* A lock for @ref #slotChangeText.
168
KSpreadFunctionDescription* m_desc;