File indexing completed on 2023-09-24 08:55:25

0001 /*
0002  * Contact Delegate - compact version
0003  *
0004  * Copyright (C) 2011 Martin Klapetek <martin.klapetek@gmail.com>
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public
0017  * License along with this library; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0019  */
0020 
0021 #ifndef CONTACTDELEGATECOMPACT_H
0022 #define CONTACTDELEGATECOMPACT_H
0023 
0024 #include "abstract-contact-delegate.h"
0025 
0026 class ContactDelegateCompact : public AbstractContactDelegate
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     enum ListSize {
0032         Normal,
0033         Mini
0034     };
0035     ContactDelegateCompact(ContactDelegateCompact::ListSize size = Normal, QObject *parent = 0);
0036     ~ContactDelegateCompact();
0037 
0038     void paintContact(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
0039     QSize sizeHintContact(const QStyleOptionViewItem & option, const QModelIndex & index) const;
0040     QSize sizeHintHeader(const QStyleOptionViewItem &option, const QModelIndex &index) const;
0041 
0042     void setListMode(ContactDelegateCompact::ListSize size);
0043 
0044 private:
0045     int m_spacing;
0046     int m_avatarSize;
0047     int m_presenceIconSize;
0048     int m_accountIconSize;
0049     int m_clientTypeIconSize;
0050     ContactDelegateCompact::ListSize m_listSize;
0051 };
0052 
0053 #endif // CONTACTDELEGATECOMPACT_H