kspread

kspread_dlg_conditional.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 John Dailey <dailey@vt.edu>
00005              (C) 1999-2004 Laurent Montel <montel@kde.org>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef __kspread_dlg_conditional__
00024 #define __kspread_dlg_conditional__
00025 
00026 #include <kdialogbase.h>
00027 #include <qwidget.h>
00028 
00029 #include "kspread_condition.h"
00030 
00031 class QComboBox;
00032 class KLineEdit;
00033 
00034 namespace KSpread
00035 {
00036 class Style;
00037 class View;
00038 
00039 class ConditionalWidget : public QWidget
00040 {
00041   Q_OBJECT
00042 
00043  public:
00044   ConditionalWidget( QWidget * parent = 0, const char * name = 0, WFlags fl = 0 );
00045   ~ConditionalWidget();
00046 
00047   QComboBox * m_condition_1;
00048   QComboBox * m_style_1;
00049   KLineEdit * m_firstValue_1;
00050   KLineEdit * m_secondValue_1;
00051 
00052   QComboBox * m_condition_2;
00053   QComboBox * m_style_2;
00054   KLineEdit * m_firstValue_2;
00055   KLineEdit * m_secondValue_2;
00056 
00057   QComboBox * m_condition_3;
00058   QComboBox * m_style_3;
00059   KLineEdit * m_firstValue_3;
00060   KLineEdit * m_secondValue_3;
00061 
00062  public slots:
00063   void slotTextChanged1( const QString & );
00064   void slotTextChanged2( const QString & );
00065   void slotTextChanged3( const QString & );
00066 };
00067 
00068 
00069 class ConditionalDialog : public KDialogBase
00070 {
00071   Q_OBJECT
00072  public:
00073   ConditionalDialog( View * parent, const char * name,
00074                          const QRect & marker );
00075 
00076   void init();
00077 
00078  public slots:
00079   void slotOk();
00080 
00081  protected:
00082   View *              m_view;
00083   ConditionalWidget * m_dlg;
00084   QRect               m_marker;
00085   Conditional::Type   m_result;
00086 
00087  private:
00088    void init( Conditional const & tmp, int numCondition );
00089    Conditional::Type typeOfCondition( QComboBox const * const cb ) const;
00090 
00091   bool checkInputData( KLineEdit const * const edit1,
00092                        KLineEdit const * const edit2 );
00093   bool checkInputData();
00094   bool getCondition( Conditional & newCondition, const QComboBox * cb,
00095                      const KLineEdit * edit1, const KLineEdit * edit2,
00096                      const QComboBox * sb, Style * style );
00097 
00098 };
00099 
00100 } // namespace KSpread
00101 
00102 #endif
00103 
KDE Home | KDE Accessibility Home | Description of Access Keys