summaryrefslogtreecommitdiffstats
path: root/src/timingwidget.h
blob: b43e5c263c56c6112f96c1075b552612e4f64a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/***************************************************************************
 *                                                                         *
 *   Copyright (C) 2005, 2006 by Kevin Gilbert                             *
 *   kev.gilbert@cdu.edu.au                                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 *                                                                         *
 ***************************************************************************/
#ifndef _TIMINGWIDGET_H_
#define _TIMINGWIDGET_H_

#ifdef HAVE_CONFIG_H
#	include <config.h>
#endif

#include <ntqwidget.h>
#include "global.h"

//	forward class definitions
//	=========================

class TDEConfig;
class TQCheckBox;
class TQLineEdit;
class TQPushButton;
class TQRadioButton;

//	TimingWidget class definition
//	=============================

class TimingWidget : public TQWidget
{	TQ_OBJECT

	public:
		TimingWidget( TQWidget* parent, const char* name = NULL );

		void    finaliseInitialisation( );
		bool    getOptions( );
		void    readProfile( TDEConfig* config );
		void    saveProfile( TDEConfig* config );
		void    setInitialValues( );
		TQString simpleTiming( ) const;

		bool    hostTimeoutState( )       const { return m_hostTimeoutState;       }
		uint    hostTimeoutValue( )       const { return m_hostTimeoutValue;       }
		bool    initialRTTTimeoutState( ) const { return m_initialRTTTimeoutState; }
		uint    initialRTTTimeoutValue( ) const { return m_initialRTTTimeoutValue; }
		bool    maxHostGroupState( )      const { return m_maxHostGroupState;      }
		uint    maxHostGroupValue( )      const { return m_maxHostGroupValue;      }
		bool    maxParallelismState( )    const { return m_maxParallelismState;    }
		uint    maxParallelismValue( )    const { return m_maxParallelismValue;    }
		bool    maxRTTTimeoutState( )     const { return m_maxRTTTimeoutState;     }
		uint    maxRTTTimeoutValue( )     const { return m_maxRTTTimeoutValue;     }
		bool    maxScanDelayState( )      const { return m_maxScanDelayState;      }
		uint    maxScanDelayValue( )      const { return m_maxScanDelayValue;      }
		bool    minHostGroupState( )      const { return m_minHostGroupState;      }
		uint    minHostGroupValue( )      const { return m_minHostGroupValue;      }
		bool    minParallelismState( )    const { return m_minParallelismState;    }
		uint    minParallelismValue( )    const { return m_minParallelismValue;    }
		bool    minRTTTimeoutState( )     const { return m_minRTTTimeoutState;     }
		uint    minRTTTimeoutValue( )     const { return m_minRTTTimeoutValue;     }
		bool    scanDelayState( )         const { return m_scanDelayState;         }
		uint    scanDelayValue( )         const { return m_scanDelayValue;         }

	signals:
		void displayDocBook( const TQString& );
		void displayHelp( const TQString& );
		void displayUnknown( );
		void optionsDirty( );

	private slots:
		void slotAggressiveRadioClicked( );
		void slotDefaultRadioClicked( );
		void slotHostTimeoutButtonClicked( );
		void slotHostTimeoutCheckBoxClicked( );
		void slotInitialRTTTimeoutButtonClicked( );
		void slotInitialRTTTimeoutCheckBoxClicked( );
		void slotInsaneRadioClicked( );
		void slotMaxHostGroupButtonClicked( );
		void slotMaxHostGroupCheckBoxClicked( );
		void slotMaxParallelismButtonClicked( );
		void slotMaxParallelismCheckBoxClicked( );
		void slotMaxRTTTimeoutButtonClicked( );
		void slotMaxRTTTimeoutCheckBoxClicked( );
		void slotMaxScanDelayButtonClicked( );
		void slotMaxScanDelayCheckBoxClicked( );
		void slotMinHostGroupButtonClicked( );
		void slotMinHostGroupCheckBoxClicked( );
		void slotMinParallelismButtonClicked( );
		void slotMinParallelismCheckBoxClicked( );
		void slotMinRTTTimeoutButtonClicked( );
		void slotMinRTTTimeoutCheckBoxClicked( );
		void slotNormalRadioClicked( );
		void slotParanoidRadioClicked( );
		void slotPoliteRadioClicked( );
		void slotScanDelayButtonClicked( );
		void slotScanDelayCheckBoxClicked( );
		void slotSneakyRadioClicked( );
		void slotWhatsThisClicked( );

