]> Shamusworld >> Repos - architektonas/blob - src/widgets/qg_layerwidget.h
Initial import
[architektonas] / src / widgets / qg_layerwidget.h
1 /****************************************************************************
2 ** $Id: qg_layerwidget.h 1589 2004-07-14 21:28:54Z andrew $
3 **
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
5 **
6 ** This file is part of the qcadlib Library project.
7 **
8 ** This file may be distributed and/or modified under the terms of the
9 ** GNU General Public License version 2 as published by the Free Software
10 ** Foundation and appearing in the file LICENSE.GPL included in the
11 ** packaging of this file.
12 **
13 ** Licensees holding valid qcadlib Professional Edition licenses may use
14 ** this file in accordance with the qcadlib Commercial License
15 ** Agreement provided with the Software.
16 **
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 **
20 ** See http://www.ribbonsoft.com for further details.
21 **
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
23 ** not clear to you.
24 **
25 **********************************************************************/
26
27 #ifndef QG_LAYERWIDGET_H
28 #define QG_LAYERWIDGET_H
29
30 #include <QtGui>
31 #include "rs_layerlist.h"
32 #include "rs_layerlistlistener.h"
33 #include "qg_actionhandler.h"
34
35 /**
36  * This is the Qt implementation of a widget which can view a
37  * layer list and provides a user interface for basic layer actions.
38  */
39 class QG_LayerWidget: public QWidget, public RS_LayerListListener
40 {
41     Q_OBJECT
42
43         public:
44                 QG_LayerWidget(QG_ActionHandler * ah, QWidget * parent,
45                         const char * name = 0, Qt::WindowFlags f = 0);
46                 ~QG_LayerWidget();
47
48                 void setLayerList(RS_LayerList *, bool showByBlock);
49                 void update();
50                 void highlightLayer(RS_Layer *);
51                 void highlightLayer(const QString &);
52
53                 virtual void layerActivated(RS_Layer *);
54                 virtual void layerAdded(RS_Layer *);
55                 virtual void layerEdited(RS_Layer *);
56                 virtual void layerRemoved(RS_Layer *);
57                 virtual void layerToggled(RS_Layer *);
58
59         signals:
60                 void escape();
61
62         public slots:
63 //              void slotActivated(const QString & layerName);
64                 void slotActivated(void);
65 //              void slotMouseButtonClicked(int button, Q3ListBoxItem * item, const QPoint & pos);
66                 void slotMouseButtonClicked(QListWidgetItem *);
67
68         protected:
69                 void contextMenuEvent(QContextMenuEvent *);
70                 virtual void keyPressEvent(QKeyEvent *);
71
72         private:
73                 RS_LayerList * layerList;
74                 bool showByBlock;
75 //              Q3ListBox * listBox;
76                 QListWidget * listBox;
77                 RS_Layer * lastLayer;
78                 QPixmap pxmLayerStatus00;
79                 QPixmap pxmLayerStatus01;
80                 QPixmap pxmLayerStatus10;
81                 QPixmap pxmLayerStatus11;
82                 QPixmap pxmVisible;
83                 QPixmap pxmHidden;
84                 QPixmap pxmAdd;
85                 QPixmap pxmRemove;
86                 QPixmap pxmEdit;
87                 QPixmap pxmDefreezeAll;
88                 QPixmap pxmFreezeAll;
89                 QG_ActionHandler * actionHandler;
90 };
91
92 #endif