frameobj.h
author insilmaril
Wed Jul 16 10:46:14 2008 +0000 (2008-07-16)
changeset 721 12958f987bcf
parent 442 dfbc371b7280
permissions -rw-r--r--
Started to restructure for later use of Model/View
     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