Warning, file /education/ktouch/src/editor/resourceeditor.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * SPDX-FileCopyrightText: 2012 Sebastian Gottfried <sebastiangottfried@web.de> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef RESOURCEEDITOR_H 0008 #define RESOURCEEDITOR_H 0009 0010 #include <KMainWindow> 0011 0012 class QUndoGroup; 0013 class QTimer; 0014 class KAction; 0015 class KActionCollection; 0016 class CategorizedResourceSortFilterProxyModel; 0017 class DataIndex; 0018 class ResourceModel; 0019 class Resource; 0020 class ResourceEditorWidget; 0021 0022 class ResourceEditor : public KMainWindow 0023 { 0024 Q_OBJECT 0025 public: 0026 explicit ResourceEditor(QWidget* parent = nullptr); 0027 ~ResourceEditor() override; 0028 0029 protected: 0030 void closeEvent(QCloseEvent* event) override; 0031 0032 private slots: 0033 void newResource(); 0034 void deleteResource(); 0035 void importResource(); 0036 void exportResource(); 0037 void onResourceSelected(); 0038 void restoreResourceBackup(); 0039 void clearResourceBackup(); 0040 void save(); 0041 void setUndoText(const QString& text); 0042 void setRedoText(const QString& text); 0043 0044 private: 0045 void prepareResourceRestore(Resource* backup); 0046 Resource* storeResource(Resource* resource, Resource* dataIndexResource = nullptr); 0047 void selectDataResource(Resource* resource); 0048 void selectFirstResource(); 0049 bool importCourse(const QString& path); 0050 bool importKeyboardLayout(const QString& path); 0051 DataIndex* m_dataIndex; 0052 ResourceModel* m_resourceModel; 0053 CategorizedResourceSortFilterProxyModel* m_categorizedResourceModel; 0054 Resource* m_currentResource; 0055 Resource* m_backupResource; 0056 QUndoGroup* m_undoGroup; 0057 KActionCollection* m_actionCollection; 0058 QAction* m_newResourceAction; 0059 QAction* m_deleteResourceAction; 0060 QAction* m_undoAction; 0061 QAction* m_redoAction; 0062 QAction* m_importResourceAction; 0063 QAction* m_exportResourceAction; 0064 ResourceEditorWidget* m_editorWidget; 0065 QTimer* m_saveTimer; 0066 }; 0067 0068 #endif // RESOURCEEDITOR_H