krita/ui
kis_abstract_canvas_widget.h
Go to the documentation of this file.00001 /* 00002 * Copyright (C) 2007 Boudewijn Rempt <boud@valdyas.org>, (C) 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 #ifndef _KIS_ABSTRACT_CANVAS_WIDGET_ 00019 #define _KIS_ABSTRACT_CANVAS_WIDGET_ 00020 00021 #include <QList> 00022 00023 class QWidget; 00024 class QRect; 00025 class QPoint; 00026 class QImage; 00027 class QPainter; 00028 class QRect; 00029 00030 class KoToolProxy; 00031 00032 class KisCanvas2; 00033 class KisGridDrawer; 00034 class KisCanvasDecoration; 00035 00036 class KisAbstractCanvasWidget 00037 { 00038 00039 public: 00040 00041 KisAbstractCanvasWidget() {} 00042 00043 virtual ~KisAbstractCanvasWidget() {} 00044 00045 virtual QWidget * widget() = 0; 00046 00047 virtual KoToolProxy * toolProxy() = 0; 00048 00049 virtual void documentOffsetMoved(const QPoint &) = 0; 00050 00051 virtual QPoint documentOrigin() = 0; 00052 00053 virtual void adjustOrigin() = 0; 00054 00058 void drawDecorations(QPainter & gc, bool tools, 00059 const QPoint & documentOffset, 00060 const QRect & clipRect, 00061 KisCanvas2 * canvas); 00062 00068 QImage checkImage(qint32 checkSize); 00069 void addDecoration(KisCanvasDecoration* deco); 00070 KisCanvasDecoration* decoration(const QString& id); 00071 00072 private: 00073 QList<KisCanvasDecoration*> m_decorations; 00074 }; 00075 00076 #endif // _KIS_ABSTRACT_CANVAS_WIDGET_
