summaryrefslogtreecommitdiffstats
path: root/kugar/lib/mreportdetail.h
blob: 7aa8a1b7c7c70a412f3bd820c7b7db3011edc19b (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
84
85
86
87
88
89
/***************************************************************************
             mreportdetail.h  -  Kugar report detail section
             -------------------
   begin     : Mon Aug 23 1999
   copyright : (C) 1999 by Mutiny Bay Software
   email     : [email protected]
***************************************************************************/

#ifndef MREPORTDETAIL_H
#define MREPORTDETAIL_H

#include "mfieldobject.h"
#include "mreportsection.h"

/**Kugar report detail section
  *@author Mutiny Bay Software
  */

namespace Kugar
{

class MReportDetail : public MReportSection
{

public:
    /** Constructor */
    MReportDetail();
    /** Copy constructor */
    MReportDetail( const MReportDetail& mReportDetail );
    /** Assignment operator */
    MReportDetail operator=( const MReportDetail& mReportDetail );
    /** Destructor */
    virtual ~MReportDetail();

protected:
    /** Sections's repeat on new pages */
    bool repeat;
    /** Section's field collection */
    TQPtrList<MFieldObject> fields;

public:
    /** Sets whether to repeat the detail on new pages */
    void setRepeat( bool b );
    /** Sets whether to repeat the detail on new pages */
    bool getRepeat() const;
    /** Draws the detail section to the specified painter & x/y-offsets */
    void draw( TQPainter* p, int xoffset, int yoffset );
    /** Adds a new field object to the section's field collection */
    void addField( MFieldObject* field );
    /** Sets the data for the field at the specified index */
    void setFieldData( int idx, TQString data );
    /** Returns the number of fields in the detail section */
    int getFieldCount();
    /** Returns the name of the bound field for field object at the given index */
    TQString getFieldName( int idx );
    /** Frees all resources allocated by the report section */
    void clear();

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

};

}

#endif