26class KivioConnectorPoint;
27class KivioConnectorTarget;
37#include "kivio_stencil.h"
39#define FLOW_LAYER_VISIBLE 0x0001
40#define FLOW_LAYER_CONNECTABLE 0x0002
41#define FLOW_LAYER_NOT_EDITABLE 0x0004
42#define FLOW_LAYER_NOT_PRINTABLE 0x0008
47 friend class KivioGroupStencil;
50 TQPtrList <KivioStencil> *m_pStencilList;
51 TQPtrList <KivioStencil> *m_pDeletedStencilList;
56 KivioStencil *loadSMLStencil(
const TQDomElement & );
57 KivioStencil *loadGroupStencil(
const TQDomElement & );
58 KivioStencil *loadPluginStencil(
const TQDomElement & );
62 KivioLayer( KivioPage * );
63 virtual ~KivioLayer();
65 KivioPage *page()
const{
return m_pPage;}
67 virtual DCOPObject* dcopObject();
69 TQPtrList<KivioStencil> *stencilList() {
return m_pStencilList; }
71 bool visible() {
return (m_flags & FLOW_LAYER_VISIBLE); }
72 void setVisible(
bool f );
74 bool connectable() {
return (m_flags & FLOW_LAYER_CONNECTABLE); }
75 void setConnectable(
bool f );
77 void setEditable(
bool f);
78 bool editable() {
return !(m_flags & FLOW_LAYER_NOT_EDITABLE); }
80 void setPrintable(
bool f);
81 bool printable() {
return !(m_flags & FLOW_LAYER_NOT_PRINTABLE); }
83 TQString name()
const {
return m_name; }
84 void setName(
const TQString &n ) { m_name = TQString(n); }
86 bool addStencil( KivioStencil * );
87 bool removeStencil( KivioStencil * );
89 bool loadXML(
const TQDomElement & );
90 void loadOasis(
const TQDomElement& layer);
91 TQDomElement saveXML( TQDomDocument & );
92 void saveOasis(KoXmlWriter* layerWriter);
94 KivioStencil *checkForStencil( KoPoint *,
int *,
float,
bool );
96 void printContent( KivioPainter& painter,
int xdpi = 0,
int ydpi = 0 );
97 void printContent(KivioPainter& painter, KoZoomHandler* zoomHandler);
98 void paintContent( KivioPainter& painter,
const TQRect& rect,
bool transparent, TQPoint p0,
99 KoZoomHandler* zoom );
100 void paintConnectorTargets( KivioPainter& painter,
const TQRect& rect,
bool transparent,
101 TQPoint p0, KoZoomHandler* zoom );
102 void paintSelectionHandles( KivioPainter& painter,
const TQRect& rect,
bool transparent,
103 TQPoint p0, KoZoomHandler* zoom );
105 KivioStencil *firstStencil() {
return m_pStencilList->first(); }
106 KivioStencil *nextStencil() {
return m_pStencilList->next(); }
107 KivioStencil *prevStencil() {
return m_pStencilList->prev(); }
108 KivioStencil *takeStencil() {
return m_pStencilList->take(); }
109 KivioStencil *currentStencil() {
return m_pStencilList->current(); }
110 KivioStencil *lastStencil() {
return m_pStencilList->last(); }
112 KivioStencil *takeStencil( KivioStencil * );
114 KivioConnectorTarget *connectPointToTarget( KivioConnectorPoint *,
float );
116 KoPoint snapToTarget(
const KoPoint& p,
double thresh,
bool& hit );
118 int generateStencilIds(
int );
120 void searchForConnections( KivioPage * );
121 void takeStencilFromList( KivioStencil *pStencil );
122 void insertStencil( KivioStencil *pStencil );