krita
kis_controlframe.h
00001 /* 00002 * kis_controlframe.h - part of Krita 00003 * 00004 * Copyright (c) 1999 Matthias Elter <elter@kde.org> 00005 * Copyright (c) 2003 Patrick Julien <freak@codepimps.org> 00006 * Copyright (c) 2004 Sven Langkamp <longamp@reallygood.de> 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00021 */ 00022 #ifndef __kis_controlframe_h__ 00023 #define __kis_controlframe_h__ 00024 00025 #include <qpopupmenu.h> 00026 00027 #include <ktoolbar.h> 00028 00029 #include <koFrameButton.h> 00030 00031 class QWidget; 00032 class QTabWidget; 00033 00034 class KToolBar; 00035 00036 class KoIconItem; 00037 class KisIconWidget; 00038 class KisGradientWidget; 00039 00040 class KisAutobrush; 00041 class KisAutogradient; 00042 class KisBrush; 00043 class KisBrushChooser; 00044 class KisGradient; 00045 class KisGradientChooser; 00046 class KisItemChooser; 00047 class KisPattern; 00048 class KisResourceMediator; 00049 class KisPaintopBox; 00050 class KisView; 00051 00052 class KisPopupFrame : public QPopupMenu { 00053 00054 Q_OBJECT 00055 00056 public: 00057 00058 KisPopupFrame(QWidget * parent, const char * name = 0); 00059 virtual void keyPressEvent(QKeyEvent *); 00060 00061 public: 00062 00063 void setChooser(KisItemChooser * chooser) { m_chooser = chooser; }; 00064 KisItemChooser * chooser() { return m_chooser; }; 00065 00066 private: 00067 KisItemChooser * m_chooser; 00068 }; 00069 00070 00075 class KisControlFrame : public QObject //: public KToolBar 00076 { 00077 Q_OBJECT 00078 00079 public: 00080 KisControlFrame(KMainWindow * window, KisView * view, const char *name = 0 ); 00081 virtual ~KisControlFrame() {}; 00082 00083 public slots: 00084 00085 void slotSetBrush(KoIconItem *item); 00086 void slotSetPattern(KoIconItem *item); 00087 void slotSetGradient(KoIconItem *item); 00088 00089 void slotBrushChanged(KisBrush * brush); 00090 void slotPatternChanged(KisPattern * pattern); 00091 void slotGradientChanged(KisGradient * gradient); 00092 00093 private: 00094 00095 void createBrushesChooser(KisView * view); 00096 void createPatternsChooser(KisView * view); 00097 void createGradientsChooser(KisView * view); 00098 00099 00100 private: 00101 QFont m_font; 00102 KisView * m_view; 00103 00104 QTabWidget * m_brushesTab; 00105 QTabWidget * m_gradientTab; 00106 00107 KisIconWidget *m_brushWidget; 00108 KisIconWidget *m_patternWidget; 00109 KisIconWidget *m_gradientWidget; 00110 00111 KisPopupFrame * m_brushChooserPopup; 00112 KisPopupFrame * m_patternChooserPopup; 00113 KisPopupFrame * m_gradientChooserPopup; 00114 00115 KisResourceMediator *m_brushMediator; 00116 KisResourceMediator *m_patternMediator; 00117 KisResourceMediator *m_gradientMediator; 00118 00119 00120 KisAutobrush * m_autobrush; 00121 KisBrushChooser * m_brushChooser; 00122 KisGradientChooser * m_gradientChooser; 00123 00124 KisPaintopBox * m_paintopBox; 00125 }; 00126 00127 #endif 00128