Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

linklistboxitem.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   linklistboxitem.cpp                                                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   Read the file COPYING for details.                                    *
00011  *                                                                         *
00012  *   copyright: (C) 2003 by Jan Mueller                                    *
00013  *   email: janmueller7@hotmail.com                                        *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 #include "linklistboxitem.h"
00018 #include <qlistview.h>
00019 #include "liturl.h"
00020 #include <qcolor.h>
00021 #include <qpalette.h>
00022 
00023 LinkListBoxItem::LinkListBoxItem(QListView *listbox, QString title, LitUrl url, QPixmap pm):
00024   QListViewItem(listbox, title), u(url) {
00025   setPixmap(0, pm);      
00026   init();
00027 }
00028 
00029 LinkListBoxItem::LinkListBoxItem(QListView *listbox, LitUrl url, QListViewItem *after,  QPixmap pm):
00030   QListViewItem(listbox, after), u(url) {
00031   setPixmap(0, pm);      
00032   init();
00033 }
00034 
00035 LinkListBoxItem::LinkListBoxItem(QListViewItem *parent, QString title, LitUrl url, QPixmap pm):
00036   QListViewItem(parent, title), u(url) {
00037   setPixmap(0, pm);      
00038   init();
00039 }
00040 
00041 LinkListBoxItem::LinkListBoxItem(QListViewItem *parent, LitUrl url, QListViewItem *after,  QPixmap pm):
00042   QListViewItem(parent, after), u(url) {
00043   setPixmap(0, pm);      
00044   init();
00045 }
00046 
00047 void LinkListBoxItem::init() {
00048   backgrcolor=Qt::white;
00049   textcolor=Qt::black;
00050   orderprefix="m";
00051 }
00052 
00053 void LinkListBoxItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) {
00054   QColorGroup mycg(cg);
00055   mycg.setColor(QColorGroup::Text, textcolor);
00056   mycg.setColor(QColorGroup::Base, backgrcolor);        
00057   QListViewItem::paintCell(p, mycg, column, width, alignment);
00058 }
00059 
00060 LitUrl LinkListBoxItem::url() { return u; };
00061   
00062 void LinkListBoxItem::setTextColor(const QColor& c) {
00063   textcolor=c;
00064 }
00065   
00066 void LinkListBoxItem::setBackgroundColor(const QColor& c) {
00067   backgrcolor=c;
00068 }
00069         
00070 void LinkListBoxItem::setOrderPrefix(QString p) {
00071   orderprefix=p;
00072 }
00073 
00074 const QString LinkListBoxItem::key(int column, bool ascending) {
00075   debug("key");
00076   return orderprefix+text(column);
00077 }
00078     
00079 LinkListBoxItem::~LinkListBoxItem() {
00080 }

Generated on Sat Mar 27 19:20:39 2004 for Literature by doxygen 1.3.6-20040222