1#
2# Gramps - a GTK+/GNOME based genealogy program
3#
4# Copyright (C) 2010       Nick Hall
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19#
20
21#-------------------------------------------------------------------------
22#
23# BaseSidebar class
24#
25#-------------------------------------------------------------------------
26class BaseSidebar:
27    """
28    The base class for all sidebar plugins.
29    """
30    def __init__(self, dbstate, uistate):
31        raise NotImplementedError
32
33    def get_top(self):
34        """
35        Return the top container widget for the GUI.
36        """
37        raise NotImplementedError
38
39    def view_changed(self, cat_num, view_num):
40        """
41        Called when the active view is changed.
42        """
43        raise NotImplementedError
44
45    def active(self, cat_num, view_num):
46        """
47        Called when the sidebar is made visible.
48        """
49        pass
50
51    def inactive(self):
52        """
53        Called when the sidebar is hidden.
54        """
55        pass
56