You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kmyfirewall/kmyfirewall/ruleoptionplugins/README

76 lines
2.1 KiB

Writing Rule Option Plugins for KMyFirewall
-----------------------------------
Abstract
--------
As the netfilter/iptables suite grwos quite fast (every few releases there are
more ruleoptions added) all rule option handling (logig & GUI) is located in
small plugins that get loaded at startup and made available thorough the gui.
This way it's possible for others to easily extend KMyFirewall and help to keep
the Application up to date with iptables. I hope that this will help to make
KMF an even better tool then it allready is.
Creating KMF Rule Option Plugins
--------------------------------
A Plugin consists of the following different parts.
*) The Widget for editing the Option
*) A class derived from KMFPlugin that defines the ServiceType
KMFyFirewall/RuleOptionEdit or KMFyFirewall/RuleTargetOptionEdit
*) A XML file describing the option so that the correct iptables commands can
be genereated
Writing the Edit widget
-----------------------
This class is simply a Widget that has the following methods/slots/signals defined
public:
void loadRule( IPTRule * );
public slots:
void accept();
void reject();
void slotHelp();
signals:
void sigAddRuleOpt( TQString*, QPtrList<TQString>* );
void sigAddTargetOpt( TQString *, QPtrList<TQString> * );
void sigDocumentChanged();
void sigHideMe();
It's up to you if design the widget with TQt's designer or if you write. It's just importent that you
implement the needed methods properly in order to make the Editor work as expected.
The signals emited by the widget will be conneted to the KMFRuleEdit window.
Have a look at the allready available plugins to find out thow to implement those methods in detail.
FIXME: More explainaitions here
Writing the KMFPlugin class
---------------------------
This class is compiled to an loadable modules using KDE's KParts technology. There fore it is important
to make shure that the corresponding *.desktop file is written properly. Otherwise the plugin won't be found by the application as the name of the loaddable library is taken from the desktop file.
The Plugin class should be named KMFRuleOptionEditOptionName or KMFRuleTargetOptionEditOptionName