1 /****************************************************************************
2 This file is part of the LibreCAD project, a 2D CAD program
3 
4 ** Copyright (C) 2012 Dongxu Li (dongxuli2011@gmail.com)
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 **********************************************************************/
20 
21 #ifndef RS_ACTIONBLOCKSSAVE_H
22 #define RS_ACTIONBLOCKSSAVE_H
23 
24 #include "rs_actioninterface.h"
25 
26 class RS_Insert;
27 
28 /**
29  * This action class can handle user events to save the active block to a file.
30  *
31  * @author Dongxu Li
32  */
33 class RS_ActionBlocksSave : public RS_ActionInterface {
34 	Q_OBJECT
35 public:
36     RS_ActionBlocksSave(RS_EntityContainer& container,
37                         RS_GraphicView& graphicView);
38 
39 	void init(int status=0) override;
40 	void trigger() override;
41 
42 private:
43     void addBlock(RS_Insert* in, RS_Graphic* g);
44 };
45 
46 #endif
47