1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 """
22 Provide a simplified database access interface to the GRAMPS database.
23 """
24 import BaseDoc
25
27 """
28 Provide a simplified database access interface to the GRAMPS database.
29 """
30
32 """
33 Initialize the class with the real document
34 """
35 self.doc = doc
36
44
46 """
47 Writes the Title using the Title paragraph
48 """
49 self.__write('Title', text)
50
52 """
53 Writes the first level header using the Header1 paragraph
54 """
55 self.__write('Header1', text)
56
58 """
59 Writes the second level header using the Header2 paragraph
60 """
61 self.__write('Header2', text)
62
64 """
65 Writes the third level header using the Header3 paragraph
66 """
67 self.__write('Header3', text)
68
70 """
71 Writes a paragraph using the Normal format
72 """
73 self.__write('Normal', text)
74
76 """
77 Create the basic style sheet for the SimpleDoc class
78 """
79 sheet = BaseDoc.StyleSheet()
80
81 pstyle = BaseDoc.ParagraphStyle()
82 fstyle = pstyle.get_font()
83 fstyle.set_type_face(BaseDoc.FONT_SANS_SERIF)
84 fstyle.set_size(14)
85 fstyle.set_bold(True)
86 pstyle.set_font(fstyle)
87 pstyle.set_alignment(BaseDoc.PARA_ALIGN_LEFT)
88 sheet.add_paragraph_style('Title', pstyle)
89
90 pstyle = BaseDoc.ParagraphStyle()
91 fstyle = pstyle.get_font()
92 fstyle.set_type_face(BaseDoc.FONT_SANS_SERIF)
93 fstyle.set_size(12)
94 fstyle.set_bold(True)
95 pstyle.set_font(fstyle)
96 pstyle.set_alignment(BaseDoc.PARA_ALIGN_LEFT)
97 pstyle.set_tabs([4, 8, 12, 16])
98 sheet.add_paragraph_style('Header1', pstyle)
99
100 pstyle = BaseDoc.ParagraphStyle()
101 fstyle = pstyle.get_font()
102 fstyle.set_type_face(BaseDoc.FONT_SANS_SERIF)
103 fstyle.set_size(10)
104 fstyle.set_bold(True)
105 pstyle.set_font(fstyle)
106 pstyle.set_alignment(BaseDoc.PARA_ALIGN_LEFT)
107 pstyle.set_tabs([4, 8, 12, 16])
108 sheet.add_paragraph_style('Header2', pstyle)
109
110 pstyle = BaseDoc.ParagraphStyle()
111 fstyle = pstyle.get_font()
112 fstyle.set_type_face(BaseDoc.FONT_SANS_SERIF)
113 fstyle.set_size(10)
114 fstyle.set_bold(True)
115 fstyle.set_italic(True)
116 pstyle.set_font(fstyle)
117 pstyle.set_alignment(BaseDoc.PARA_ALIGN_LEFT)
118 pstyle.set_tabs([4, 8, 12, 16])
119 sheet.add_paragraph_style('Header3', pstyle)
120
121 pstyle = BaseDoc.ParagraphStyle()
122 pstyle.set_tabs([4, 8, 12, 16])
123 sheet.add_paragraph_style('Normal', pstyle)
124
125
126 tbl = BaseDoc.TableStyle()
127 tbl.set_width(100)
128 tbl.set_columns(2)
129 tbl.set_column_width(0,20)
130 tbl.set_column_width(1,80)
131 sheet.add_table_style("Table",tbl)
132
133 cell = BaseDoc.TableCellStyle()
134 cell.set_top_border(1)
135 cell.set_bottom_border(1)
136 sheet.add_cell_style("TableHead",cell)
137
138 cell = BaseDoc.TableCellStyle()
139 sheet.add_cell_style("TableNormalCell",cell)
140
141 cell = BaseDoc.TableCellStyle()
142 cell.set_longlist(1)
143 sheet.add_cell_style("TableListCell",cell)
144
145 return sheet
146