Schim
sheet.h
1 #ifndef SHEET_H
2 #define SHEET_H
3 
4 #include "entity.h"
5 #include "header.h"
6 #include "object.h"
7 
8 class Project;
9 
16 class Sheet : public Entity
17 {
18 public:
19  // CONSTRUCTORS
20  explicit Sheet(bool defaultHeader = true);
21  ~Sheet();
22 
23  // GETTERS
24  float getWidth() const;
25  float getHeight() const;
26  Header *getHeader();
27  QRectF getContentArea() const;
28  QList<Object *> &getObjects();
29  QList<Object *> getObjects() const;
33  int getIndex();
37  virtual Project *getParent() const;
38 
39  // SETTERS
40  void setWidth(float width);
41  void setHeight(float height);
42  void setHeight() const;
48  void setHeader(Header *header, bool destroy = true);
49  void addObject(Object *obj);
50  void removeObject(Object *obj);
51  virtual void setParent(Project *project);
52 
53  // MISCELLANEOUS
54  QList<Object *>::iterator begin();
55  QList<Object *>::iterator end();
56 
57 private:
58  // ATTRIBUTES
59  float width = 297, height = 210;
60  Header *header = nullptr;
61 
62  QList<Object *> objects;
63 };
64 
65 #endif // SHEET_H
The abstract base class for all objects in a sheet.
Definition: object.h:21
Class representing a header for a sheet.
Definition: header.h:15
A project is essentially a list of sheets, along with some project properties.
Definition: project.h:16
Base class for entities.
Definition: entity.h:32
int getIndex()
Return the index of the sheet in the project it belongs to.
void setHeader(Header *header, bool destroy=true)
Set this sheet&#39;s header.
virtual Project * getParent() const
Override getParent with covariant return type Project.
This class models a sheet of paper.
Definition: sheet.h:16