1 /***************************************************************************
2 * Copyright (C) 2005 by David Cuadrado *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef COMPONENTSLAYERTABLE_H
22 #define COMPONENTSLAYERTABLE_H
24 #include <QTableWidget>
25 #include <QTableWidgetItem>
34 class FramesTableItemDelegate
;
36 class FramesTableItem
: public QTableWidgetItem
41 IsUsed
= Qt::UserRole
,
50 enum InGroupPositionType
59 virtual ~FramesTableItem();
66 InGroupPositionType
inGroupPosition();
73 * @brief Esta clase provee de una interfaz gráfica para la visualización y gestión del estado de los frames del proyecto,
74 * @author David Cuadrado <krawek@gmail.com>
76 class FramesTable
: public QTableWidget
80 friend class FramesTableItemDelegate
;
83 FramesTable(QWidget
*parent
= 0);
86 bool isSoundLayer(int row
);
91 void insertLayer(int layerPos
, const QString
&name
);
92 void insertSoundLayer(int layerPos
, const QString
&name
);
94 void removeCurrentLayer();
95 void removeLayer(int pos
);
96 void moveLayer(int pos
, int newPos
);
98 int lastFrameByLayer(int layerPos
);
101 void addFrame(int layerPos
, const QString
&name
);
102 void insertFrame(int layerPos
, int framePos
, const QString
&name
);
103 void setCurrentFrame(FramesTableItem
*);
104 void setCurrentLayer(int layerPos
);
105 void selectFrame(int index
);
107 void setAttribute(int row
, int col
, FramesTableItem::Attributes att
, bool value
);
109 void removeFrame(int layerPos
, int position
);
110 void moveFrame(int layerPos
, int from
, int to
);
112 void lockFrame(int layerPosition
, int position
, bool locked
);
114 void setFrameVisibility(int layerPosition
, int position
, bool isVisible
);
116 void setItemSize(int w
, int h
);
118 void expandFrame(int layerPosition
, int position
, int size
);
120 void groupFrames(int layerPosition
, int from
, int to
);
121 void destroyGroupFrames(int layerPos
, int position
, int size
);
129 void mousePressEvent ( QMouseEvent
* event
);
132 void emitFrameSelected(int col
);
133 void onItemSelectionChanged();
135 void onCellDoubleClicked(int row
, int column
);
136 void onMenuActionTriggered(QAction
* action
);
139 void frameSelected(int layerPos
, int framePos
);
140 void layerSelected(int layerPos
);
141 void requestInsertFrame(int layerPos
, int framePos
);
142 void requestRemoveFrame(int layerPos
, int framePos
);
144 void requestCopyFrame(int layerPos
, int framePos
);
145 void requestPasteFrame(int layerPos
, int framePos
);
146 void requestCutFrame(int layerPos
, int framePos
);
148 void requestChangeFrameVisibility(int layerPos
, int framePos
, bool isVisible
);
149 void requestLockFrame(int layerPos
, int framePos
, bool locked
);
150 void requestExpandFrame(int layerPos
, int framePos
, int size
);