kspread

kspread_dlg_goalseek.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
00003              (C) 2002-2003 Philipp Mueller <philipp.mueller@gmx.de>
00004              (C) 2002 Laurent Montel <montel@kde.org>
00005              (C) 2002 John Dailey <dailey@vt.edu>
00006              (C) 2002 Ariya Hidayat <ariya@kde.org>
00007              (C) 2002 Werner Trobin <trobin@kde.org>
00008              (C) 2002 Harri Porten <porten@kde.org>
00009 
00010    This library is free software; you can redistribute it and/or
00011    modify it under the terms of the GNU Library General Public
00012    License as published by the Free Software Foundation; either
00013    version 2 of the License, or (at your option) any later version.
00014 
00015    This library is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018    Library General Public License for more details.
00019 
00020    You should have received a copy of the GNU Library General Public License
00021    along with this library; see the file COPYING.LIB.  If not, write to
00022    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00023  * Boston, MA 02110-1301, USA.
00024 */
00025 
00026 #ifndef __kspread_dlg_goalseek__
00027 #define __kspread_dlg_goalseek__
00028 
00029 #include <kdialog.h>
00030 #include <qpoint.h>
00031 #include <qrect.h>
00032 
00033 class QFrame;
00034 class QGridLayout;
00035 class QHBoxLayout;
00036 class QLabel;
00037 class QLineEdit;
00038 class QPushButton;
00039 class QVBoxLayout;
00040 
00041 namespace KSpread
00042 {
00043 class Cell;
00044 class Point;
00045 class Sheet;
00046 class View;
00047 
00048 class GoalSeekDialog : public KDialog
00049 {
00050   Q_OBJECT
00051 
00052  public:
00053    GoalSeekDialog( View * parent, QPoint const & marker, const char * name = 0,
00054                       bool modal = FALSE, WFlags fl = 0 );
00055    ~GoalSeekDialog();
00056 
00060   bool eventFilter( QObject* obj, QEvent* ev );
00061 
00062  public slots:
00063   void buttonOkClicked();
00064   void buttonCancelClicked();
00065   void slotSelectionChanged();
00066 
00067  protected:
00068   virtual void closeEvent ( QCloseEvent * );
00069 
00070   QGridLayout * GoalSeekDialogLayout;
00071   QGridLayout * m_startFrameLayout;
00072   QGridLayout * m_resultFrameLayout;
00073 
00074  private:
00075   View * m_pView;
00076   Cell * m_sourceCell;
00077   Cell * m_targetCell;
00078   double        m_result;
00079   int           m_maxIter;
00080   bool          m_restored;
00081   double        m_oldSource;
00082 
00083   QString       m_oldText;
00084   QString       m_sheetName;
00085 
00086   QFrame      * m_startFrame;
00087   QLineEdit   * m_targetValueEdit;
00088   QLineEdit   * m_targetEdit;
00089   QLineEdit   * m_sourceEdit;
00090   QPushButton * m_buttonOk;
00091   QPushButton * m_buttonCancel;
00092   QFrame      * m_resultFrame;
00093   QLabel      * m_newValueDesc;
00094   QLabel      * m_currentValueLabel;
00095   QLabel      * m_newValue;
00096   QLabel      * m_currentValue;
00097   QLabel      * m_resultText;
00098 
00104   QLineEdit   * m_focus;
00105 
00106   QPoint        m_anchor;
00107   QPoint        m_marker;
00108   QRect         m_selection;
00109 
00110   void startCalc(double _start, double _goal);
00111   void chooseCleanup();
00112 };
00113 
00114 } // namespace KSpread
00115 
00116 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys