1 /****************************************************************************
2 **
3 ** This file is part of the LibreCAD project, a 2D CAD program
4 **
5 ** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
6 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
7 **
8 **
9 ** This file may be distributed and/or modified under the terms of the
10 ** GNU General Public License version 2 as published by the Free Software
11 ** Foundation and appearing in the file gpl-2.0.txt included in the
12 ** packaging of this file.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ** GNU General Public License for more details.
18 **
19 ** You should have received a copy of the GNU General Public License
20 ** along with this program; if not, write to the Free Software
21 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 **
23 ** This copyright notice MUST APPEAR in all copies of the script!
24 **
25 **********************************************************************/
26 
27 
28 #ifndef RS_PREVIEWACTIONINTERFACE_H
29 #define RS_PREVIEWACTIONINTERFACE_H
30 
31 #include <memory>
32 #include "rs_actioninterface.h"
33 
34 /**
35  * This is the interface that must be implemented for all
36  * action classes which need a preview.
37  *
38  * @author Andrew Mustun
39  */
40 class RS_PreviewActionInterface : public RS_ActionInterface {
41 public:
42     RS_PreviewActionInterface(const char* name,
43                               RS_EntityContainer& container,
44                               RS_GraphicView& graphicView);
45 	~RS_PreviewActionInterface() override;
46 
47 	void init(int status=0) override;
48 	void finish(bool updateTB=true) override;
49 	void suspend() override;
50 	void resume() override;
51 	void trigger() override;
52     void drawPreview();
53     void deletePreview();
54 
55 private:
56 
57 protected:
58     /**
59      * Preview that holds the entities to be previewed.
60      */
61 	std::unique_ptr<RS_Preview> preview;
62     bool hasPreview;//whether preview is in use
63 //    /**
64 //     * Current offset of the preview.
65 //     */
66 //	std::unique_ptr<RS_Vector> offset;
67 };
68 
69 #endif
70