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 QTimer; 00033 class QTabWidget; 00034 00035 class KToolBar; 00036 00037 class KoIconItem; 00038 class KisIconWidget; 00039 class KisGradientWidget; 00040 00041 class KisAutobrush; 00042 class KisAutogradient; 00043 class KisBrush; 00044 class KisBrushChooser; 00045 class KisGradient; 00046 class KisGradientChooser; 00047 class KisItemChooser; 00048 class KisPattern; 00049 class KisResourceMediator; 00050 class KisPaintopBox; 00051 class KisView; 00052 00053 class KisPopupFrame : public QPopupMenu { 00054 00055 Q_OBJECT 00056 00057 public: 00058 00059 KisPopupFrame(QWidget * parent, const char * name = 0); 00060 virtual void keyPressEvent(QKeyEvent *); 00061 00062 public: 00063 00064 void setChooser(KisItemChooser * chooser) { m_chooser = chooser; }; 00065 KisItemChooser * chooser() { return m_chooser; }; 00066 00067 private: 00068 KisItemChooser * m_chooser; 00069 }; 00070 00071 00076 class KisControlFrame : public QObject //: public KToolBar 00077 { 00078 Q_OBJECT 00079 00080 public: 00081 KisControlFrame(KMainWindow * window, KisView * view, const char *name = 0 ); 00082 virtual ~KisControlFrame() {}; 00083 00084 public slots: 00085 00086 void slotSetBrush(KoIconItem *item); 00087 void slotSetPattern(KoIconItem *item); 00088 void slotSetGradient(KoIconItem *item); 00089 00090 void slotBrushChanged(KisBrush * brush); 00091 void slotPatternChanged(KisPattern * pattern); 00092 void slotGradientChanged(KisGradient * gradient); 00093 00094 private: 00095 00096 void createBrushesChooser(KisView * view); 00097 void createPatternsChooser(KisView * view); 00098 void createGradientsChooser(KisView * view); 00099 00100 00101 private: 00102 QFont m_font; 00103 KisView * m_view; 00104 00105 QTabWidget * m_brushesTab; 00106 QTabWidget * m_gradientTab; 00107 00108 KisIconWidget *m_brushWidget; 00109 KisIconWidget *m_patternWidget; 00110 KisIconWidget *m_gradientWidget; 00111 00112 KisPopupFrame * m_brushChooserPopup; 00113 KisPopupFrame * m_patternChooserPopup; 00114 KisPopupFrame * m_gradientChooserPopup; 00115 00116 KisResourceMediator *m_brushMediator; 00117 KisResourceMediator *m_patternMediator; 00118 KisResourceMediator *m_gradientMediator; 00119 00120 00121 KisAutobrush * m_autobrush; 00122 KisBrushChooser * m_brushChooser; 00123 KisGradientChooser * m_gradientChooser; 00124 00125 KisPaintopBox * m_paintopBox; 00126 }; 00127 00128 #endif 00129