1
/****************************************************************************
2
* Copyright (C) 2012-2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#ifndef CONTACTDELEGATE_H
19
#define CONTACTDELEGATE_H
21
#include <QtGui/QStyledItemDelegate>
22
#include <QtGui/QProxyStyle>
23
#include <QtCore/QDebug>
25
class DelegateDropOverlay;
26
class PhoneNumberDelegate;
27
class CategorizedTreeView ;
29
class ContactDelegate : public QStyledItemDelegate
32
explicit ContactDelegate(CategorizedTreeView* parent);
34
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
36
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
38
void setChildDelegate(PhoneNumberDelegate* child);
41
DelegateDropOverlay* m_pDelegatedropoverlay;
42
PhoneNumberDelegate* m_pChildDelegate ;
43
CategorizedTreeView* m_pView ;