advancedsearchdialog.h 1.89 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

Tim Beaulen's avatar
Tim Beaulen committed
20
#include <kdialog.h>
21
#include <QList>
22 23

#include "playlistsearch.h"
24

25
class KLineEdit;
26
class KPushButton;
27
class QRadioButton;
28
class SearchLine;
29
class QBoxLayout;
Tim Beaulen's avatar
Tim Beaulen committed
30 31

class AdvancedSearchDialog : public KDialog
32
{
33 34
    Q_OBJECT

35
public:
36 37 38 39
    struct Result
    {
        DialogCode result;
        PlaylistSearch search;
40
        QString playlistName;
41 42
    };

43
    explicit AdvancedSearchDialog(const QString &defaultName,
44
                         const PlaylistSearch &defaultSearch = PlaylistSearch(),
45 46 47
                         QWidget *parent = 0,
                         const char *name = 0);

48 49
    virtual ~AdvancedSearchDialog();

50 51 52 53 54
public slots:
    Result exec();

protected slots:
    virtual void accept();
55
    virtual void clear();
56 57
    virtual void more();
    virtual void fewer();
58

59
private:
60 61
    void updateButtons();

62
    QBoxLayout *m_criteriaLayout;
63
    PlaylistSearch m_search;
64
    QString m_playlistName;
65
    QList<SearchLine *> m_searchLines;
66
    KLineEdit *m_playlistNameLineEdit;
67 68
    QRadioButton *m_matchAnyButton;
    QRadioButton *m_matchAllButton;
69 70
    KPushButton *m_moreButton;
    KPushButton *m_fewerButton;
71 72 73
};

#endif
74 75

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