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