Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

gui/SearchDialog.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2008 Guillaume Chereau
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 // pre declaration of the ui class
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     // Add auto focus of the edit line
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 

Generated on Mon Feb 2 17:23:47 2009 for Stellarium by  doxygen 1.5.5