summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/core/kmfprotocolusage.h
blob: 09d09a2e44ced5058b77255afb07f9b2dadd9854 (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
//
// C++ Interface: kmfprotocolusage
//
// Description: 
//
//
// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef KMFPROTOCOLUSAGE_H
#define KMFPROTOCOLUSAGE_H

#include "netfilterobject.h"

// QT includes
#include <tqstringlist.h>
#include <tqstring.h>
#include <tqguardedptr.h>
#include <tqptrlist.h>
#include <tqmap.h>
#include <tqobject.h>
// KDE includes
#include <kdemacros.h>
#include <kurl.h>

// Project includes
#include "kmfprotocol.h"

namespace KMF {
/**
	@author Christian Hubinger <chubinger@irrsinnig.org>
*/

class KMFProtocolUsage : public NetfilterObject {
	friend class KMFProtocol;
Q_OBJECT
  
public:
	
    ~KMFProtocolUsage();
    
    void setProtocol( KMFProtocol* );
    KMFProtocol *protocol() const {
    	return m_protocol;
    }
    
    virtual int type();
    virtual void clear();
    
    virtual const TQString& name();
    virtual const TQString& description();
    
    bool validUsage();
    
    void setLimitInterval( const TQString& );
	void setLimit( int );
	
	int limit() const {
		return m_limit;
	};

	const TQString& limitInterval() const {
		return m_limit_interval;
	};
	
	void setLogging( bool );
    bool logging() const {
		return m_log;
	};
	
	enum { OUTGOING, INCOMING } IO;
	void setIO ( int );
	int io() const {
		return m_io;
	};
	
	const TQDomDocument& getDOMTree();
	virtual void loadXML(const TQDomDocument&, TQStringList& errors );
	virtual void loadXML( TQDomNode, TQStringList& errors );

public slots:
	void slotOnProtocolDeleted( TQObject* protocol );

private: 
	KMFProtocolUsage( NetfilterObject* parent, const char* name );
	TQGuardedPtr<KMFProtocol> m_protocol;
	TQString m_limit_interval;
	int m_limit;
	int m_protocolType, m_io;
	bool m_log;
};
}
#endif