krita

kis_palette_view.h

00001 /*
00002  *  Copyright (c) 2005 Bart Coppens <kde@bartcoppens.be>
00003  *            (c) 2005 Boudewijn Rempt <boud@valdyas.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef __KIS_PALETTE_VIEW_H__
00021 #define __KIS_PALETTE_VIEW_H__
00022 
00023 #include <qscrollview.h>
00024 #include "kis_palette.h"
00025 
00026 class KListBox;
00027 class KisPalette;
00028 class KColorCells;
00029 class KisResource;
00030 class KisColor;
00031 
00035 class KisPaletteView : public QScrollView
00036 {
00037     Q_OBJECT
00038 public:
00039     KisPaletteView(QWidget *parent, const char* name = 0, int minWidth=210, int cols = 16);
00040     virtual ~KisPaletteView();
00041 
00042     KisPalette* palette() const;
00044     KisPaletteEntry currentEntry() const { return m_currentEntry; }
00045 
00046 public slots:
00047     void setPalette(KisPalette* p);
00048 
00049 signals:
00050     void colorSelected(const KisColor &);
00051     void colorSelected(const QColor &);
00052     void colorDoubleClicked(const KisColor &, const QString &);
00053 
00054 protected slots:
00055     void slotColorCellSelected( int );
00056     void slotColorCellDoubleClicked( int );
00057 
00058 protected:
00059     KisPalette* m_currentPalette;
00060     KColorCells* m_cells;
00061     KisPaletteEntry m_currentEntry;
00062     int mMinWidth;
00063     int mCols;
00064 
00065     friend class KisPaletteWidget; // Because it calls slotColorCellSelected from a FIXME
00066 };
00067 
00068 #endif
00069 
KDE Home | KDE Accessibility Home | Description of Access Keys