1 /**************************************************************************** 2 ** 3 ** This file is part of the LibreCAD project, a 2D CAD program 4 ** 5 ** Copyright (C) 2011 Dongxu Li ( dongxuli2011@gmail.com ) 6 ** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl) 7 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. 8 ** 9 ** 10 11 This program is free software; you can redistribute it and/or 12 modify it under the terms of the GNU General Public License 13 as published by the Free Software Foundation; either version 2 14 of the License, or (at your option) any later version. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License for more details. 20 21 You should have received a copy of the GNU General Public License 22 along with this program; if not, write to the Free Software 23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 24 25 ** This copyright notice MUST APPEAR in all copies of the script! 26 ** 27 **********************************************************************/ 28 29 #ifndef RS_ACTIONMODIFYOFFSET_H 30 #define RS_ACTIONMODIFYOFFSET_H 31 32 #include "rs_previewactioninterface.h" 33 34 class RS_OffsetData; 35 36 /** 37 * This action class create entity by offset 38 * 39 * @author Dongxu Li 40 */ 41 class RS_ActionModifyOffset : public RS_PreviewActionInterface { 42 Q_OBJECT 43 public: 44 /** 45 * Action States. 46 */ 47 enum Status { 48 SetPosition /**< Setting the direction of offset*/ 49 }; 50 51 public: 52 RS_ActionModifyOffset(RS_EntityContainer& container, 53 RS_GraphicView& graphicView); 54 ~RS_ActionModifyOffset() override; 55 56 // void reset(); 57 58 void init(int status=0) override; 59 void trigger() override; 60 61 void mouseMoveEvent(QMouseEvent* e) override; 62 void mouseReleaseEvent(QMouseEvent* e) override; 63 64 // void coordinateEvent(RS_CoordinateEvent* e) override; 65 // void commandEvent(RS_CommandEvent* e) override; 66 // QStringList getAvailableCommands() override; 67 68 void hideOptions() override; 69 void showOptions() override; 70 71 void updateMouseButtonHints() override; 72 void updateMouseCursor() override; 73 74 protected: 75 76 std::unique_ptr<RS_OffsetData> data; 77 }; 78 #endif 79