advancedsearchdialog.h 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/**
 * Copyright (C) 2003-2004 Scott Wheeler <wheeler@kde.org>
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */
16 17 18 19

#ifndef ADVANCEDSEARCHDIALOG_H
#define ADVANCEDSEARCHDIALOG_H

20
#include <QDialog>
21
#include <QList>
22 23

#include "playlistsearch.h"
24

25
class QLineEdit;
26
class QPushButton;
27
class QRadioButton;
28
class SearchLine;
29
class QBoxLayout;
Tim Beaulen's avatar
Tim Beaulen committed
30

31
class AdvancedSearchDialog : public QDialog
32
{
33 34
    Q_OBJECT

35
public:
Yuri Chornoivan's avatar
Yuri Chornoivan committed
36
    explicit AdvancedSearchDialog(
37 38 39
            const QString& defaultName,
            const PlaylistSearch& defaultSearch = PlaylistSearch(),
            QWidget* parent = nullptr);
40

41 42 43 44
    PlaylistSearch resultSearch() const
    {
        return m_search;
    }
45

46 47 48 49
    QString resultPlaylistName() const
    {
        return m_playlistName;
    }
50 51

protected slots:
52 53 54 55
    void accept() Q_DECL_OVERRIDE;
    void clearSearches();
    void more();
    void fewer();
56

57
private:
58 59
    void updateButtons();

60
    QBoxLayout *m_criteriaLayout;
61
    PlaylistSearch m_search;
62
    QString m_playlistName;
63
    QList<SearchLine *> m_searchLines;
64
    QLineEdit *m_playlistNameLineEdit;
65 66
    QRadioButton *m_matchAnyButton;
    QRadioButton *m_matchAllButton;
67 68
    QPushButton *m_moreButton;
    QPushButton *m_fewerButton;
69 70 71
};

#endif
72 73

// vim: set et sw=4 tw=0 sta: