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
,
48 virtual ~FramesTableItem();
59 * @author David Cuadrado <krawek@gmail.com>
61 class FramesTable
: public QTableWidget
65 friend class FramesTableItemDelegate
;
68 FramesTable(QWidget
*parent
= 0);
71 bool isSoundLayer(int row
);
76 void insertLayer(int layerPos
, const QString
&name
);
77 void insertSoundLayer(int layerPos
, const QString
&name
);
79 void removeCurrentLayer();
80 void removeLayer(int pos
);
81 void moveLayer(int pos
, int newPos
);
83 int lastFrameByLayer(int layerPos
);
86 void addFrame(int layerPos
, const QString
&name
);
87 void insertFrame(int layerPos
, int framePos
, const QString
&name
);
88 void setCurrentFrame(FramesTableItem
*);
89 void setCurrentLayer(int layerPos
);
90 void selectFrame(int index
);
92 void setAttribute(int row
, int col
, FramesTableItem::Attributes att
, bool value
);
94 void removeFrame(int layerPos
, int position
);
95 void moveFrame(int layerPos
, int from
, int to
);
97 void lockFrame(int layerPosition
, int position
, bool locked
);
99 void setFrameVisibility(int layerPosition
, int position
, bool isVisible
);
101 void setItemSize(int w
, int h
);
108 void mousePressEvent ( QMouseEvent
* event
);
111 void emitFrameSelected(int col
);
112 void emitFrameSelected(QTableWidgetItem
*curr
, QTableWidgetItem
*prev
);
113 void onCellDoubleClicked(int row
, int column
);
114 void onMenuActionTriggered(QAction
* action
);
117 void frameSelected(int layerPos
, int framePos
);
118 void requestInsertFrame(int layerPos
, int framePos
);
119 void requestRemoveFrame(int layerPos
, int framePos
);
120 void requestChangeFrameVisibility(int layerPos
, int framePos
, bool isVisible
);
121 void requestLockFrame(int layerPos
, int framePos
, bool locked
);
122 void requestExpandFrame(int layerPos
, int framePos
, int size
);