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

class QVBoxLayout;
class QHBoxLayout;
class KLineEdit;
class SkyPoint;

/**@Short Dialog to provide a way to set the focus coordinates manually.
  *@author Jason Harris
	*@version 0.9
  */

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

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

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

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, clode the window.
		*/
	void validatePoint();

	/**Overridden from KDialogBase so that LineEdits will be validated before
		*window is closed. */
	void slotOk();

private:
	QVBoxLayout *vlay;
	QHBoxLayout *hlayRA, *hlayDec;
	KLineEdit *editRA, *editDec;
	SkyPoint *Point;
};

#endif
