moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / timespinbox.h
blob4b6730717f772ee584a6bc7d6176660711830b7e
1 /***************************************************************************
2 timespinbox.h - description
3 -------------------
4 begin : Sun Mar 31 2002
5 copyright : (C) 2002 by Jason Harris
6 email : kstars@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef TIMESPINBOX_H
19 #define TIMESPINBOX_H
21 #include <qspinbox.h>
22 #include <qstringlist.h>
24 /**@class TimeSpinBox
25 *Custom spinbox to handle selection of timestep values with variable units.
26 *@note this should only be used internally, embedded in a TimeStepBox widget.
27 *@author Jason Harris
28 *@version 1.0
31 class TimeSpinBox : public QSpinBox {
32 Q_OBJECT
33 public:
34 /**Constructor */
35 TimeSpinBox( QWidget *parent, const char* name=0 );
36 /**Destructor (empty)*/
37 ~TimeSpinBox() {};
39 /**Convert the internal value to a display string.
40 *@note reimplemented from QSpinBox
41 *@p value the internal value to convert to a display string
42 *@return the display string
44 virtual QString mapValueToText( int value );
46 /**Convert the displayed string to an internal value.
47 *@note reimplemented from QSpinBox
48 *@p ok bool pointer set to TRUE if conversion was successful
49 *@return internal value converted from displayed text
51 virtual int mapTextToValue( bool *ok);
53 /**@return the current TimeStep setting */
54 float timeScale() const;
56 signals:
57 void scaleChanged( float s );
59 public slots:
60 void changeScale( float s );
62 protected slots:
63 void reportChange();
65 private:
66 float TimeScale[42];
67 QStringList TimeString;
70 #endif