Logo Search packages:      
Sourcecode: palapeli version File versions  Download package

Palapeli::PatternPlugin Class Reference

#include <Palapeli/PatternPlugin>

Inheritance diagram for Palapeli::PatternPlugin:

Palapeli::HexagonalPatternPlugin Palapeli::JigsawPatternPlugin Palapeli::RectangularPatternPlugin

List of all members.


Detailed Description

This class is used in a pattern plugin as an entry point. It will create all valid Palapeli::PatternConfiguration instances. To mark this entry point, include the following lines in the source code of your pattern (replace MyPatternPlugin by the name of your Palapeli::PatternPlugin subclass, and mypattern by the name of your library):
#include <KPluginFactory>
#include <KPluginLoader>

K_PLUGIN_FACTORY(MyPatternFactory, registerPlugin<MyPatternPlugin>();)
K_EXPORT_PLUGIN(MyPatternFactory("mypattern"))

Warning:
Each plugin may only define one PatternPlugin subclass. See the documentation of the createInstances() method to see how multiple patterns may be included in one pattern plugin.
Author:
Stefan Majewsky <majewsky@gmx.net>

Definition at line 53 of file pattern-plugin.h.


Public Member Functions

virtual QList
< PatternConfiguration * > 
createInstances () const =0
 Returns Palapeli::PatternConfiguration instances for this plugin. To actually use your plugin, Palapeli needs access to the patterns defined by your plugin. (This will usually be only one pattern per plugin.) Therefore, this method creates Palapeli::PatternConfiguration instances for Palapeli. If you choose to have multiple patterns in one plugin, you can create one Palapeli::PatternConfiguration instance for each plugin.
 PatternPlugin (QObject *parent=0, const QVariantList &args=QVariantList())
 Constructs a new PatternPlugin object. The parameter signature has to be the same one in all subclasses, because these are passed by the plugin loader. Usually, you will not have to bother with these parameters.
virtual ~PatternPlugin ()
 Destructor.

Protected Member Functions

QString displayName () const
 The plugin's display name. This method returns the plugin's display name as specified in the plugin's desktop file. This localizable string identifies the plugin in interfaces, and can be used as a basis for the display name needed in the Palapeli::PatternConfiguration constructor.
QString iconName () const
 The plugin's icon name. This method returns the name of the icon recommended to depict this plugin, as specified in the plugin's desktop file.
QString pluginName () const
 The plugin's internal name. This method returns the plugin name specified in the plugin's desktop file. This string identifies the plugin internally, and can be used as a basis for the pattern name needed in the Palapeli::PatternConfiguration constructor.

Private Attributes

PatternPluginPrivate *const p

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index