5326: Add Alphabetical Index and Table of Contents generation for pdf reports

svn: r18842
This commit is contained in:
Nick Hall
2012-02-10 14:53:58 +00:00
parent 249c5dc46b
commit 3767c1d1e4
25 changed files with 598 additions and 41 deletions

View File

@@ -30,7 +30,8 @@ class DocGenPlugin(Plugin):
"""
This class represents a plugin for generating documents from Gramps
"""
def __init__(self, name, description, basedoc, paper, style, extension):
def __init__(self, name, description, basedoc, paper, style, index,
extension):
"""
@param name: A friendly name to call this plugin.
Example: "Plain Text"
@@ -47,6 +48,10 @@ class DocGenPlugin(Plugin):
@param style: Indicates whether the plugin uses styles or not.
True = use styles; False = do not use styles
@type style: bool
@param index: Indicates whether the plugin supports an Alphabetical
Index and Table of Contents or not.
True = supports indexing; False = does not support indexing
@type index: bool
@param extension: The extension for the output file.
Example: "txt"
@type extension: str
@@ -56,6 +61,7 @@ class DocGenPlugin(Plugin):
self.__basedoc = basedoc
self.__paper = paper
self.__style = style
self.__index = index
self.__extension = extension
def get_basedoc(self):
@@ -82,6 +88,14 @@ class DocGenPlugin(Plugin):
"""
return self.__style
def get_index_support(self):
"""
Get the index flag for this plugin.
@return: bool - True = index support; False = no index support
"""
return self.__index
def get_extension(self):
"""
Get the file extension for the output file.
@@ -106,4 +120,4 @@ class DocGenPlugin(Plugin):
@return: bool: True if DrawDoc is supported; False if DrawDoc is not
supported.
"""
return bool(issubclass(self.__basedoc, DrawDoc))
return bool(issubclass(self.__basedoc, DrawDoc))