summaryrefslogtreecommitdiffstats
path: root/kugar/lib/mpagecollection.h
blob: a5de1e66d72d8428b189fd870df81c975d2bb962 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/***************************************************************************
             mpagecollection.h  -  Kugar report page collection
             -------------------
   begin     : Fri Aug 20 1999
   copyright : (C) 1999 by Mutiny Bay Software
   email     : [email protected]
***************************************************************************/

#ifndef MPAGECOLLECTION_H
#define MPAGECOLLECTION_H

#include <tqobject.h>
#include <tqptrlist.h>
#include <tqpicture.h>
#include <tqsize.h>

/**Kugar report page collection
  *@author Mutiny Bay Software
  */

namespace Kugar
{

class MPageCollection : public TQObject
{

public:
    /** Constructor */
    MPageCollection( TQObject *parent );
    /** Copy constructor */
    MPageCollection( const MPageCollection& mPageCollection );
    /** Assignment operator */
    MPageCollection operator=( const MPageCollection& mPageCollection );
    /** Destructor */
    virtual ~MPageCollection();

private:
    /** The report page list */
    TQPtrList<TQPicture> pages;
    /** Page dimensions */
    TQSize dimensions;
    /** Page size */
    int size;
    /** Page orientation */
    int orientation;

public:
    /** Clears the page collection */
    void clear();

    /** Appends a new page to the page collection */
    void appendPage();

    /** Gets the current page in the page collection,
      * the current page may be null
      */
    TQPicture* getCurrentPage();
    /** Gets the first page in the page collection,
      * returns NULL if the list is empty
      */
    TQPicture* getFirstPage();
    /** Get the previous page in the page collection,
      * returns NULL if the beginning of the list has been reached
      */
    TQPicture* getPreviousPage();
    /** Gets the next page in the page collection,
      * returns NULL if the end of the list has been reached
      */
    TQPicture* getNextPage();
    /** Gets the last page in the page collection,
      * returns NULL if the list empty
      */
    TQPicture* getLastPage();

    /** Get the index of the current page */
    int getCurrentIndex();
    /** Set the current page to page at idx */
    void setCurrentPage( int idx );

    /** Sets the page size */
    void setPageSize( int s );
    /** Sets the page orientation */
    void setPageOrientation( int o );
    /** Sets the page dimensions  */
    void setPageDimensions( TQSize dim );
    /** Returns the page size */
    int pageSize();
    /** Returns the page orientation */
    int pageOrientation();
    /** Returns the page dimensions  */
    TQSize pageDimensions();
    /** Returns the number of pages in the page collection */
    int pageCount();

    void addRef();
    void removeRef();

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

}

#endif