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
|
//
// C++ Interface: informationpluginmockup
//
// Description:
//
//
// Author: Benjamin Mesing <bensmail@gmx.net>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef __NTEST_INFORMATIONPLUGINMOCKUP_H_20080912
#define __NTEST_INFORMATIONPLUGINMOCKUP_H_20080912
#include <QObject>
#include <informationplugin.h>
#include <shortinformationplugin.h>
#include <helpers.h>
namespace NPlugin {
class IProvider;
}
namespace NTest {
using namespace NPlugin;
/**
@author Benjamin Mesing <bensmail@gmx.net>
*/
class InformationPluginMockup : public QObject, public NPlugin::InformationPlugin, public NPlugin::ShortInformationPlugin
{
int _shortInformationPriority;
QString _shortInformationCaption;
public:
InformationPluginMockup();
~InformationPluginMockup();
/** @name Plugin Interface
*
* Implementation of the PluginInterface
*/
//@{
virtual void init(IProvider* /*pProvider*/) {};
/// @todo not yet implemented
virtual void setEnabled(bool) {};
/// @todo not yet implemented
virtual void setVisible(bool) {};
virtual QString name() const { return "InformationPluginMockup"; }
/** @returns "PackageDescriptionPlugin" */
virtual QString title() const { return tr("InformationPluginMockup"); };
/// @todo to be implemented
virtual QString briefDescription() const { return ""; };
/// @todo to be implemented
virtual QString description() const { return ""; };
//@}
/** @name InformationPlugin interface
*
* Implementation of the InformationPlugin interface
*/
//@{
virtual uint informationPriority() const { return 0; }
/** @returns a widget which shows a description of this package. */
virtual QWidget* informationWidget() const { return 0; };
/** @returns "Description" */
virtual QString informationWidgetTitle() const { return "InformationPluginMockup"; };
virtual void updateInformationWidget(const string& /*package*/) {};
virtual void clearInformationWidget() {};
/** This plugin offers an information text. */
virtual bool offersInformationText() const { return false; };
virtual QString informationText (const string& package) { return toQString(package); };
//@}
/** @name ShortInformationPlugin interface
*
* Implementation of the ShortInformationPlugin interface
*/
//@{
virtual uint shortInformationPriority() const { return _shortInformationPriority; };
/** This returns a short description about the package.
* @param packageID a handle of the package to show information for */
virtual const QString shortInformationText(const string& package) { return toQString(package); };
/** The caption for the short information is <b>Description</b>. */
virtual QString shortInformationCaption() const { return _shortInformationCaption; };
// documented in base class
virtual int preferredColumnWidth() const { return 10; }
//@}
void setShortInformationPriority(int priority) { _shortInformationPriority=priority; };
void setShortInformationCaption ( const QString& theValue )
{
_shortInformationCaption = theValue;
}
};
}
#endif
|