Songbook-Client  0.7
This application is a manager of customguitar songbooks
 All Classes Files Functions Variables Enumerations Enumerator Pages
filter-lineedit.hh
Go to the documentation of this file.
1 // Copyright (C) 2009-2011, Romain Goffe <romain.goffe@gmail.com>
2 // Copyright (C) 2009-2011, Alexandre Dupas <alexandre.dupas@gmail.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 // 02110-1301, USA.
18 //******************************************************************************
19 
26 #ifndef __FILTER_LINEEDIT_HH__
27 #define __FILTER_LINEEDIT_HH__
28 
29 #include <QToolButton>
30 #include "utils/lineedit.hh"
31 
38 class CClearButton : public QToolButton
39 {
40  Q_OBJECT
41 
42 public:
44  CClearButton(QWidget *parent = 0);
45 
46 protected slots:
47  void textChanged(const QString &text);
48 
49 protected:
50  void paintEvent(QPaintEvent *event);
51 
52 private:
53  QImage m_icon;
54 };
55 
62 class CMagButton : public QToolButton
63 {
64  Q_OBJECT
65 
66 public:
68  CMagButton(QWidget *parent = 0);
69 
70 protected:
71  void paintEvent(QPaintEvent *event);
72 
73 private:
74  QImage m_icon;
75 };
76 
77 class QAction;
79 
98 class CFilterLineEdit : public LineEdit
99 {
100  Q_OBJECT
101 
102 public slots:
104  void filterLanguageEnglish();
106  void filterLanguageFrench();
108  void filterLanguageSpanish();
111 
112 public:
114  CFilterLineEdit(QWidget *parent = 0);
117 
120  void addAction(QAction *action);
121 
124  void setFilterModel(CSongSortFilterProxyModel *filterModel);
125 
126 private:
127  QMenu* m_menu;
128 
129  CSongSortFilterProxyModel *m_filterModel;
130 };
131 
132 #endif // __FILTER_LINEEDIT_HH__