/*************************************************************************** * Copyright (C) 2004 by Johan Maes - ON4QZ * * on4qz@telenet.be * * http://users.telenet.be/on4qz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef EDITOR_H #define EDITOR_H #include #include #include #include #include #include #include #include #include #define NUMCOLORSELECTORS 12 class colorSelector; class editorForm; /** Image Editor supporting transparency @author Johan Maes - ON4QZ */ class editor : public QMainWindow { Q_OBJECT public: editor(QWidget *parent = 0, const char *name = 0); ~editor(); /** saves attributes to ini_file */ void writeSettings(); /** loads attributes from ini_file */ void readSettings(); /** called when exiting the editor */ void closeEvent(QCloseEvent *); void setImage(QImage *ima); void openFile(QFile &f); public slots: void slotFileNew(); void slotFileOpen(); void slotFileSave(); void slotFileSaveImage(); void slotFileSaveTemplate(); void slotFileQuit(); void slotRotateChanged(int); void slotShearChanged(int); void slotShearRotateChanged(double,int); void slotResizeCanvas(int); void slotTextChanged(const QString &); signals: void imageAvailable(QImage *); private: void initView(); void initActions(); void initToolbar(); void initMenubar(); void setParams(); void getParams(); QAction *fileNew; QAction *fileOpen; QAction *fileSave; QAction *fileSaveImage; QAction *fileSaveTemplate; QAction *fileQuit; QAction *copy; QAction *paste; // QAction *setBg; QAction *clearAll; // QAction *formatFont; QToolBar *toolBar; QPopupMenu *fileMenu; QPopupMenu *editMenu; editorForm *ev; QFont localFont; QColor fgColor; QColor bgColor; colorSelector *csArray[NUMCOLORSELECTORS]; void initColorSelectors(); QFile localFile; QComboBox *resizeCanvas; }; #endif