File indexing completed on 2024-05-19 12:54:54
0001 /* This file is part of the KDE project 0002 Copyright (C) 2003 Lucijan Busch <lucijan@kde.org> 0003 Copyright (C) 2003-2016 Jarosław Staniek <staniek@kde.org> 0004 0005 This library is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU Library General Public 0007 License as published by the Free Software Foundation; either 0008 version 2 of the License, or (at your option) any later version. 0009 0010 This library is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 Library General Public License for more details. 0014 0015 You should have received a copy of the GNU Library General Public License 0016 along with this library; see the file COPYING.LIB. If not, write to 0017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef KEXIOBJECTVIEWWIDGET_H 0022 #define KEXIOBJECTVIEWWIDGET_H 0023 0024 #include <QWidget> 0025 0026 class KexiObjectViewTabWidget; 0027 class KexiProjectNavigator; 0028 class KexiPropertyPaneWidget; 0029 class KexiWindow; 0030 0031 //! @short A widget for object view, used in edit and design global view mode 0032 /*! Contents: 0033 @verbatim 0034 |---|--------------|-------------|---------------|---| 0035 | | | tabs | | | 0036 |tab| |-------------| |tab| 0037 |bar|Prj. navigator|Object's view|Property editor|bar| 0038 | | pane | | pane | | 0039 |---|--------------|-------------|---------------|---| 0040 @endverbatim 0041 */ 0042 class KexiObjectViewWidget : public QWidget 0043 { 0044 Q_OBJECT 0045 public: 0046 enum Flag { 0047 NoFlags = 0, 0048 ProjectNavigatorEnabled = 1, 0049 PropertyPaneEnabled = 2, 0050 DefaultFlags = ProjectNavigatorEnabled | PropertyPaneEnabled 0051 }; 0052 Q_DECLARE_FLAGS(Flags, Flag) 0053 Q_FLAG(Flags) 0054 0055 explicit KexiObjectViewWidget(Flags flags = DefaultFlags); 0056 0057 virtual ~KexiObjectViewWidget(); 0058 0059 KexiProjectNavigator* projectNavigator() const; 0060 KexiObjectViewTabWidget* tabWidget() const; 0061 KexiPropertyPaneWidget* propertyPane() const; 0062 0063 void setProjectNavigatorVisible(bool set); 0064 void setPropertyPaneVisible(bool set); 0065 0066 void setSidebarWidths(int projectNavigatorWidth, int propertyEditorWidth); 0067 void getSidebarWidths(int *projectNavigatorWidth, int *propertyEditorWidth) const; 0068 void updateSidebarWidths(); 0069 0070 protected Q_SLOTS: 0071 void slotCurrentTabIndexChanged(int index); 0072 void slotSplitterMoved(int pos, int index); 0073 0074 Q_SIGNALS: 0075 void currentTabIndexChanged(int index); 0076 void activeWindowChanged(KexiWindow *window, KexiWindow *prevWindow); 0077 void closeWindowRequested(int index); 0078 void closeAllWindowsRequested(); 0079 void projectNavigatorAnimationFinished(bool visible); 0080 0081 protected: 0082 void resizeEvent(QResizeEvent *e) override; 0083 void showEvent(QShowEvent *e) override; 0084 0085 private: 0086 void setupCentralWidget(); 0087 0088 class Private; 0089 const QScopedPointer<Private> d; 0090 0091 friend class KexiObjectViewTabWidget; 0092 }; 0093 0094 #endif