1 // Copyright (c) 2012 Dennco Project
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // Created by tkawata on Nov-3, 2012.
19 #ifndef DCCELLCODEEDITORPAGEWIDGET_H
20 #define DCCELLCODEEDITORPAGEWIDGET_H
25 #include "dceditscriptfolder.h"
32 class DCCellScriptsEditorPageWidget : public QWidget
37 DCCellCode *d_cellCodeOrg;
38 DCCodeEditor *d_customScriptEditor;
39 DCCodeEditor *d_cellCodeScriptEditor;
41 QSplitter *d_splitter;
44 DCEditScriptFolder d_customScriptFolder;
45 DCEditScriptFolder d_cellCodeScriptFolder;
47 bool loadCustomScript(bool forceReload = false);
48 bool loadCellCodeScript(bool forceReload = false);
50 void updateModifiedStatus();
53 DCCellScriptsEditorPageWidget(DCCell *targetCell, QWidget *parent = 0);
54 virtual ~DCCellScriptsEditorPageWidget();
56 bool getIsModified() const;
57 bool getIsCustomScriptModifiedByExternalEditor() const;
58 bool getIsCellCodeModifiedByExternalEditor() const;
59 qint64 getCustomScriptLoadedTime() const;
60 qint64 getCellCodeScriptLoadedTime() const;
62 void setReadOnly(bool readOnly);
63 QSet<DCVCPage*> saveScriptsToFile(bool saveModifiedOnly);
64 bool saveCustomScriptOnlyToFile(bool saveModifiedOnly);
65 bool saveCellCodeScriptOnlyToFile(bool saveModifiedOnly);
67 void focusCustomScript();
68 void focusCellCodeScript();
70 void reloadCustomScript();
71 void reloadCellCodeScript();
74 void editingCellDestroyed(DCCell *cell);
75 void cellScriptsModifiedStatusChanged(QWidget *self, bool modified);
76 void cellScriptsSaved(QWidget *self);
77 void customScriptModifiedByExternalEditor(QWidget *self, qint64 notifiedTime);
78 void cellCodeScriptModifiedByExternalEditor(QWidget *self, qint64 notifiedTime);
81 void assignedCellCodeChanged();
83 void editorCustomScriptChanged();
84 void editorCellCodeScriptChanged();
85 void folderCustomScriptChanged();
86 void folderCellCodeScriptChanged();
87 void folderCustomScriptModifiedStatusChanged(bool modified);
88 void folderCellCodeScriptModifiedStatusChanged(bool modified);
89 void folderCustomScriptFileModifiedByExternalEditor(qint64 notifiedTime);
90 void folderCellCodeScriptFileModifiedByExternalEditor(qint64 notifiedTime);
93 #endif // DCCELLCODEEDITORPAGEWIDGET_H