lib

eventslot.h
1/***************************************************************************
2 * eventslot.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. 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 KROSS_API_EVENTSLOT_H
21#define KROSS_API_EVENTSLOT_H
22
23#include <tqstring.h>
24#include <tqobject.h>
25#include <ksharedptr.h>
26
27#include "event.h"
28
29namespace Kross { namespace Api {
30
36 class EventSlot : public Event<EventSlot>
37 {
38 public:
39
43 typedef TDESharedPtr<EventSlot> Ptr;
44
55 EventSlot(const TQString& name, TQObject* receiver, TQCString slot);
56
60 virtual ~EventSlot();
61
63 virtual const TQString getClassName() const;
64
66 virtual Object::Ptr call(const TQString& name, TDESharedPtr<List> arguments);
67
68/*
69 private:
70 EventManager* m_eventmanager;
71 TQGuardedPtr<TQObject> m_sender;
72 TQCString m_signal;
73 TQCString m_slot;
74 TQString m_function;
75 TQValueList<EventSlot*> m_slots;
76 protected:
77 void call(const TQVariant&);
78 public slots:
79 // Stupid signals and slots. To get the passed
80 // arguments we need to have all cases of slots
81 // avaiable for EventManager::connect() signals.
82 void callback();
83 void callback(short);
84 void callback(int);
85 void callback(int, int);
86 void callback(int, int, int);
87 void callback(int, int, int, int);
88 void callback(int, int, int, int, int);
89 void callback(int, int, int, int, bool);
90 void callback(int, bool);
91 void callback(int, int, bool);
92 void callback(int, int, const TQString&);
93 void callback(uint);
94 void callback(long);
95 void callback(ulong);
96 void callback(double);
97 void callback(const char*);
98 void callback(bool);
99 void callback(const TQString&);
100 void callback(const TQString&, int);
101 void callback(const TQString&, int, int);
102 void callback(const TQString&, uint);
103 void callback(const TQString&, bool);
104 void callback(const TQString&, bool, bool);
105 void callback(const TQString&, bool, int);
106 void callback(const TQString&, const TQString&);
107 void callback(const TQString&, const TQString&, const TQString&);
108 void callback(const TQStringList&);
109 void callback(const TQVariant&);
110 // The following both slots are more generic to
111 // handle Kross::Api::Object instances.
112 //void callback(Kross::Api::Object*);
113 //void callback(Kross::Api::List*);
114*/
115 private:
116 TQObject* m_receiver;
117 TQCString m_slot;
118 };
119
120}}
121
122#endif
123
virtual ~EventSlot()
Destructor.
Definition eventslot.cpp:37
virtual const TQString getClassName() const
Definition eventslot.cpp:41
TDESharedPtr< EventSlot > Ptr
Shared pointer to implement reference-counting.
Definition eventslot.h:43
virtual Object::Ptr call(const TQString &name, TDESharedPtr< List > arguments)
Definition eventslot.cpp:46
EventSlot(const TQString &name, TQObject *receiver, TQCString slot)
Constructor.
Definition eventslot.cpp:30
Event(const TQString &name)
Definition event.h:67
TDESharedPtr< Object > Ptr
Shared pointer to implement reference-counting.
Definition object.h:57
The common Kross API used as common codebase.
Definition callable.h:31
The Kross scripting bridge to embed scripting functionality into an application.
Definition callable.h:31