summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/ruleoptionplugins/README
blob: 67f89452f81a0415fde06cc2ff5a303721c5c7fb (plain)
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
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 QT'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