gramps/src/SpreadSheetDoc.py

117 lines
3.0 KiB
Python
Raw Normal View History

2002-10-20 19:55:16 +05:30
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
import TextDoc
2002-10-20 19:55:16 +05:30
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
class SpreadSheetDoc:
def __init__(self,type,orientation=TextDoc.PAPER_PORTRAIT):
2002-10-20 19:55:16 +05:30
self.orientation = orientation
if orientation == TextDoc.PAPER_PORTRAIT:
2002-10-20 19:55:16 +05:30
self.width = type.get_width()
self.height = type.get_height()
else:
self.width = type.get_height()
self.height = type.get_width()
self.tmargin = 2.54
self.bmargin = 2.54
self.lmargin = 2.54
self.rmargin = 2.54
self.font = TextDoc.FontStyle()
2002-10-20 19:55:16 +05:30
self.actfont = self.font
self.style_list = {}
self.table_styles = {}
self.cell_styles = {}
self.name = ""
def get_usable_width(self):
return self.width - (self.rmargin + self.lmargin)
def get_usable_height(self):
return self.height - (self.tmargin + self.bmargin)
def creator(self,name):
self.name = name
def add_style(self,name,style):
self.style_list[name] = TextDoc.ParagraphStyle(style)
2002-10-20 19:55:16 +05:30
def add_table_style(self,name,style):
self.table_styles[name] = TextDoc.TableStyle(style)
2002-10-20 19:55:16 +05:30
def add_cell_style(self,name,style):
self.cell_styles[name] = TextDoc.TableCellStyle(style)
2002-10-20 19:55:16 +05:30
def change_font(self,font):
self.actfont = TextDoc.FontStyle(font)
2002-10-20 19:55:16 +05:30
def restore_font(self):
self.actfont = self.font
def get_default_font(self):
return self.font
def get_active_font(self):
return self.actfont
def open(self,filename):
pass
def close(self):
pass
def start_page(self,name,style_name):
pass
def end_page(self):
pass
def start_paragraph(self,style_name):
pass
def end_paragraph(self):
pass
def start_table(self,name,style_name):
pass
def end_table(self):
pass
def start_row(self):
pass
def end_row(self):
pass
def start_cell(self,style_name,span=1):
pass
def end_cell(self):
pass
def write_text(self,text):
pass