kmail Library API Documentation

colorlistbox.h

00001 /*
00002  *   kmail: KDE mail client
00003  *   This file: Copyright (C) 2000 Espen Sand, espen@kde.org
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  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  *
00019  */
00020 
00021 #ifndef _COLOR_LISTBOX_H_
00022 #define _COLOR_LISTBOX_H_
00023 
00024 #include <klistbox.h>
00025 
00026 class ColorListBox : public KListBox
00027 {
00028   Q_OBJECT
00029 
00030   public:
00031     ColorListBox( QWidget *parent=0, const char * name=0, WFlags f=0 );
00032     void setColor( uint index, const QColor &color );
00033     QColor color( uint index ) const;
00034 
00035   public slots:
00036     virtual void setEnabled( bool state );
00037 
00038   protected:
00039     void dragEnterEvent( QDragEnterEvent *e );
00040     void dragLeaveEvent( QDragLeaveEvent *e );
00041     void dragMoveEvent( QDragMoveEvent *e );
00042     void dropEvent( QDropEvent *e );
00043 
00044   private slots:
00045     void newColor( int index );
00046 
00047   private:
00048     int mCurrentOnDragEnter;
00049 
00050 };
00051 
00052 
00053 class ColorListItem : public QListBoxItem
00054 {
00055   public:
00056     ColorListItem( const QString &text, const QColor &color=Qt::black );
00057     const QColor &color( void );
00058     void  setColor( const QColor &color );
00059 
00060   protected:
00061     virtual void paint( QPainter * );
00062     virtual int height( const QListBox * ) const;
00063     virtual int width( const QListBox * ) const;
00064 
00065   private:
00066     QColor mColor;
00067     int mBoxWidth;
00068 };
00069 
00070 #endif
00071 
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:13 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003