summaryrefslogtreecommitdiffstats
path: root/kalzium/src/somwidget_impl.h
blob: 62f7070f864dea2cf7274c7c33d6470bd4ae181a (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
#ifndef SOMWIDGET_IMPL_H
#define SOMWIDGET_IMPL_H
/***************************************************************************
    copyright            : (C) 2005 by Carsten Niehaus
    email                : [email protected]
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#include "somwidget.h"

class Element;

/**
 * @class SOMWidgetIMPL
 * @author Carsten Niehaus
 * @author Pino Toscano
 *
 * The SOMWidgetIMPL provides a TQSlider. When this slider is moved,
 * this widget will display which elements have a boiling or melting
 * point near the temperature the user entered using the slider.
 */
class SOMWidgetIMPL : public SOMWidget
{
	TQ_OBJECT
  

	public:
		/**
		 * @param parent The parent of this widget
		 * @param name The name of this widget
		 */
		SOMWidgetIMPL( TQWidget *parent = 0, const char* name = 0 );

	public slots:
		/**
		 * Reload the current unit from the preferences
		 */
		void reloadUnits();

	private:
		TQValueList<Element*> m_list;
		TQString m_htmlBegin;
		TQString m_htmlEnd;
		int m_prevUnit;

	private slots:
		void sliderValueChanged( int temp );
		void spinValueChanged( double temp );

		/**
		 * in this slot the elements will be compared with
		 * the temperature @p newtemp. The content of the HTML
		 * will be generated
		 */
		void setNewTemp( double newtemp );
};
#endif // SOMWIDGET_IMPL_H