events.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KFORMDESIGNEREVENTS_H
21#define KFORMDESIGNEREVENTS_H
22
23#include <tqptrlist.h>
24#include <tqstring.h>
25
26class TQDomNode;
27
28namespace KFormDesigner {
29
30class KFORMEDITOR_EXPORT Connection
31{
32 public:
33 Connection(const TQString &sender, const TQString &signal,
34 const TQString &receiver, const TQString &slot);
35 Connection() {;}
36 ~Connection() {;}
37
38 TQString sender() const { return m_sender; }
39 TQString receiver() const { return m_receiver; }
40 TQString signal() const { return m_signal; }
41 TQString slot() const { return m_slot; }
42
43 void setSender(const TQString &v) { m_sender = v; }
44 void setReceiver(const TQString &v) { m_receiver = v; }
45 void setSignal(const TQString &v) { m_signal = v; }
46 void setSlot(const TQString &v) { m_slot = v; }
47
48 protected:
49 TQString m_sender;
50 TQString m_signal;
51 TQString m_receiver;
52 TQString m_slot;
53};
54
55typedef TQPtrList<Connection> ConnectionList;
56
57class KFORMEDITOR_EXPORT ConnectionBuffer : public ConnectionList
58{
59 public:
60 ConnectionBuffer();
61 ~ConnectionBuffer() {;}
62
63 void save(TQDomNode &parentNode);
64 void load(TQDomNode parentNode);
65
68 void fixName(const TQString &oldname, const TQString &newName);
69
70 ConnectionBuffer* allConnectionsForWidget(const TQString &widget);
71 void saveAllConnectionsForWidget(const TQString &widget, TQDomNode parentNode);
72 void removeAllConnectionsForWidget(const TQString &widget);
73};
74
75}
76
77#endif
78
type * findParent(TQObject *o, const char *className, TQObject *&prevPrev)