	private:
		void createLayout( );

		//	simple timing indices
		//	=====================
		
		enum Timing
		{	Default_Timing,
			Aggressive_T4_Timing,
			Insane_T5_Timing,
			Normal_T3_Timing,
			Paranoid_T0_Timing,
			Polite_T2_Timing,
			Sneaky_T1_Timing
		};

		TQRadioButton* m_aggressiveRadio;
		TQRadioButton* m_defaultRadio;
		TQPushButton*  m_hostTimeoutButton;
		TQCheckBox*    m_hostTimeoutCheckBox;
		TQLineEdit*    m_hostTimeoutLineEdit;
		bool          m_hostTimeoutState;
		uint          m_hostTimeoutValue;
		TQPushButton*  m_initialRTTTimeoutButton;
		TQCheckBox*    m_initialRTTTimeoutCheckBox;
		TQLineEdit*    m_initialRTTTimeoutLineEdit;
		bool          m_initialRTTTimeoutState;
		uint          m_initialRTTTimeoutValue;
		TQRadioButton* m_insaneRadio;
		TQPushButton*  m_maxHostGroupButton;
		TQCheckBox*    m_maxHostGroupCheckBox;
		TQLineEdit*    m_maxHostGroupLineEdit;
		bool          m_maxHostGroupState;
		uint          m_maxHostGroupValue;
		TQPushButton*  m_maxParallelismButton;
		TQCheckBox*    m_maxParallelismCheckBox;
		TQLineEdit*    m_maxParallelismLineEdit;
		bool          m_maxParallelismState;
		uint          m_maxParallelismValue;
		TQPushButton*  m_maxRTTTimeoutButton;
		TQCheckBox*    m_maxRTTTimeoutCheckBox;
		TQLineEdit*    m_maxRTTTimeoutLineEdit;
		bool          m_maxRTTTimeoutState;
		uint          m_maxRTTTimeoutValue;
		TQPushButton*  m_maxScanDelayButton;
		TQCheckBox*    m_maxScanDelayCheckBox;
		TQLineEdit*    m_maxScanDelayLineEdit;
		bool          m_maxScanDelayState;
		uint          m_maxScanDelayValue;
		TQPushButton*  m_minHostGroupButton;
		TQCheckBox*    m_minHostGroupCheckBox;
		TQLineEdit*    m_minHostGroupLineEdit;
		bool          m_minHostGroupState;
		uint          m_minHostGroupValue;
		TQPushButton*  m_minParallelismButton;
		TQCheckBox*    m_minParallelismCheckBox;
		TQLineEdit*    m_minParallelismLineEdit;
		bool          m_minParallelismState;
		uint          m_minParallelismValue;
		TQPushButton*  m_minRTTTimeoutButton;
		TQCheckBox*    m_minRTTTimeoutCheckBox;
		TQLineEdit*    m_minRTTTimeoutLineEdit;
		bool          m_minRTTTimeoutState;
		uint          m_minRTTTimeoutValue;
		TQRadioButton* m_normalRadio;
		TQRadioButton* m_paranoidRadio;
		TQRadioButton* m_politeRadio;
		TQPushButton*  m_scanDelayButton;
		TQCheckBox*    m_scanDelayCheckBox;
		TQLineEdit*    m_scanDelayLineEdit;
		bool          m_scanDelayState;
		uint          m_scanDelayValue;
		Timing        m_simpleTimingValue;
		TQRadioButton* m_sneakyRadio;
};

#endif	// _TIMINGWIDGET_H_