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 Sep-30, 2012.
22 #include "TKCellCode.h"
27 class TKCellCodeInstance;
28 class DCVPageComponent;
32 class DCCellCode : public TKCellCode
34 friend struct DCComponentUtil;
35 friend class DCContainer;
37 DCCellCode(DCContainer *container, std::string theName, std::string theCellAPIName);
38 void bindComponent(DCVPageComponent *component) { d_vComponent = component; }
40 DCVPageComponent *d_vComponent;
41 DCContainer *d_container;
44 * Change name of this cell code.
45 * DCContainer will call this method.
47 void changeName(const QString& newName);
50 * Change the location path for this cell code.
51 * DCContainer will call this method.
53 void changePath(const QString& newPath);
56 virtual ~DCCellCode();
57 virtual TKCellCodeInstance* createCellCodeInstance(TKCell *owner, const void *data) { (void)owner; (void)data; return 0; }
59 DCVPageComponent* getVComponent() const { return d_vComponent; }
60 DCVCPage* getPageBelonging() const;
61 QString getOwnScript() const;
62 DCContainer* getContainer() const { return d_container; }
63 QString getWorkFilePathForCellCodeScript() const;
65 bool saveScript(const QString& script);
68 * Change the API type of this cell.
71 void changeType(const QString& newType);
74 #endif // DCCELLCODE_H