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)
37 d_attacher = DCCodeEditorScriptManager::createCustomScriptAttacher(this, cell);
40 void DCEditScriptFolder::attach(DCCellCode *cellCode)
44 d_attacher = DCCodeEditorScriptManager::createCellCodeScriptAttacher(this, cellCode);
47 void DCEditScriptFolder::deattach()
56 QString DCEditScriptFolder::getCurrentScript(bool forceReload)
60 return d_attacher->getCurrentScript(forceReload);
64 bool DCEditScriptFolder::getIsModified() const
68 return d_attacher->getIsModified();
73 bool DCEditScriptFolder::getIsFileModifiedByExternalEditor() const
77 return d_attacher->getIsFileModifiedByExternalEditor();
82 qint64 DCEditScriptFolder::getLoadedTime() const
86 return d_attacher->getLoadedTime();
91 void DCEditScriptFolder::setScript(const QString& newScript)
95 d_attacher->setScript(newScript);
99 bool DCEditScriptFolder::saveScript()
103 return d_attacher->saveScript();
108 void DCEditScriptFolder::callbackScriptChanged()
110 emit scriptChanged();
113 void DCEditScriptFolder::callbackModificationStatusChanged(bool modified)
115 emit modificationStatusChanged(modified);
118 void DCEditScriptFolder::callbackFileModifiedByExternalEditor(qint64 notifiedTime)
120 emit fileModifiedByExternalEditor(notifiedTime);