File indexing completed on 2024-05-12 16:39:49
0001 /* This file is part of the KDE project 0002 Copyright (C) 2009 Jarosław Staniek <staniek@kde.org> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef FORM_WIDGET_INTERFACE_H 0021 #define FORM_WIDGET_INTERFACE_H 0022 0023 #include "kformdesigner_export.h" 0024 0025 namespace KFormDesigner 0026 { 0027 0028 //! Base class for all form widgets. 0029 /*! Provides "design" and "editing" flags that can affect rendering 0030 of the widget and other behaviour depending on whether the parent form is in design or data mode 0031 and edting mode. 0032 */ 0033 class KFORMDESIGNER_EXPORT FormWidgetInterface 0034 { 0035 public: 0036 //! Initializes the interface. The design flag is set to false by default. 0037 FormWidgetInterface(); 0038 0039 virtual ~FormWidgetInterface(); 0040 0041 //! @return true if this widget is in design mode 0042 virtual bool designMode() const; 0043 0044 //! Sets design mode on or off. Sets the arrow mouse cursor for design mode. 0045 virtual void setDesignMode(bool design); 0046 0047 //! @return true if this widget is in inline editing mode 0048 virtual bool editingMode() const; 0049 0050 //! Sets inline editing mode on or off. 0051 virtual void setEditingMode(bool editing); 0052 0053 protected: 0054 class Private; 0055 Private *d; 0056 }; 0057 0058 } 0059 0060 #endif