advancedsearchdialog.h 1.93 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 QPushButton;
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
public slots:
51
    // FIXME signal
52 53
    //Result exec();
    int exec();
54 55 56

protected slots:
    virtual void accept();
57
    virtual void clear();
58 59
    virtual void more();
    virtual void fewer();
60

61
private:
62 63
    void updateButtons();

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

#endif
76 77

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