/usr/include/kchatbaseitemdelegate.h is in libkdegames-dev 4:4.8.2-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | /*
This file is part of the KDE games library
Copyright (C) 2007 Gael de Chalendar (aka Kleag) <kleag@free.fr>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
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 __KCHATBASEITEMDELEGATE_H__
#define __KCHATBASEITEMDELEGATE_H__
#include <QtGui/QAbstractItemDelegate>
#include <libkdegames_export.h>
/**
* \class KChatBaseItemDelegate kchatbaseitemdelegate.h <KChatBaseItemDelegate>
*
* A delegate (see the Qt Model/View module for details) to paint the lines of
* the KChatBase list model (@ref KChatBaseModel).
*
* A KChatBaseItemDelegate paints two text items: first the player part then the
* text part. This honors KChatBase::addMessage which also uses both.
*
* Colors and fonts for both parts are set in the corresponding model.
**/
class KDEGAMES_EXPORT KChatBaseItemDelegate : public QAbstractItemDelegate
{
Q_OBJECT
public:
/**
* Constructs a KChatBaseItemDelegate object
**/
explicit KChatBaseItemDelegate(QObject *parent = 0);
/**
* Destruct a KChatBaseItemDelegate object.
**/
virtual ~KChatBaseItemDelegate();
/**
* Reimplementation of the default paint method. Draws the item at the
* given index in the model with good fonts for player name and message.
*
* Should be reimplemented in inherited delegates
*/
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index,
const QString& sender,
const QString& message) const;
/**
* Reimplementation of the default sizeHint. Computes the given item size
* depending on the name and message sizes and on the fonts they use.
*
* Should be reimplemented in inherited delegates
*/
virtual QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index ) const;
virtual QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index, const QString& sender,
const QString& message) const;
};
#endif
|