2010-12-19 18:08:08 +00:00
|
|
|
/*
|
2014-01-29 18:37:45 +00:00
|
|
|
Copyright 2006-2014 The QElectroTech Team
|
2010-12-19 18:08:08 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech 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.
|
|
|
|
|
|
|
|
QElectroTech 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 QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2010-12-20 02:45:36 +00:00
|
|
|
#ifndef TITLEBLOCK_TEMPLATE_RENDERER_H
|
|
|
|
#define TITLEBLOCK_TEMPLATE_RENDERER_H
|
2010-12-19 18:08:08 +00:00
|
|
|
#include <QPicture>
|
|
|
|
#include "diagramcontext.h"
|
2010-12-20 02:45:36 +00:00
|
|
|
class TitleBlockTemplate;
|
|
|
|
class TitleBlockTemplateRenderer : public QObject {
|
2010-12-19 18:08:08 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-12-20 02:45:36 +00:00
|
|
|
TitleBlockTemplateRenderer(QObject * = 0);
|
|
|
|
virtual ~TitleBlockTemplateRenderer();
|
|
|
|
const TitleBlockTemplate *titleBlockTemplate() const;
|
|
|
|
void setTitleBlockTemplate(const TitleBlockTemplate *);
|
2010-12-19 18:08:08 +00:00
|
|
|
void setContext(const DiagramContext &context);
|
|
|
|
int height() const;
|
|
|
|
void render(QPainter *, int);
|
2014-01-08 16:55:16 +00:00
|
|
|
void renderDxf(QRectF &, int, QString &, int);
|
2010-12-24 21:00:11 +00:00
|
|
|
void invalidateRenderedTemplate();
|
2012-02-26 21:54:47 +00:00
|
|
|
void setUseCache(bool);
|
|
|
|
bool useCache() const;
|
2010-12-19 18:08:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void renderToQPicture(int);
|
|
|
|
|
|
|
|
private:
|
2010-12-20 02:45:36 +00:00
|
|
|
const TitleBlockTemplate *titleblock_template_;
|
2012-02-26 21:54:47 +00:00
|
|
|
bool use_cache_;
|
2010-12-19 18:08:08 +00:00
|
|
|
QPicture rendered_template_;
|
|
|
|
DiagramContext context_;
|
2010-12-20 02:45:36 +00:00
|
|
|
int last_known_titleblock_width_;
|
2010-12-19 18:08:08 +00:00
|
|
|
};
|
|
|
|
#endif
|