Scale identity combobox and send/cancel buttons according to screen DPI.
[kdepim.git] / akonadi_next / amazingcompleter.h
blob21c5d8dc5a6f44355fe6b66a8dfeb1ccfad80894
1 /*
2 Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
20 #ifndef AMAZING_COMPLETER_H
21 #define AMAZING_COMPLETER_H
23 #include <QObject>
24 #include <QWidget>
25 #include <QAbstractItemModel>
27 #include "akonadi_next_export.h"
29 class QAbstractItemView;
32 namespace Akonadi
35 class AmazingCompleterPrivate;
37 class AKONADI_NEXT_EXPORT AmazingCompleter : public QObject
39 Q_OBJECT
40 public:
42 enum ViewHandler { Popup, NoPopup };
44 AmazingCompleter(/* QAbstractItemModel *model, */ QObject *parent = 0);
45 ~AmazingCompleter();
47 void setWidget(QWidget *widget);
49 void setView(QAbstractItemView *view, ViewHandler = Popup);
51 void setModel(QAbstractItemModel *model);
53 /**
54 The data from this is put into the lineedit
56 void setCompletionRole(int role);
58 /**
59 This role is passed to match().
61 void setMatchingRole(int role);
63 void setMinimumLength(int length);
65 public slots:
66 void setCompletionPrefixString(const QString &matchData);
67 void setCompletionPrefix(const QVariant &matchData);
69 void sourceRowsInserted(const QModelIndex &parent, int start, int end);
71 protected:
72 virtual void connectModelToView(QAbstractItemModel *model, QAbstractItemView *view);
74 private:
75 Q_DECLARE_PRIVATE(AmazingCompleter)
77 AmazingCompleterPrivate *d_ptr;
83 #endif