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 "dcvcomponent.h"
26 class DCVPageComponent;
28 class DCVCPage : public DCVComponent
30 QString d_locationPath;
34 bool d_shouldUpdateShape;
40 QList<DCVPageComponent*> d_cells;
41 DCVPageComponent *d_editCursor;
44 DCVCPage(const QString &locationPath);
47 virtual DCVCPage * getPageBelonging() const { return const_cast<DCVCPage*>(this);}
48 virtual DCCell* getOwnerCell() const { return NULL; }
49 virtual DCVVisibility getIsVisible() const { return d_colorA == 0 ? DCV_VISIBLE_NONE : DCVComponent::getIsVisible(); }
50 virtual bool isResizingArea(float x, float y, float z) const { return false; }
51 QString getLocationPath() const { return d_locationPath; }
53 void registerCell(DCVPageComponent *cell);
54 void unregisterCell(DCVPageComponent *cell);
56 void registerEditCursor(DCVPageComponent *ecursor);
57 void unregisterEditCursor();
59 void updateVisiblity(bool linkedCellVisible, bool linkedCellRenderFull, bool linkedCellSelectable, bool otherCellVisible, bool otherCellRenderFull, bool otherCellSelectable);
61 virtual void prepareChildrenForDraw(bool isAnimationInterval);
62 virtual void drawChildren(bool isAnimationInterval);
63 virtual void drawChildrenForSelection(QList<DCVComponent*> *itemList);
64 virtual void translate();
65 virtual void setSelected(bool selected, bool updateChildren);
66 virtual void setVisible(DCVVisibility visibleSelf, DCVVisibility visibleChildren);
67 virtual void renderOwnShape(bool isAnimationInterval, bool renderAsWireframe);
69 virtual bool startDrag(float x, float y, float z, bool isResizingDrag);
70 virtual bool dragging(float x, float y, float z, bool isResizingDrag);
71 virtual bool endDrag(float x, float y, float z, bool isResizingDrag);
72 virtual void updateShape() {}
74 void setHeight(float height);
75 void setWidth(float width);
76 void setDepth(float depth);
77 void setColor(float r, float g, float b, float a);