krita

kis_filter_manager.h

00001 /*
00002  *  Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef _KIS_FILTER_MANAGER_
00020 #define _KIS_FILTER_MANAGER_
00021 
00022 #include "qdict.h"
00023 #include "qobject.h"
00024 #include "qptrlist.h"
00025 #include "qsignalmapper.h"
00026 #include "kactionclasses.h"
00027 #include "kis_image.h"
00028 #include "kis_selection.h"
00029 
00030 #include <koffice_export.h>
00031 
00032 class KAction;
00033 class KisView;
00034 class KisDoc;
00035 class KisFilter;
00036 class KisFilterConfiguration;
00037 class KAction;
00038 class KActionCollection;
00039 class KisPreviewDialog;
00040 
00044 class KRITACORE_EXPORT KisFilterManager : public QObject {
00045 
00046     Q_OBJECT
00047 
00048 public:
00049 
00050     KisFilterManager(KisView * parent, KisDoc * doc);
00051     ~KisFilterManager();
00052 
00053     void setup(KActionCollection * ac);
00054     void updateGUI();
00055 
00056 
00057     bool apply();
00058 
00059 protected slots:
00060 
00061     void slotApply();
00062     void slotConfigChanged();
00063     void slotApplyFilter(int);
00064     void refreshPreview();
00065 
00066 private:
00067 
00068     KisView * m_view;
00069     KisDoc * m_doc;
00070 
00071     KAction * m_reapplyAction;
00072 
00073     QPtrList<KAction> m_filterActions;
00074     
00075     KisFilterConfiguration * m_lastFilterConfig;
00076     KisFilter * m_lastFilter;
00077     KisPreviewDialog * m_lastDialog;
00078     KisFilterConfigWidget * m_lastWidget;
00079     
00080     KisIDList m_filterList; // Map the actions in the signalmapper to the filters
00081     QSignalMapper * m_filterMapper;
00082     
00083     QDict<KActionMenu> m_filterActionMenus;
00084     QTimer m_delayer;
00085 };
00086 
00087 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys