Mercurial > hg > easaier-soundaccess
diff widgets/SearchWidget.h @ 7:a5175615d153
add easaier tab widgets, style and pass the layer characteristics in the main window (remove from panestack)
author | lbajardsilogic |
---|---|
date | Fri, 11 May 2007 14:11:19 +0000 |
parents | |
children | 46af1af183ac |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/SearchWidget.h Fri May 11 14:11:19 2007 +0000 @@ -0,0 +1,72 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + 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. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _SEARCH_WIDGET_H_ +#define _SEARCH_WIDGET_H_ + +#include <QWidget> +#include <QGridLayout> +#include <QVBoxLayout> +#include <QStackedLayout> + +#include <map> + +#include "data/model/QueryModel.h" + +#include "widgets/AdvancedToolBox.h" + +class SearchWidget : public QWidget { + + Q_OBJECT +public: + SearchWidget(); + virtual ~SearchWidget(); + + /*display the widgets of the search tab according the QueryModel*/ + void displayQuerymodel(QueryModel* queryModel); + + /*add a new theme (music, speech...) to the search tab*/ + void addTheme(const QString &name, const QString &label); + + /*add a new group of query to the current search theme*/ + void addFieldGroup(const QString &name, const QString &label); + void endFieldGroup(); + + /*add a query property to the current group and current theme*/ + void addField(const QString &name, QueryThemeModel* curTheme); + + /* return the name of the active query theme */ + QString getActiveTheme(); + + void reset(); + +public slots: + void activeTheme(); + +protected: + + QStackedLayout *m_themesLayout; + QHBoxLayout *m_buttonLayout; // each button correspond to a theme + + QPushButton *m_searchButton; + + AdvancedToolBox *m_curThemeWidget; + QGridLayout *m_curBoxLayout; + + std::map<QString, int> m_themes; + + int m_curBoxRow; +}; + + +#endif \ No newline at end of file