chalk

kis_palette_view.h
1/*
2 * Copyright (c) 2005 Bart Coppens <kde@bartcoppens.be>
3 * (c) 2005 Boudewijn Rempt <boud@valdyas.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef __KIS_PALETTE_VIEW_H__
21#define __KIS_PALETTE_VIEW_H__
22
23#include <tqscrollview.h>
24#include "kis_palette.h"
25
26class TDEListBox;
27class KisPalette;
28class KColorCells;
29class KisResource;
30class KisColor;
31
35class KisPaletteView : public TQScrollView
36{
37 TQ_OBJECT
38
39public:
40 KisPaletteView(TQWidget *parent, const char* name = 0, int minWidth=210, int cols = 16);
41 virtual ~KisPaletteView();
42
43 KisPalette* palette() const;
45 KisPaletteEntry currentEntry() const { return m_currentEntry; }
46
47public slots:
48 void setPalette(KisPalette* p);
49
50signals:
51 void colorSelected(const KisColor &);
52 void colorSelected(const TQColor &);
53 void colorDoubleClicked(const KisColor &, const TQString &);
54
55protected slots:
56 void slotColorCellSelected( int );
57 void slotColorCellDoubleClicked( int );
58
59protected:
60 KisPalette* m_currentPalette;
61 KColorCells* m_cells;
62 KisPaletteEntry m_currentEntry;
63 int mMinWidth;
64 int mCols;
65
66 friend class KisPaletteWidget; // Because it calls slotColorCellSelected from a FIXME
67};
68
69#endif
70
A KisColor describes a color in a certain colorspace.
Definition kis_color.h:33
A scrolling view that lists a single KisPalette.
KisPaletteEntry currentEntry() const
Might return the default constructed entry...
A color palette in table form.
Open Gimp, Photoshop or RIFF palette files.
Definition kis_palette.h:50
The KisResource class provides a representation of Chalk image resources.