1 /****************************************************************************
2 ** $Id: rs_layerlist.h 1869 2004-04-09 19:56:42Z andrew $
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
6 ** This file is part of the qcadlib Library project.
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.
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.
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.
20 ** See http://www.ribbonsoft.com for further details.
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
25 **********************************************************************/
27 #ifndef RS_LAYERLIST_H
28 #define RS_LAYERLIST_H
34 class RS_LayerListListener;
39 * @author Andrew Mustun
45 virtual ~RS_LayerList();
49 RS_Layer * at(uint i);
50 void activate(const QString & name, bool notify = false);
51 void activate(RS_Layer * layer, bool notify = false);
52 RS_Layer * getActive();
53 virtual void add(RS_Layer * layer);
54 virtual void remove(RS_Layer * layer);
55 virtual void edit(RS_Layer * layer, const RS_Layer & source);
56 RS_Layer * find(const QString & name);
57 int getIndex(const QString & name);
58 int getIndex(RS_Layer * layer);
59 void toggle(const QString & name);
60 void toggle(RS_Layer * layer);
61 void toggleLock(RS_Layer * layer);
62 void freezeAll(bool freeze);
63 void addListener(RS_LayerListListener * listener);
64 void removeListener(RS_LayerListListener * listener);
65 void setModified(bool m);
66 virtual bool isModified() const;
68 friend std::ostream & operator<<(std::ostream & os, RS_LayerList & l);
71 //! layers in the graphic
72 // Q3PtrList<RS_Layer> layers;
73 QList<RS_Layer *> layers;
74 //! List of registered LayerListListeners
75 // Q3PtrList<RS_LayerListListener> layerListListeners;
76 QList<RS_LayerListListener *> layerListListeners;
77 //! Currently active layer
78 RS_Layer * activeLayer;
79 /** Flag set if the layer list was modified and not yet saved. */