Added custom style for bible readings with bible background (which isn't in repo)
[kworship.git] / kworship / KwPlugin.cpp
blob50d1ea4d1094573d61fddb87ff7676de545b1789
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 /**
21 * @file KwPlugin.cpp
22 * @brief An abstract KWorship plugin.
23 * @author James Hogan <james@albanarts.com>
26 #include "KwPlugin.h"
27 #include "KwPluginManager.h"
30 * Constructors + destructor
33 /// Primary constructor.
34 KwPlugin::KwPlugin(const QString& id, const QString& name, const QString& description)
35 : m_id(id)
36 , m_name(name)
37 , m_description(description)
38 , m_manager(0)
39 , m_loaded(false)
43 /// Destructor.
44 KwPlugin::~KwPlugin()
49 * Basic information accessors
52 /// Get the id.
53 const QString& KwPlugin::id() const
55 return m_id;
58 /// Get the name.
59 const QString& KwPlugin::name() const
61 return m_name;
64 /// Get the description.
65 const QString& KwPlugin::description() const
67 return m_description;
70 /// Get whether the plugin is loaded.
71 bool KwPlugin::isLoaded() const
73 return m_loaded;
77 * Loading and unloading
80 /// Set the manager.
81 void KwPlugin::setManager(KwPluginManager* manager)
83 Q_ASSERT(0 == m_manager);
84 m_manager = manager;
87 /// Load the plugin.
88 void KwPlugin::load()
90 if (!m_loaded)
92 _load();
96 /// Unload the plugin.
97 void KwPlugin::unload()
99 if (m_loaded)
101 _unload();