moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / addcatdialog.h
blobe23d25883079ab220c573972763d891cb6827cc5
1 /***************************************************************************
2 addcatdialog.h - description
3 -------------------
4 begin : Sun Mar 3 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 ADDCATDIALOG_H
19 #define ADDCATDIALOG_H
21 #include <qglobal.h>
22 #include <qptrlist.h>
24 #include <kdialogbase.h>
25 #include <klineedit.h>
26 #include <kurlrequester.h>
27 #include "deepskyobject.h"
28 #include "addcatdialogui.h"
30 class QHBoxLayout;
31 class QVBoxLayout;
33 /**@class AddCatDialog
34 *@short Dialog for adding custom object catalogs to KStars
35 *@author Jason Harris
36 *@version 1.0
39 class AddCatDialog : public KDialogBase {
40 Q_OBJECT
41 public:
42 /**Default constructor
44 AddCatDialog( QWidget *parent=0 );
46 /**Destructor (empty)
48 ~AddCatDialog();
50 /**@return the name for the custom catalog.
52 QString name() const { return acd->catName->text(); }
54 /**@return the filename of the custom catalog.
56 QString filename() const { return acd->catFileName->lineEdit()->text(); }
58 /**@return QPtrList of SkyObjects as parsed from the custom catalog file.
60 QPtrList<DeepSkyObject> objectList() { return objList; }
62 private slots:
63 /**If both the "catalog name" and "catalog filename" fields are filled,
64 *enable the "Ok" button.
66 void slotCheckLineEdits();
68 /**Attempt to parse SkyObjects from the custom catalog file.
69 *If at least on e object is read successfully, close the dialog.
71 void slotValidateFile();
73 /**Overridden from KDialogBase to show short help in a dialog rather
74 *than launch KHelpCenter.
76 void slotHelp();
78 /**Overridden from KDialogBase, so that the entered file can be parsed
79 *before window is closed.
81 void slotOk();
83 private:
84 QVBoxLayout *vlay;
85 AddCatDialogUI *acd;
86 QPtrList<DeepSkyObject> objList;
89 #endif