You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.3 KiB
56 lines
2.3 KiB
/* |
|
Copyright (C) 2010 Casey Link <unnamedrambler@gmail.com> |
|
Copyright (c) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net> |
|
Copyright (c) 2006-2008 Tobias Koenig <tokoe@kde.org> |
|
|
|
This library is free software; you can redistribute it and/or modify it |
|
under the terms of the GNU Library General Public License as published by |
|
the Free Software Foundation; either version 2 of the License, or (at your |
|
option) any later version. |
|
|
|
This library 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 Library General Public |
|
License for more details. |
|
|
|
You should have received a copy of the GNU Library General Public License |
|
along with this library; see the file COPYING.LIB. If not, write to the |
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
02110-1301, USA. |
|
*/ |
|
|
|
#ifndef CONFIGAGENTDELEGATE_H |
|
#define CONFIGAGENTDELEGATE_H |
|
|
|
#include <QStyledItemDelegate> |
|
|
|
class QTextDocument; |
|
|
|
/** |
|
* @short A delegate for listing the accounts in the account list with kmail specific options. |
|
* Based off Akonadi::Internal::AgentInstanceWidgetDelegate |
|
* by Tobias Koenig. |
|
* |
|
*/ |
|
class ConfigAgentDelegate : public QStyledItemDelegate |
|
{ |
|
Q_OBJECT |
|
public: |
|
explicit ConfigAgentDelegate(QObject *parent = Q_NULLPTR); |
|
|
|
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; |
|
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; |
|
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) Q_DECL_OVERRIDE; |
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; |
|
|
|
Q_SIGNALS: |
|
void optionsClicked(const QString &, const QPoint &); |
|
|
|
private: |
|
void drawFocus(QPainter *, const QStyleOptionViewItem &, const QRect &) const; |
|
QTextDocument *document(const QStyleOptionViewItem &option, const QModelIndex &index) const; |
|
|
|
QStyleOptionButton buttonOption(const QStyleOptionViewItem &option) const; |
|
}; |
|
|
|
#endif // CONFIGAGENTDELEGATE_H
|
|
|