All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PrintScene.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file PrintScene.h
22 
23  \brief Class responsible for printing the entire content or part of the scene. As the scene is upside down, it is necessary to invert the y of the painter before printing.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_PRINT_SCENE_H
29 #define __TERRALIB_LAYOUT_INTERNAL_PRINT_SCENE_H
30 
31 // TerraLib
32 #include "../../core/Config.h"
33 #include "../../core/enum/AbstractType.h"
34 
35 // Qt
36 #include <QObject>
37 #include <QRectF>
38 
39 class QGraphicsScene;
40 class QPrinter;
41 class QPainter;
42 
43 namespace te
44 {
45  namespace layout
46  {
47  class PaperConfig;
48 
49  /*!
50  \brief Class responsible for printing the entire content or part of the scene. As the scene is upside down, it is necessary to invert the y of the painter before printing.
51 
52  \ingroup layout
53  */
54  class TELAYOUTEXPORT PrintScene : public QObject
55  {
56  Q_OBJECT //for slots/signals
57 
58  public:
59 
60  PrintScene( QGraphicsScene* scene, PaperConfig* config );
61 
62  virtual ~PrintScene();
63 
64  virtual void printPreview();
65 
66  virtual bool exportToPDF();
67 
68  protected slots:
69 
70  virtual void printPaper(QPrinter* printer);
71 
72  protected:
73 
74  virtual QPrinter* createPrinter();
75 
76  virtual void renderScene( QPainter* newPainter, QPrinter* printer );
77 
78  virtual void deselectAllItems();
79 
80  QGraphicsScene* m_scene;
82  te::layout::PrinterScene m_printState;
83  };
84  }
85 }
86 
87 #endif
Class responsible for paper setting. Size, orientation, custom size, etc.
Definition: PaperConfig.h:45
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
QGraphicsScene * m_scene
Definition: PrintScene.h:80
te::layout::PrinterScene m_printState
Definition: PrintScene.h:82
PaperConfig * m_config
Definition: PrintScene.h:81
Class responsible for printing the entire content or part of the scene. As the scene is upside down...
Definition: PrintScene.h:54