# Orca
#
# Copyright 2006 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

"""Custom application settings for StarOffice."""

__id__        = "$Id:$"
__version__   = "$Revision:$"
__date__      = "$Date:$"
__copyright__ = "Copyright (c) 2005-2006 Sun Microsystems Inc."
__license__   = "LGPL"

import orca.appsettings as appsettings
import orca.settings as settings


########################################################################
#                                                                      #
# The StarOffice app settings class.                                   #
#                                                                      #
########################################################################

class Settings(appsettings.Settings):

    def __init__(self, app):
        """Creates a new script for the given application.

        Arguments:
        - app: the application to create a script for.
        """

        appsettings.Settings.__init__(self, app)

    def loadNewSettings(self):
        """Load the application specific settings. Note that it is upto
        the individual application settings scripts, to save away the
        previous value of each setting that it overrides, so that it can
        later be restored correctly. """

        self.readTableCellRow = settings.readTableCellRow
        settings.readTableCellRow = False

    def restoreOldSettings(self):
        """Restore the previous settings."""

        settings.readTableCellRow = self.readTableCellRow
