Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
document.h
Go to the documentation of this file.
1
8
#ifndef DOCUMENT_H_
9
#define DOCUMENT_H_
10
11
#include <QList>
12
#include <QString>
13
#include <QDateTime>
14
15
class
CASheet
;
16
class
CAArchive
;
17
class
CAResource
;
18
19
class
CADocument
{
20
public
:
21
CADocument
();
22
virtual
~CADocument
();
23
CADocument
*
clone
();
24
void
clear
();
25
26
QList<CASheet*>
sheetList
() {
return
_sheetList
; }
27
int
sheetCount
() {
return
_sheetList
.size(); }
28
CASheet
*
sheet
(
const
QString name);
29
CASheet
*
sheetAt
(
int
i) {
return
_sheetList
[i]; }
30
void
setSheetAt
(
int
i,
CASheet
*newSheet) {
_sheetList
[i]=newSheet; }
31
32
QList<CAResource*>&
resourceList
() {
return
_resourceList
; }
33
inline
void
addResource
(
CAResource
*r) {
_resourceList
<< r; }
34
inline
void
removeResource
(
CAResource
*r) {
_resourceList
.removeAll(r); }
35
36
CASheet
*
addSheetByName
(
const
QString name);
37
void
addSheet
(
CASheet
*
sheet
);
38
CASheet
*
addSheet
();
39
inline
void
removeSheet
(
CASheet
*
sheet
) {
_sheetList
.removeAll(sheet); }
40
41
const
QString
title
() {
return
_title
; }
42
const
QString
subtitle
() {
return
_subtitle
; }
43
const
QString
composer
() {
return
_composer
; }
44
const
QString
arranger
() {
return
_arranger
; }
45
const
QString
poet
() {
return
_poet
; }
46
const
QString
textTranslator
() {
return
_textTranslator
; }
47
const
QString
dedication
() {
return
_dedication
; }
48
const
QString
copyright
() {
return
_copyright
; }
49
const
QDateTime
dateCreated
() {
return
_dateCreated
; }
50
const
QDateTime
dateLastModified
() {
return
_dateLastModified
; }
51
const
unsigned
int
timeEdited
() {
return
_timeEdited
; }
52
const
QString
comments
() {
return
_comments
; }
53
54
void
setTitle
(
const
QString
title
) {
_title
=
title
; }
55
void
setSubtitle
(
const
QString
subtitle
) {
_subtitle
=
subtitle
; }
56
void
setComposer
(
const
QString
composer
) {
_composer
=
composer
; }
57
void
setArranger
(
const
QString
arranger
) {
_arranger
=
arranger
; }
58
void
setPoet
(
const
QString
poet
) {
_poet
=
poet
; }
59
void
setTextTranslator
(
const
QString
textTranslator
) {
_textTranslator
=
textTranslator
; }
60
void
setDedication
(
const
QString
dedication
) {
_dedication
=
dedication
; }
61
void
setCopyright
(
const
QString
copyright
) {
_copyright
=
copyright
; }
62
void
setDateCreated
(
const
QDateTime
dateCreated
) {
_dateCreated
=
dateCreated
; }
63
void
setDateLastModified
(
const
QDateTime
dateLastModified
) {
_dateLastModified
=
dateLastModified
; }
64
void
setTimeEdited
(
const
unsigned
int
timeEdited
) {
_timeEdited
=
timeEdited
; }
65
void
setComments
(
const
QString
comments
) {
_comments
=
comments
; }
66
68
// Temporary properties (not stored inside the file) //
70
const
QString
fileName
() {
return
_fileName
; }
71
bool
isModified
() {
return
_modified
; }
72
CAArchive
*
archive
() {
return
_archive
; }
73
74
void
setFileName
(
const
QString
fileName
) {
_fileName
=
fileName
; }
// not saved!
75
void
setModified
(
bool
m ) {
_modified
= m; }
76
void
setArchive
(
CAArchive
*a ) {
_archive
= a; }
77
78
private
:
79
QList<CASheet*>
_sheetList
;
80
QList<CAResource*>
_resourceList
;
81
82
QString
_title
;
83
QString
_subtitle
;
84
QString
_composer
;
85
QString
_arranger
;
86
QString
_poet
;
87
QString
_textTranslator
;
88
QString
_dedication
;
89
QString
_copyright
;
90
QDateTime
_dateLastModified
;
91
QDateTime
_dateCreated
;
92
unsigned
int
_timeEdited
;
// time the document has been edited in seconds
93
QString
_comments
;
94
95
QString
_fileName
;
96
bool
_modified
;
// unsaved changes
97
CAArchive
*
_archive
;
98
};
99
#endif
/* DOCUMENT_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3