/usr/include/k3bpluginconfigwidget.h is in libk3b-dev 2.0.3a-2+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | /*
*
* Copyright (C) 2003-2008 Sebastian Trueg <trueg@k3b.org>
*
* This file is part of the K3b project.
* Copyright (C) 1998-2008 Sebastian Trueg <trueg@k3b.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* See the file "COPYING" for the exact licensing terms.
*/
#ifndef _K3B_PLUGIN_CONFIG_WIDGET_H_
#define _K3B_PLUGIN_CONFIG_WIDGET_H_
#include <KCModule>
#include <KPluginFactory>
#include <KPluginLoader>
#include "k3b_export.h"
class KConfigGroup;
namespace K3b {
/**
* A config widget for a K3b plugin.
*
* Most implementation details for KCModules apply.
*
* Create a desktop file along the lines of:
*
* \code
* [Desktop Entry]
* Name=K3b Lame Mp3 Encoder Config Module
* Type=Service
* X-KDE-ServiceTypes=KCModule
* X-KDE-Library=kcm_k3blameencoder
* X-KDE-ParentComponents=k3blameencoder
* \endcode
*
* X-KDE-ParentComponents is important as it is the only indicator
* for the plugin system to match the config widget to the plugin.
*
* Then implement KCModule::load(), KCModule::save() and KCModule::defaults()
* to handle the configuration. In these methods you may use k3bcore->config()
* to store the configuration in the main K3b config object under a specific
* group.
*/
class LIBK3B_EXPORT PluginConfigWidget : public KCModule
{
Q_OBJECT
public:
PluginConfigWidget( QWidget* parent = 0, const QVariantList& args = QVariantList() );
virtual ~PluginConfigWidget();
// TODO: find a nice way to get the plugin name for the config groups
#if 0
public Q_SLOTS:
/**
* reimplemented from KCModule. Do not change.
* implement loadConfig instead.
*/
void defaults();
/**
* reimplemented from KCModule. Do not change.
* implement loadConfig instead.
*/
void load();
/**
* reimplemented from KCModule. Do not change.
* implement saveConfig instead.
*/
void save();
protected:
/**
* Load the config. Implement this instead of KCModule::load and
* KCModule::defaults (the latter case will be handled by loading
* from an invalid KConfigGroup object.
*
* \param config The config group to load the config From
*/
virtual void loadConfig( const KConfigGroup& config );
/**
* Save the config
*/
virtual void saveConfig( KConfigGroup config );
#endif
};
}
#define K3B_EXPORT_PLUGIN_CONFIG_WIDGET( libname, classname ) \
K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
K_EXPORT_PLUGIN(factory(#libname))
#endif
|