kivio

kivio_base_target_stencil.h

00001 /*
00002  * Kivio - Visual Modelling and Flowcharting
00003  * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 #ifndef KIVIO_BASE_TARGET_STENCIL_H
00020 #define KIVIO_BASE_TARGET_STENCIL_H
00021 
00022 #include <qfont.h>
00023 #include <qcolor.h>
00024 #include <qdom.h>
00025 #include <qptrlist.h>
00026 
00027 class KivioCustomDragData;
00028 class KivioConnectorPoint;
00029 class KivioConnectorTarget;
00030 class KivioFillStyle;
00031 class KivioIntraStencilData;
00032 class KivioLineStyle;
00033 class KivioPage;
00034 class KivioStencilSpawner;
00035 class KivioTextStyle;
00036 
00037 #include "kivio_stencil.h"
00038 
00039 
00040 class KivioBaseTargetStencil : public KivioStencil
00041 {
00042 protected:
00043     KivioLineStyle *m_pLineStyle;
00044     KivioFillStyle *m_pFillStyle;
00045     KivioTextStyle *m_pTextStyle;
00046 
00047     QPtrList<KivioConnectorTarget> *m_pTargets;
00048 
00049     virtual QDomElement createRootElement( QDomDocument & );
00050 
00051     virtual bool saveCustom( QDomElement &, QDomDocument & );
00052     virtual QDomElement saveProperties( QDomDocument & );
00053     virtual QDomElement saveTargets( QDomDocument & );
00054 
00055     virtual bool loadCustom( const QDomElement & );
00056     virtual bool loadProperties( const QDomElement & );
00057     virtual bool loadTargets( const QDomElement & );
00058 
00059     virtual void copyBasicInto( KivioBaseTargetStencil * );
00060 
00061 public:
00062     KivioBaseTargetStencil();
00063     virtual ~KivioBaseTargetStencil();
00064 
00065     virtual KivioStencil *duplicate() { return NULL; }
00066 
00067 
00069     //
00070     // KivioLineStyle
00071     //
00073     virtual QColor fgColor();
00074     virtual void setFGColor( QColor c );
00075 
00076     virtual void setLineWidth( double l );
00077     virtual double lineWidth();
00078 
00079 
00080 
00082     //
00083     // KivioFillStyle
00084     //
00086     virtual void setBGColor( QColor c );
00087     virtual QColor bgColor();
00088 
00089     virtual KivioFillStyle *fillStyle();
00090 
00091 
00092 
00094     //
00095     // KivioTextStyle
00096     //
00098     virtual QColor textColor();
00099     virtual void setTextColor( QColor c );
00100 
00101     virtual QFont textFont();
00102     virtual void setTextFont( const QFont &f );
00103 
00104     virtual int hTextAlign();
00105     virtual int vTextAlign();
00106 
00107     virtual void setHTextAlign(int a);
00108     virtual void setVTextAlign(int a);
00109 
00110     virtual void setText( const QString &a );
00111     virtual QString text();
00112 
00113 
00114 
00116     //
00117     // Paint Routines
00118     //
00120     virtual void paint( KivioIntraStencilData * );
00121     virtual void paintOutline( KivioIntraStencilData * );
00122     virtual void paintConnectorTargets( KivioIntraStencilData * );
00123 
00124 
00125 
00127     //
00128     // File I/O
00129     //
00131     virtual bool loadXML( const QDomElement & );
00132     virtual QDomElement saveXML( QDomDocument & );
00133 
00134 
00135 
00137     //
00138     // Geometry
00139     //
00141     virtual void updateGeometry();
00142 
00143 
00144 
00146     //
00147     // Connection Routines
00148     //
00150     // This attempts to connect based on position
00151     virtual KivioConnectorTarget *connectToTarget( KivioConnectorPoint *, double );
00152 
00153     // This attempts to connect based on a targetID.  This should  ***ONLY*** be used
00154     // right after a load
00155     virtual KivioConnectorTarget *connectToTarget( KivioConnectorPoint *, int );
00156 
00157 
00159     //
00160     // ID Generation
00161     //
00163     virtual int generateIds( int );
00164 
00165 
00166 
00167     virtual int resizeHandlePositions();
00168 };
00169 
00170 #endif
00171 
00172 
KDE Home | KDE Accessibility Home | Description of Access Keys