root/trunk/src/IPreferencesView.h

Revision 198, 2.3 kB (checked in by jordi, 2 years ago)

Added the PreferencesPter? and IPreferencesView classes as well as they test suite PreferencesPterTest? and DumbPreferencesView? classes. The first test, that tests that setting the browser command line changes the configuration, works.

Line 
1// ePDFView - A lightweight PDF Viewer.
2// Copyright (C) 2006 Emma's Software.
3//
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation; either version 2 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18#if !defined (__IPREFERENCES_VIEW_H__)
19#define __IPREFERENCES_VIEW_H__
20
21namespace ePDFView
22{
23    // Forward declarations.
24    class PreferencesPter;
25
26    ///
27    /// @class IPreferencesView
28    /// @brief Interface for the preferences view.
29    ///
30    class IPreferencesView
31    {
32        public:
33            ///
34            /// @brief Destroys all allocated memory for IPreferencesView.
35            ///
36            virtual ~IPreferencesView (void)
37            {
38            }
39
40            ///
41            /// @brief Gets the view's presenter.
42            ///
43            /// @return The presenter that is controlling the view.
44            ///
45            PreferencesPter *getPresenter (void)
46            {
47                return m_Pter;
48            }
49
50            ///
51            /// @brief Sets the view's presenter.
52            ///
53            /// After setting the presenter, the view can show the
54            /// preferences dialog.
55            ///
56            /// @param pter The presenter that will control the view.
57            ///
58            virtual void setPresenter (PreferencesPter *pter)
59            {
60                m_Pter = pter;
61            }
62
63            virtual const gchar *getBrowserCommandLine (void) = 0;
64
65        protected:
66            /// The presenter that controls the view.
67            PreferencesPter *m_Pter;
68
69            ///
70            /// @brief Constructs a new IPresenterView object.
71            ///
72            IPreferencesView (void)
73            {
74                m_Pter = NULL;
75            }
76    };
77}
78
79#endif // !__IPREFERENCES_VIEW_H__
Note: See TracBrowser for help on using the browser.