Warning, file /network/ktp-contact-list/contact-delegate.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * Contact Delegate
0003  *
0004  * Copyright (C) 2010-2011 Collabora Ltd. <info@collabora.co.uk>
0005  *   @Author Dario Freddi <dario.freddi@collabora.co.uk>
0006  * Copyright (C) 2011 Martin Klapetek <martin.klapetek@gmail.com>
0007  *
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public
0010  * License as published by the Free Software Foundation; either
0011  * version 2.1 of the License, or (at your option) any later version.
0012  *
0013  * This library is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * Lesser General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with this library; if not, write to the Free Software
0020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0021  */
0022 
0023 #ifndef CONTACTDELEGATE_H
0024 #define CONTACTDELEGATE_H
0025 
0026 #include "abstract-contact-delegate.h"
0027 #include "contact-delegate-overlay.h"
0028 
0029 class ContactDelegate : public AbstractContactDelegate, public ContactDelegateOverlayContainer
0030 {
0031     Q_OBJECT
0032     Q_PROPERTY(int m_fadingValue READ fadingValue WRITE setFadingValue);
0033 
0034 public:
0035     ContactDelegate(QObject *parent = 0);
0036     ~ContactDelegate();
0037 
0038     virtual void paintContact(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
0039     virtual QSize sizeHintContact(const QStyleOptionViewItem & option, const QModelIndex & index) const;
0040 
0041     int fadingValue() const;
0042     void setFadingValue(int value);
0043 
0044 public Q_SLOTS:
0045     void hideStatusMessageSlot(const QModelIndex& index);
0046     void reshowStatusMessageSlot();
0047     void fadeOutStatusMessageSlot();
0048     void triggerRepaint();
0049 
0050 protected:
0051     /// Returns the delegate, typically, the derived class
0052     virtual QAbstractItemDelegate *asDelegate() { return this; }
0053 
0054 private:
0055     QModelIndex m_indexForHiding;
0056     int         m_fadingValue;
0057     int         m_avatarSize;
0058     int         m_presenceIconSize;
0059     int         m_spacing;
0060 };
0061 
0062 #endif // CONTACTDELEGATE_H