OSDN Git Service

[denncoCreator] cell code scripts editor modification. Set editor readonly when a...
[dennco/denncoCreator.git] / Source / codeeditor / dccellscriptseditorpagewidget.h
1 //  Copyright (c) 2012 Dennco Project
2 //
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.
7 //
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.
12 //
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/>.
15
16 //
17 //  Created by tkawata on Nov-3, 2012.
18 //
19 #ifndef DCCELLCODEEDITORPAGEWIDGET_H
20 #define DCCELLCODEEDITORPAGEWIDGET_H
21
22 #include <QWidget>
23 #include <QSplitter>
24
25 class DCCell;
26 class DCCellCode;
27 class DCCodeEditor;
28 class DCVCPage;
29
30 class DCCellScriptsEditorPageWidget : public QWidget
31 {
32     Q_OBJECT
33
34     DCCell          *d_cell;
35     DCCellCode      *d_cellCodeOrg;
36     DCCodeEditor    *d_customScriptEditor;
37     DCCodeEditor    *d_cellCodeScriptEditor;
38
39     QSplitter       *d_splitter;
40     bool            d_modified;
41
42     bool            saveCustomScriptToFilePrivate();
43     bool            saveCellCodeScriptToFilePrivate(DCCellCode *cellCode);
44
45 public:
46     DCCellScriptsEditorPageWidget(DCCell *targetCell, QWidget *parent = 0);
47     virtual ~DCCellScriptsEditorPageWidget();
48
49     bool            getIsModified() const;
50
51     bool            loadScriptsFormFile();
52     void            setReadOnly(bool readOnly);
53     QSet<DCVCPage*> saveScriptsToFile(bool saveModifiedOnly);
54     bool            saveCustomScriptOnlyToFile(bool saveModifiedOnly);
55     bool            saveCellCodeScriptOnlyToFile(bool saveModifiedOnly);
56
57 signals:
58     void editingCellDestroyed(DCCell *cell);
59     void cellScriptsModifiedStatusChanged(QWidget *self, bool modified);
60     void cellScriptsSaved(QWidget *self);
61
62 private slots:
63     void assignedCellCodeChanged();
64     void cellDestroyed();
65     void customScriptChanged();
66     void cellCodeScriptChanged();
67 };
68
69 #endif // DCCELLCODEEDITORPAGEWIDGET_H