00001 /*************************************************************************** 00002 * * 00003 * DrawPad - a drawing program for Opie Environment * 00004 * * 00005 * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 ***************************************************************************/ 00013 00014 #ifndef DRAWPAD_H 00015 #define DRAWPAD_H 00016 00017 #include <qmainwindow.h> 00018 #include <qpen.h> 00019 00020 class DrawPadCanvas; 00021 class Tool; 00022 00023 class QAction; 00024 class QColor; 00025 class QSpinBox; 00026 class QToolButton; 00027 class QWidgetStack; 00028 00029 class DrawPad : public QMainWindow 00030 { 00031 Q_OBJECT 00032 00033 public: 00034 DrawPad(QWidget* parent = 0, const char* name = 0, WFlags fl = 0); 00035 ~DrawPad(); 00036 00037 static QString appName() { return QString::fromLatin1("drawpad"); } 00038 00039 Tool* tool() { return m_pTool; } 00040 QPen pen() { return m_pen; } 00041 QBrush brush() { return m_brush; } 00042 00043 bool antiAliasing(); 00044 00045 private slots: 00046 void finishStartup(); 00047 00048 void newPage(); 00049 void clearPage(); 00050 void deletePage(); 00051 00052 void slotAppMessage( const QCString&, const QByteArray& ); 00053 00054 void setPointTool(); 00055 void setLineTool(); 00056 void setRectangleTool(); 00057 void setFilledRectangleTool(); 00058 void setEllipseTool(); 00059 void setFilledEllipseTool(); 00060 void setTextTool(); 00061 void setFillTool(); 00062 void setEraseTool(); 00063 00064 void changePenWidth(int value); 00065 void changePenColor(const QColor& color); 00066 void changeBrushColor(const QColor& color); 00067 00068 void updateView(); 00069 00070 void deleteAll(); 00071 void importPage(); 00072 void exportPage(); 00073 void thumbnailView(); 00074 void pageInformation(); 00075 00076 private: 00077 void loadConfig(); 00078 void saveConfig(); 00079 00080 DrawPadCanvas* m_pDrawPadCanvas; 00081 00082 Tool* m_pTool; 00083 QPen m_pen; 00084 QBrush m_brush; 00085 00086 QAction* m_pAntiAliasingAction; 00087 00088 QAction* m_pUndoAction; 00089 QAction* m_pRedoAction; 00090 00091 QAction* m_pFirstPageAction; 00092 QAction* m_pPreviousPageAction; 00093 QAction* m_pNextPageAction; 00094 QAction* m_pLastPageAction; 00095 00096 QAction* m_pPointToolAction; 00097 QAction* m_pLineToolAction; 00098 QAction* m_pRectangleToolAction; 00099 QAction* m_pFilledRectangleToolAction; 00100 QAction* m_pEllipseToolAction; 00101 QAction* m_pFilledEllipseToolAction; 00102 QAction* m_pTextToolAction; 00103 QAction* m_pFillToolAction; 00104 QAction* m_pEraseToolAction; 00105 00106 QToolButton* m_pLineToolButton; 00107 QToolButton* m_pRectangleToolButton; 00108 QToolButton* m_pEllipseToolButton; 00109 QToolButton* m_pPenColorToolButton; 00110 QToolButton* m_pBrushColorToolButton; 00111 00112 QSpinBox* m_pPenWidthSpinBox; 00113 }; 00114 00115 #endif // DRAWPAD_H
1.4.2