kspread

kspread_dlg_conditional.h
1/* This file is part of the KDE project
2 Copyright (C) 2002-2003 Norbert Andres <nandres@web.de>
3 (C) 2002-2003 Philipp Mueller <philipp.mueller@gmx.de>
4 (C) 2002 John Dailey <dailey@vt.edu>
5 (C) 1999-2004 Laurent Montel <montel@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21*/
22
23#ifndef __kspread_dlg_conditional__
24#define __kspread_dlg_conditional__
25
26#include <kdialogbase.h>
27#include <tqwidget.h>
28
29#include "kspread_condition.h"
30
31class TQComboBox;
32class KLineEdit;
33
34namespace KSpread
35{
36class Style;
37class View;
38
39class ConditionalWidget : public TQWidget
40{
41 TQ_OBJECT
42
43
44 public:
45 ConditionalWidget( TQWidget * parent = 0, const char * name = 0, WFlags fl = 0 );
46 ~ConditionalWidget();
47
48 TQComboBox * m_condition_1;
49 TQComboBox * m_style_1;
50 KLineEdit * m_firstValue_1;
51 KLineEdit * m_secondValue_1;
52
53 TQComboBox * m_condition_2;
54 TQComboBox * m_style_2;
55 KLineEdit * m_firstValue_2;
56 KLineEdit * m_secondValue_2;
57
58 TQComboBox * m_condition_3;
59 TQComboBox * m_style_3;
60 KLineEdit * m_firstValue_3;
61 KLineEdit * m_secondValue_3;
62
63 public slots:
64 void slotTextChanged1( const TQString & );
65 void slotTextChanged2( const TQString & );
66 void slotTextChanged3( const TQString & );
67};
68
69
70class ConditionalDialog : public KDialogBase
71{
72 TQ_OBJECT
73
74 public:
75 ConditionalDialog( View * parent, const char * name,
76 const TQRect & marker );
77
78 void init();
79
80 public slots:
81 void slotOk();
82
83 protected:
84 View * m_view;
85 ConditionalWidget * m_dlg;
86 TQRect m_marker;
87 Conditional::Type m_result;
88
89 private:
90 void init( Conditional const & tmp, int numCondition );
91 Conditional::Type typeOfCondition( TQComboBox const * const cb ) const;
92
93 bool checkInputData( KLineEdit const * const edit1,
94 KLineEdit const * const edit2 );
95 bool checkInputData();
96 bool getCondition( Conditional & newCondition, const TQComboBox * cb,
97 const KLineEdit * edit1, const KLineEdit * edit2,
98 const TQComboBox * sb, Style * style );
99
100};
101
102} // namespace KSpread
103
104#endif
105
The KSpread namespace.
Definition commands.h:39