krita/ui

kis_cmb_composite.h

Go to the documentation of this file.
00001 /*
00002  *  widgets/kis_cmb_composite.h - part of KImageShop/Krayon/Krita
00003  *
00004  *  Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org)
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef KIS_CMB_COMPOSITE_H_
00022 #define KIS_CMB_COMPOSITE_H_
00023 
00024 #include <krita_export.h>
00025 #include "kcombobox.h"
00026 #include "KoCompositeOp.h"
00027 
00028 class KisCompositeOpsModel;
00029 class KCategorizedSortFilterProxyModel;
00030 
00036 class KRITAUI_EXPORT KisCmbComposite : public KComboBox
00037 {
00038 
00039     Q_OBJECT
00040 
00041 public:
00042 
00043     KisCmbComposite(QWidget * parent = 0, const char * name = 0);
00044     virtual ~KisCmbComposite();
00045 
00046     const QString& currentItem() const;
00047 
00048     void setCompositeOpList(const QList<KoCompositeOp*>& list);
00049     void setCurrent(const KoCompositeOp* op);
00050     void setCurrent(const QString & s);
00051 
00052 signals:
00053 
00054     void activated(const QString&);
00055     void highlighted(const QString&);
00056 
00057 private slots:
00058 
00059     void slotOpActivated(int i);
00060     void slotOpHighlighted(int i);
00061 
00062 private:
00063     // Prevent deprectated Qt3 method from being called. Use setCurrent instead.
00064     void setCurrentText(const QString & s);
00065     const QString& itemAt(int idx) const;
00066 
00067     KisCompositeOpsModel* m_lastModel;
00068     KCategorizedSortFilterProxyModel* m_sortModel;
00069 };
00070 
00071 #endif