00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _SEARCHDIALOG_HPP_
00021 #define _SEARCHDIALOG_HPP_
00022
00023 #include <QObject>
00024 #include <QLabel>
00025 #include <QMap>
00026 #include "StelDialog.hpp"
00027 #include "VecMath.hpp"
00028
00029
00030 class Ui_searchDialogForm;
00031
00035 class CompletionLabel : public QLabel
00036 {
00037 Q_OBJECT
00038
00039 public:
00040 CompletionLabel(QWidget* parent=0);
00041 ~CompletionLabel();
00042
00043 QString getSelected(void);
00044 void setValues(const QStringList&);
00045 void appendValues(const QStringList&);
00046 void clearValues();
00047
00048 public slots:
00049 void selectNext();
00050 void selectPrevious();
00051 void selectFirst();
00052
00053 private:
00054 void updateText();
00055 int selectedIdx;
00056 QStringList values;
00057 };
00058
00061 class SearchDialog : public StelDialog
00062 {
00063 Q_OBJECT
00064
00065 public:
00066 SearchDialog();
00067 virtual ~SearchDialog();
00068 void languageChanged();
00070 void styleChanged();
00071 bool eventFilter(QObject *object, QEvent *event);
00072
00073 void setSimpleStyle(bool b);
00074
00075 public slots:
00076
00077 void setVisible(bool);
00078
00079 protected:
00080 Ui_searchDialogForm* ui;
00082 virtual void createDialogContent();
00083
00084 private slots:
00086 void onSimbadStatusChanged();
00087 void onTextChanged(const QString& text);
00088 void gotoObject();
00089
00090 void manualPositionChanged();
00091
00092 private:
00093 class SimbadSearcher* simbadSearcher;
00094 class SimbadLookupReply* simbadReply;
00095 QMap<QString, Vec3d> simbadResults;
00096 };
00097
00098 #endif // _SEARCHDIALOG_HPP_
00099