krita

kis_layerlist.h

00001 /*
00002   Copyright (c) 2005 Gábor Lehel <illissius@gmail.com>
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License as published by the Free Software Foundation; either
00007   version 2 of the License, or (at your option) any later version.
00008 
00009   This library is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012   Library General Public License for more details.
00013 
00014   You should have received a copy of the GNU Library General Public License
00015   along with this library; see the file COPYING.LIB.  If not, write to
00016   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017   Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KIS_LAYERLIST_H
00021 #define KIS_LAYERLIST_H
00022 
00023 #include <qimage.h>
00024 #include "layerlist.h"
00025 
00026 class KoPartSelectAction;
00027 class KoDocumentEntry;
00028 class KisLayer;
00029 
00030 class KisLayerList: public LayerList
00031 {
00032     Q_OBJECT
00033     typedef LayerList super;
00034 
00035 signals:
00036     void requestNewObjectLayer( LayerItem *parent, LayerItem *after, const KoDocumentEntry &entry );
00037     void requestNewObjectLayer( int parentID, int afterID, const KoDocumentEntry &entry );
00038     void requestNewAdjustmentLayer( LayerItem *parent, LayerItem *after );
00039     void requestNewAdjustmentLayer( int parentID, int afterID );
00040 
00041 public:
00042     KisLayerList( QWidget *parent = 0, const char *name = 0 );
00043 
00044     virtual void constructMenu( LayerItem *layer );
00045     virtual void menuActivated( int id, LayerItem *layer );
00046 
00047     KoPartSelectAction *partLayerAction() const { return m_partLayerAction; }
00048 
00049 private:
00050     KoPartSelectAction *m_partLayerAction;
00051 };
00052 
00053 class KisLayerItem: public LayerItem
00054 {
00055     typedef LayerItem super;
00056 
00057 public:
00058     KisLayerItem( LayerList* parent, KisLayer* layer );
00059     KisLayerItem( LayerItem* parent, KisLayer* layer );
00060 
00061     KisLayer* layer() const;
00062 
00063     void sync();
00064 
00066     bool updatePreview();
00067 
00068     virtual QString tooltip() const;
00069     virtual QImage tooltipPreview() const;
00070 
00071     //virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
00072 
00073 private:
00074     void init();
00075     QImage m_preview;
00076     KisLayer *m_layer;
00077 };
00078 
00079 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys