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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
#ifndef __APTPLUGINCONTAINER_H_2004_06_23
#define __APTPLUGINCONTAINER_H_2004_06_23
#include <qobject.h>
#include <baseplugincontainer.h>
#include "iaptmediator.h"
#include "installationtool.h"
class QAction;
using namespace std;
namespace NApplication
{
class RunCommand;
}
namespace NApt
{
class IAptSearch;
class IPackageDB;
}
class AptSettingsWidget;
namespace NPlugin
{
class AptSearchPlugin;
class AptActionPlugin;
class PackageDescriptionPlugin;
class PackageStatusPlugin;
class InstalledVersionPlugin;
class AvailableVersionPlugin;
// Class AptPluginContainer
//
//
class AptPluginContainer : public QObject, public BasePluginContainer, public IAptMediator
{
Q_OBJECT
/** @brief The plugins in the container */
//@{
AptSearchPlugin* _pAptSearchPlugin;
AptActionPlugin* _pAptActionPlugin;
PackageDescriptionPlugin* _pPackageDescriptionPlugin;
PackageStatusPlugin* _pPackageStatusPlugin;
InstalledVersionPlugin* _pInstalledVersionPlugin;
AvailableVersionPlugin* _pAvailableVersionPlugin;
//@}
/** @brief This pointer is used to run the <tt>apt-get update</tt> command. */
NApplication::RunCommand* _pCommand;
/** @brief This holds the interface to access the information of the packages.
*/
NApt::IPackageDB* _pPackageDB;
/** @brief This holds the interface to search the packages.
*/
NApt::IAptSearch* _pAptSearch;
/** @brief This holds a pointer to the settings widget currently active.
*
* This pointer must not be deleted and should only be used in applySettings().
*/
AptSettingsWidget* _pSettingsWidget;
/** @brief Holds the installation tool to be used for installation (APT). */
NApt::InstallationTool _installationTool;
public:
/**
* Default Constructor
*/
AptPluginContainer();
virtual ~AptPluginContainer();
/** @name PluginContainer Interface
*
* These functions implement the PluginContainer interface.
*/
//@{
// documened in base class
virtual bool init(IProvider* pProvider);
/** @brief This gets a plugin with the given name. The plugin is not
* initialized so call Plugin::init() for it.
*
* Accepted names are:
* \li AptSearchPlugin
* \li PackageDescriptionPlugin
* \li PackageStatusPlugin
*
* @see PluginContainer::requestPlugin()
*/
// virtual Plugin* requestPlugin(const QString& name);
/** @returns "aptplugin" */
virtual string name() const { return "aptplugin"; };
virtual QString title() const { return QString("Apt Plugins"); };
virtual QWidget* getSettingsWidget(QWidget* pParent);
virtual void applySettings();
//@}
/** @name BasePluginContainer Overloads
*
* These functions implement saving and loading of the container settings
* as described in BasePluginContainer.
*/
//@{
virtual QDomElement loadContainerSettings(const QDomElement source);
virtual void saveContainerSettings(NXml::XmlData& outData, QDomElement parent) const;
//@}
/** @name IAptMediator Overloads
*
*/
// documened in base class
//@{
virtual void setInstallationTool(NApt::InstallationTool tool);
virtual QString installationToolCommand();
virtual QStringList searchPatterns();
virtual void updateAptDatabase();
virtual void reloadAptDatabase();
//@}
protected Q_SLOTS:
/** @brief This function will be called if the update finished.
*
* It will update the database used.
*/
void onAptUpdateFinished();
};
} // namespace NPlugin
#endif // __APTPLUGINCONTAINER_H_2004_06_23
|