PluginInterface Class Reference

#include <plugin_interface.h>


Detailed Description

This is the class that a plugin must implement.

The PluginInterface is the interface between Launchy and your plugin. Launchy communicates with your plugin through the msg function. To store any settings in Launchy's permanent configuration file, please refer to the settings member variable.

Definition at line 473 of file plugin_interface.h.


Public Member Functions

virtual ~PluginInterface ()
virtual int msg (int msgId, void *wParam=NULL, void *lParam=NULL)=0
 This is how messages are passed to the plugin.

Data Fields

QSettings ** settings
 The setting manager in which you store your persistent data.

Constructor & Destructor Documentation

virtual PluginInterface::~PluginInterface (  )  [inline, virtual]

Definition at line 476 of file plugin_interface.h.


Member Function Documentation

virtual int PluginInterface::msg ( int  msgId,
void *  wParam = NULL,
void *  lParam = NULL 
) [pure virtual]

This is how messages are passed to the plugin.

Here you handle the subset of messages that your plugin requires. At minimum, your plugin must handle MSG_GET_ID and MSG_GET_NAME. For unhandled messages, return 0. For handled messages, return 1.

Parameters:
msgId The type of the message, such as show dialog, initialize, or get results
wParam If this message type requires any parameters, this will be the first and casted to void*
lParam If this message requires two parameters, this is the second, casted to void*
Returns:
1 means the message was handled, 0 means it was ignored
		int WebyPlugin::msg(int msgId, void* wParam, void* lParam)
		{
			bool handled = false;
			switch (msgId)
			{		
				case MSG_INIT:
					init();
					handled = true;
					break;
				case MSG_GET_LABELS:
					getLabels((QList<InputData>*) wParam);
					handled = true;
					break;
				case MSG_GET_ID:
					getID((uint*) wParam);
					handled = true;
					break;
				case MSG_GET_NAME:
					getName((QString*) wParam);
					handled = true;
					break;
				case MSG_GET_RESULTS:
					getResults((QList<InputData>*) wParam, (QList<CatItem>*) lParam);
					handled = true;
					break;
				case MSG_GET_CATALOG:
					getCatalog((QList<CatItem>*) wParam);
					handled = true;
					break;
				case MSG_LAUNCH_ITEM:
					launchItem((QList<InputData>*) wParam, (CatItem*) lParam);
					handled = true;
					break;
				case MSG_HAS_DIALOG:
					handled = true;
					break;
				case MSG_DO_DIALOG:
					doDialog((QWidget*) wParam, (QWidget**) lParam);
					break;
				case MSG_END_DIALOG:
					endDialog((bool) wParam);
					break;

				default:
					break;
			}
				
			return handled;
		}
		


Field Documentation

QSettings** PluginInterface::settings

The setting manager in which you store your persistent data.

More data can be found in QT's documentation for QSettings

Following is an example of using the settings variable:

	QSettings* set = *settings;

	// Write a value to the config file
	set->setValue("weby/version", 1.0);

	// Read a value from the config value
	double value = set->value("weby/version", 0.0);
	

Definition at line 559 of file plugin_interface.h.


The documentation for this class was generated from the following file:
Generated on Sat Jun 14 15:07:34 2008 for LaunchyPluginAPI by  doxygen 1.5.4