summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/kmfwidgets/kmflistviewitem.h
blob: 14f10808d6e5c579fb6176f4b607b6ee68ec2e9b (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/***************************************************************************
 *                                                                         *
 *   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-2004
*/

#ifndef KMFLISTVIEWITEM_H
#define KMFLISTVIEWITEM_H

#include "kmflistview.h"

// QT includes
#include <tqstring.h>
#include <tquuid.h>
#include <tqguardedptr.h>

// KDE includes

// Project includes

/**
@author Christian Hubinger
*/

namespace KMF {
class IPTable;
class IPTChain;
class IPTRule;
class IPTRuleOption;
class NetfilterObject;
class KMFNetZone;
class KMFNetHost;
class KMFTarget;
class KMFProtocol;
class KMFProtocolCategory;

class KDE_EXPORT KMFListViewItem : public TDEListViewItem {
public:
	KMFListViewItem( TDEListView *parent, NetfilterObject* );
	KMFListViewItem( TDEListViewItem *parent, NetfilterObject* );
	KMFListViewItem( TDEListView *parent, TDEListViewItem *after, NetfilterObject* );
	KMFListViewItem( TDEListViewItem *parent, TDEListViewItem *after, NetfilterObject* );

	virtual ~KMFListViewItem();

	NetfilterObject* netfilterObject() const;

	IPTable* table()  const {
		return m_table;
	};
	IPTChain* chain() const {
		return m_chain;
	};
	IPTRule* rule() const {
		return m_rule;
	};
	IPTRuleOption* ruleOption() const {
		return m_option;
	};

	KMFNetZone* zone() const {
		return m_zone;
	};

	KMFNetHost* host() const {
		return m_host;
	};
	
	KMFTarget* target() const {
		return m_target;
	};
	
	KMFProtocol* protocol() const {
		return m_protocol;
	};
	
	KMFProtocolCategory* protocolCategory() const {
		return m_protocolCategory;
	};


	bool isTopItem() const {
		return m_top;
	};
	
	int type();

	const TQUuid& uuid() const {
		return m_obj_id;
	}

	void setupZoneView();
	void setupTargetView();
	void setupNetHostView();
	void setupProtocolView();
	void setupProtocolCategoryView();
	
	void deleteChildren();
	void setChildrenInUse( bool );
	void setTopItem( bool );
	void setInUse( bool );
	bool inUse();
	// enum { TABLE = 0, CHAIN = 1, RULE = 2, RULEOPTION = 3 , NETZONE = 4, NETHOST = 5,  KMFTARGET = 6 };

	void loadNetfilterObject( NetfilterObject* );
	virtual TQString key( int column, bool ascending ) const;

private:
/*	IPTable *m_table;
	IPTChain *m_chain;
	IPTRule *m_rule;
	IPTRuleOption *m_option;
	KMFNetZone* m_zone;
	KMFNetHost* m_host;
	KMFTarget* m_target;
	KMFProtocol* m_protocol;
	KMFProtocolCategory* m_protocolCategory;
	NetfilterObject* m_object;*/
	
	TQGuardedPtr<IPTable> m_table;
	TQGuardedPtr<IPTChain> m_chain;
	TQGuardedPtr<IPTRule> m_rule;
	TQGuardedPtr<IPTRuleOption> m_option;
	TQGuardedPtr<KMFNetZone> m_zone;
	TQGuardedPtr<KMFNetHost> m_host;
	TQGuardedPtr<KMFTarget> m_target;
	TQGuardedPtr<KMFProtocol>  m_protocol;
	TQGuardedPtr<KMFProtocolCategory> m_protocolCategory;
	TQGuardedPtr<NetfilterObject> m_object;

	
	// int m_type;
	TQUuid m_obj_id;
	bool m_top;
	bool m_inUse;
};
}
#endif