summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/ipteditor/kmfipteditorpart.h
blob: 29a9d85df1331d44e0f6e7c8838f4d87e3b66bb1 (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
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
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
/*
Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2001
*/

#ifndef _KMFIPTEDITORPART_H_
#define _KMFIPTEDITORPART_H_

#include <kparts/part.h>
#include <kparts/factory.h>

class TQWidget;
class TQPainter;
class KURL;
class KAction;
class KActionMenu;
class KInstance;
class KAboutData;

namespace KMF {
class KMFRuleEdit;
class KMFIPTDoc;
class KMFIPTDocOptions;

/**
 * This is a "Part".  It that does all the real work in a KPart
 * application.
 *
 * @short Main Part
 * @author Chris <chubinger@irrsinnig.org>
 * @version 0.1
 */
 
class KMFIPTEditorPart : public KParts::ReadWritePart
{
    Q_OBJECT
  TQ_OBJECT
public:
    /**
     * Default constructor
     */
    KMFIPTEditorPart(TQWidget *parentWidget, const char *widgetName,
                    TQObject *parent, const char *name);

    /**
     * Destructor
     */
    virtual ~KMFIPTEditorPart();

    /**
     * This is a virtual function inherited from KParts::ReadWritePart.
     * A shell will use this to inform this Part if it should act
     * read-only
     */
    virtual void setReadWrite(bool rw);

    /**
     * Reimplemented to disable and enable Save action
     */
    virtual void setModified(bool modified);

protected:
    /**
     * This must be implemented by each part
     */
    virtual bool openFile();

    /**
     * This must be implemented by each read-write part
     */
    virtual bool saveFile();

public slots:
	void slotEnableActions( bool );

protected slots:
    void fileOpen();
    void fileSaveAs();
	void slotEditChain();
	void slotNewChain();
	void slotDelChain();
	void slotNewRule();
	void slotDelRule();
	void slotEditDocOptions();
	void slotEditNetwork();
	
private:
    KMFRuleEdit *m_ruleedit;
	KMFIPTDoc* m_doc;
	KMFIPTDocOptions *m_editdoc;
	KAction* m_actionEditNetwork;
	KAction* m_actionEditChain;
	KAction* m_actionNewChain;
	KAction* m_actionNewRule;
	KAction* m_actionDelChain;
	KAction* m_actionDelRule;
	KAction* m_actionEditDocOptions;
};


class KMFIPTEditorPartFactory : public KParts::Factory
{
    Q_OBJECT
  TQ_OBJECT
public:
    KMFIPTEditorPartFactory();
    virtual ~KMFIPTEditorPartFactory();
    virtual KParts::Part* createPartObject( TQWidget *parentWidget, const char *widgetName,
                                            TQObject *parent, const char *name,
                                            const char *classname, const TQStringList &args );
    static KInstance* instance();

private:
    static KInstance* s_instance;
    static KAboutData* s_about;
};

}
#endif // _KMFRULEEDITPART_H_