summaryrefslogtreecommitdiffstats
path: root/kugar/lib/mlineobject.h
blob: 3ee686c05f191f661953ee895196cb67f56e7247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/***************************************************************************
             mlineobject.h  -  Kugar report line object
             -------------------
   begin     : Wed Feb 23 2000
   copyright : (C) 2000 by Mutiny Bay Software
   email     : [email protected]
***************************************************************************/

#ifndef MLINEOBJECT_H
#define MLINEOBJECT_H

#include <tqobject.h>
#include <tqpainter.h>
#include <tqpaintdevice.h>
#include <tqcolor.h>

/**Kugar report line object
  *@author Mutiny Bay Software
  */

namespace Kugar
{

class MLineObject : public TQObject
{

public:
    /** Line style constants */
    enum Style { NoPen = 0, SolidLine, DashLine,
                 DotLine, DashDotLine, DashDotDotLine };

    /** Constructor */
    MLineObject();
    /** Copy constructor */
    MLineObject( const MLineObject& mLineObject );
    /** Assignment operator */
    MLineObject operator=( const MLineObject& mLineObject );
    /** Destructor */
    virtual ~MLineObject();

protected:
    /** Object's x start position */
    int xpos1;
    /** Object's y start postition */
    int ypos1;
    /** Object's x end position */
    int xpos2;
    /** Object's y end position */
    int ypos2;

    /** Object's width */
    int penWidth;
    /** Object's color */
    TQColor penColor;
    /** Object's style */
    int penStyle;

public:
    /** Sets the start and end points for the line */
    void setLine( int xStart, int yStart, int xEnd, int yEnd );
    /** Sets the object's width */
    void setWidth( int width );
    /** Sets the object's style */
    void setStyle( int style );
    /** Sets the object's color */
    void setColor( int r, int g, int b );
    /** Draws the object to the specified painter & x/y offsets */
    virtual void draw( TQPainter* p, int xoffset, int yoffset );

protected:
    /** Draws the object to the specified painter & x/y offsets */
    void drawBase( TQPainter* p, int xoffset, int yoffset );

private:
    /** Copies member data from one object to another.
      * Used by the copy constructor and assignment operator
      */
    void copy( const MLineObject* mLineObject );
};

}

#endif