chalk

kis_controlframe.h
1/*
2 * kis_controlframe.h - part of Chalk
3 *
4 * Copyright (c) 1999 Matthias Elter <elter@kde.org>
5 * Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
6 * Copyright (c) 2004 Sven Langkamp <longamp@reallygood.de>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22#ifndef __kis_controlframe_h__
23#define __kis_controlframe_h__
24
25#include <tqpopupmenu.h>
26
27#include <tdetoolbar.h>
28
29#include <koFrameButton.h>
30
31class TQWidget;
32class TQTabWidget;
33
34class TDEToolBar;
35
36class KoIconItem;
37class KisIconWidget;
38class KisGradientWidget;
39
40class KisAutobrush;
41class KisAutogradient;
42class KisBrush;
43class KisBrushChooser;
44class KisGradient;
45class KisGradientChooser;
46class KisItemChooser;
47class KisPattern;
49class KisPaintopBox;
50class KisView;
51
52class KisPopupFrame : public TQPopupMenu {
53
54 TQ_OBJECT
55
56
57public:
58
59 KisPopupFrame(TQWidget * parent, const char * name = 0);
60 virtual void keyPressEvent(TQKeyEvent *);
61
62public:
63
64 void setChooser(KisItemChooser * chooser) { m_chooser = chooser; };
65 KisItemChooser * chooser() { return m_chooser; };
66
67private:
68 KisItemChooser * m_chooser;
69};
70
71
76class KisControlFrame : public TQObject //: public TDEToolBar
77{
78 TQ_OBJECT
79
80
81public:
82 KisControlFrame(TDEMainWindow * window, KisView * view, const char *name = 0 );
83 virtual ~KisControlFrame() {};
84
85public slots:
86
87 void slotSetBrush(KoIconItem *item);
88 void slotSetPattern(KoIconItem *item);
89 void slotSetGradient(KoIconItem *item);
90
91 void slotBrushChanged(KisBrush * brush);
92 void slotPatternChanged(KisPattern * pattern);
93 void slotGradientChanged(KisGradient * gradient);
94
95private:
96
97 void createBrushesChooser(KisView * view);
98 void createPatternsChooser(KisView * view);
99 void createGradientsChooser(KisView * view);
100
101
102private:
103 TQFont m_font;
104 KisView * m_view;
105
106 TQTabWidget * m_brushesTab;
107 TQTabWidget * m_gradientTab;
108
109 KisIconWidget *m_brushWidget;
110 KisIconWidget *m_patternWidget;
111 KisIconWidget *m_gradientWidget;
112
113 KisPopupFrame * m_brushChooserPopup;
114 KisPopupFrame * m_patternChooserPopup;
115 KisPopupFrame * m_gradientChooserPopup;
116
117 KisResourceMediator *m_brushMediator;
118 KisResourceMediator *m_patternMediator;
119 KisResourceMediator *m_gradientMediator;
120
121
122 KisAutobrush * m_autobrush;
123 KisBrushChooser * m_brushChooser;
124 KisGradientChooser * m_gradientChooser;
125
126 KisPaintopBox * m_paintopBox;
127};
128
129#endif
130
Control Frame - status display with access to color selector, brushes, patterns, and preview.
This widget presents all paintops that a user can paint with.
A resource mediator manages access to resources like gradients.