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 Dec-8, 2012.
19 #include "dceditscriptfolder.h"
21 #include "dccodeeditorscriptmanager.h"
23 DCEditScriptFolder::DCEditScriptFolder(QObject *parent) :
24 QObject(parent), d_attacher(NULL)
28 DCEditScriptFolder::~DCEditScriptFolder()
33 void DCEditScriptFolder::attach(DCCell *cell)
36 d_attacher = DCCodeEditorScriptManager::createCustomScriptAttacher(this, cell);
39 void DCEditScriptFolder::attach(DCCellCode *cellCode)
42 d_attacher = DCCodeEditorScriptManager::createCellCodeScriptAttacher(this, cellCode);
45 void DCEditScriptFolder::deattach()
54 QString DCEditScriptFolder::getCurrentScript(bool forceReload)
58 return d_attacher->getCurrentScript(forceReload);
62 bool DCEditScriptFolder::getIsModified() const
66 return d_attacher->getIsModified();
71 bool DCEditScriptFolder::getIsFileModifiedByExternalEditor() const
75 return d_attacher->getIsFileModifiedByExternalEditor();
80 qint64 DCEditScriptFolder::getLoadedTime() const
84 return d_attacher->getLoadedTime();
89 void DCEditScriptFolder::setScript(const QString& newScript)
93 d_attacher->setScript(newScript);
97 bool DCEditScriptFolder::saveScript()
101 return d_attacher->saveScript();
106 void DCEditScriptFolder::callbackScriptChanged()
108 emit scriptChanged();
111 void DCEditScriptFolder::callbackModificationStatusChanged(bool modified)
113 emit modificationStatusChanged(modified);
116 void DCEditScriptFolder::callbackFileModifiedByExternalEditor(qint64 notifiedTime)
118 emit fileModifiedByExternalEditor(notifiedTime);