F:/KPlato/koffice/libs/kopainter/KoResourceChooser.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002   Copyright (c) 1999 Carsten Pfeiffer (pfeiffer@kde.org)
00003   Copyright (c) 2002 Igor Jansen (rm@kde.org)
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KO_ICONCHOOSER_H
00022 #define KO_ICONCHOOSER_H
00023 
00024 #include <q3gridview.h>
00025 #include <q3ptrlist.h>
00026 #include <QPixmap>
00027 #include <QMouseEvent>
00028 #include <QFrame>
00029 #include <QKeyEvent>
00030 #include <QResizeEvent>
00031 #include <QPaintEvent>
00032 #include <QTableWidget>
00033 #include <QTableWidgetItem>
00034 #include <koffice_export.h>
00035 
00036 #include "KoItemToolTip.h"
00037 
00038 class KoIconToolTip: public KoItemToolTip
00039 {
00040     Q_OBJECT
00041 
00042     public:
00043         KoIconToolTip() {};
00044         virtual ~KoIconToolTip() {};
00045 
00046     protected:
00047         virtual QTextDocument *createDocument( const QModelIndex &index );
00048 
00049     private:
00050         typedef KoItemToolTip super;
00051 };
00052 
00053 class KOPAINTER_EXPORT KoResourceChooser: public QTableWidget
00054 {
00055     Q_OBJECT
00056 public:
00057     // To make the items sorted, set 'sort' to true and override QTableWidgetItem::compare().
00058     KoResourceChooser(QSize iconSize, QWidget *parent = 0L);
00059     virtual ~KoResourceChooser();
00060 
00061     void addItem(QTableWidgetItem *item);
00062     QTableWidgetItem *itemAt(int index);
00063 
00065     enum ItemDataRole
00066     {
00068         LargeThumbnailRole = 33
00069     };
00070 
00071 protected:
00072     virtual void resizeEvent(QResizeEvent *e);
00073     virtual void keyPressEvent(QKeyEvent * e);
00074     virtual bool viewportEvent(QEvent * e);
00075 
00076 private:
00077     class Private;
00078     Private* const d;
00079 };
00080 
00081 // This is a first attempt at a pattern chooser widget abstraction which is at least
00082 // useful for two applications(karbon and krita). It is really a light version of
00083 // kis_patternchooser. (Rob)
00084 class KOPAINTER_EXPORT KoPatternChooser : public QWidget
00085 {
00086   Q_OBJECT
00087 public:
00088   KoPatternChooser( const Q3PtrList<QTableWidgetItem> &list, QWidget *parent, const char *name = 0 );
00089   ~KoPatternChooser();
00090 
00091   QTableWidgetItem *currentPattern();
00092   void setCurrentPattern( QTableWidgetItem * );
00093   void addPattern( QTableWidgetItem * );
00094  
00095 private:
00096   KoResourceChooser *chooser;
00097 
00098 signals:
00099   void selected( QTableWidgetItem * );
00100 };
00101 
00102 
00103 #endif // KO_ICONCHOOSER_H

Généré le Wed Nov 22 23:41:06 2006 pour KPlato par  doxygen 1.5.1-p1