frameobj.h
author insilmaril
Mon, 18 Jun 2007 15:10:19 +0000
changeset 507 2f57a7d2315e
parent 470 80ae7b79828c
permissions -rw-r--r--
1.8.73 - beta testing
     1 #ifndef FRAMEOBJ_H
     2 #define FRAMEOBJ_H
     3 
     4 #include "mapobj.h"
     5 
     6 
     7 /*! \brief This class adds a frame to a MapObj. 
     8 */
     9 
    10 class FrameObj:public MapObj {
    11 public:
    12 
    13 	/*! \brief Supported frame types */
    14 	enum FrameType {NoFrame,Rectangle,Ellipse};
    15 
    16     FrameObj();
    17     FrameObj(QGraphicsScene*);
    18     ~FrameObj();
    19     void init();
    20     void clear();
    21     void move (double x,double y);    // move to absolute Position
    22     void moveBy (double x,double y);  // move to relative Position
    23 	void positionBBox();			 
    24 	void calcBBoxSize();			
    25 	void setRect (const QRectF &);	  // set dimensions			
    26     void setPadding(const int &);
    27     int getPadding();
    28     void setBorderWidth (const int &);
    29     int getBorderWidth ();
    30     FrameType getFrameType ();
    31     QString getFrameTypeName ();
    32     void setFrameType (const FrameType &);
    33     void setFrameType (const QString &);
    34 	void setPenColor (QColor);
    35 	QColor getPenColor ();
    36 	void setBrushColor (QColor);
    37 	QColor getBrushColor ();
    38 	void repaint();
    39     void setVisibility(bool);
    40 	QString saveToDir ();
    41 
    42 private:
    43     FrameType type;			//!< Frame type
    44     QGraphicsRectItem * rectFrame;
    45     QGraphicsEllipseItem * ellipseFrame;
    46     int padding;					// distance text - frame
    47 	int borderWidth;
    48 	QColor penColor;
    49 	QColor brushColor;
    50 };
    51 #endif
    52