summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/focusdialog.h
blob: c2d03de046110605eb63661795cf5257b3860179 (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
/***************************************************************************
                          focusdialog.h  -  description
                             -------------------
    begin                : Sat Mar 23 2002
    copyright            : (C) 2002 by Jason Harris
    email                : kstars@30doradus.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef FOCUSDIALOG_H
#define FOCUSDIALOG_H

#include <kdialogbase.h>
#include "focusdialogdlg.h"

class TQVBoxLayout;
class TQHBoxLayout;
class KLineEdit;
class SkyPoint;
class FocusDialogDlg;

/**@class FocusDialog 
	*@short A small dialog for setting the focus coordinates manually.
	*@author Jason Harris
	*@version 1.0
	*/

class FocusDialog : public KDialogBase {
	Q_OBJECT
  
public:
	/**Constructor. */
	FocusDialog( TQWidget *parent=0 );

	/**Destructor (empty). */
	~FocusDialog();

	/**@return pointer to the SkyPoint described by the entered RA, Dec */
	SkyPoint* point() const { return Point; }

	/**@return suggested size of focus window. */
	TQSize sizeHint() const;

	/**@return whether user set the AltAz coords */
	bool usedAltAz() const { return UsedAltAz; }

	void activateAzAltPage();
	long double epochToJd (double epoch);

	double getEpoch (TQString eName);

public slots:
	/**If text has been entered in both KLineEdits, enable the Ok button. */
	void checkLineEdits();

	/**Attempt to interpret the text in the KLineEdits as Ra and Dec values.
		*If the point is validated, close the window.
		*/
	void validatePoint();
	void slotOk();

private:
	TQVBoxLayout *vlay;
	TQHBoxLayout *hlayRA, *hlayDec;
	KLineEdit *editRA, *editDec;
	SkyPoint *Point;
	FocusDialogDlg *fdlg;
	bool UsedAltAz;
};

#endif