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 <QHash>
00027 #include "StelDialog.hpp"
00028 #include "VecMath.hpp"
00029
00030
00031 class Ui_searchDialogForm;
00032
00036 class CompletionLabel : public QLabel
00037 {
00038 Q_OBJECT
00039
00040 public:
00041 CompletionLabel(QWidget* parent=0);
00042 ~CompletionLabel();
00043
00044 QString getSelected(void);
00045 void setValues(const QStringList&);
00046 bool isEmpty() const {return values.isEmpty();}
00047 void appendValues(const QStringList&);
00048 void clearValues();
00049
00050 public slots:
00051 void selectNext();
00052 void selectPrevious();
00053 void selectFirst();
00054
00055 private:
00056 void updateText();
00057 int selectedIdx;
00058 QStringList values;
00059 };
00060
00063 class SearchDialog : public StelDialog
00064 {
00065 Q_OBJECT
00066
00067 public:
00068 SearchDialog();
00069 virtual ~SearchDialog();
00070 void languageChanged();
00072 void styleChanged();
00073 bool eventFilter(QObject *object, QEvent *event);
00074 void setSimpleStyle(bool b);
00075
00076 public slots:
00078 void setVisible(bool);
00079
00080 protected:
00081 Ui_searchDialogForm* ui;
00083 virtual void createDialogContent();
00084
00085 private slots:
00087 void onSimbadStatusChanged();
00089 void onTextChanged(const QString& text);
00090
00091 void gotoObject();
00092
00094 void manualPositionChanged();
00095
00096 private:
00097 class SimbadSearcher* simbadSearcher;
00098 class SimbadLookupReply* simbadReply;
00099 QMap<QString, Vec3d> simbadResults;
00100 class StelObjectMgr* objectMgr;
00101
00102 QString substituteGreek(const QString& keyString);
00103 QString getGreekLetterByName(const QString& potentialGreekLetterName);
00104 QHash<QString, QString> greekLetters;
00105 };
00106
00107 #endif // _SEARCHDIALOG_HPP_
00108