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 "koffice_export.h"
24
25#include <tqstring.h>
26#include <tqobject.h>
27#include <ksharedptr.h>
28
29#include "event.h"
30
31namespace Kross { namespace Api {
32
38 class KOFFICE_EXPORT EventSlot : public Event<EventSlot>
39 {
40 public:
41
45 typedef TDESharedPtr<EventSlot> Ptr;
46
57 EventSlot(const TQString& name, TQObject* receiver, TQCString slot);
58
62 virtual ~EventSlot();
63
65 virtual const TQString getClassName() const;
66
68 virtual Object::Ptr call(const TQString& name, TDESharedPtr<List> arguments);
69
70/*
71 private:
72 EventManager* m_eventmanager;
73 TQGuardedPtr<TQObject> m_sender;
74 TQCString m_signal;
75 TQCString m_slot;
76 TQString m_function;
77 TQValueList<EventSlot*> m_slots;
78 protected:
79 void call(const TQVariant&);
80 public slots:
81 // Stupid signals and slots. To get the passed
82 // arguments we need to have all cases of slots
83 // avaiable for EventManager::connect() signals.
84 void callback();
85 void callback(short);
86 void callback(int);
87 void callback(int, int);
88 void callback(int, int, int);
89 void callback(int, int, int, int);
90 void callback(int, int, int, int, int);
91 void callback(int, int, int, int, bool);
92 void callback(int, bool);
93 void callback(int, int, bool);
94 void callback(int, int, const TQString&);
95 void callback(uint);
96 void callback(long);
97 void callback(ulong);
98 void callback(double);
99 void callback(const char*);
100 void callback(bool);
101 void callback(const TQString&);
102 void callback(const TQString&, int);
103 void callback(const TQString&, int, int);
104 void callback(const TQString&, uint);
105 void callback(const TQString&, bool);
106 void callback(const TQString&, bool, bool);
107 void callback(const TQString&, bool, int);
108 void callback(const TQString&, const TQString&);
109 void callback(const TQString&, const TQString&, const TQString&);
110 void callback(const TQStringList&);
111 void callback(const TQVariant&);
112 // The following both slots are more generic to
113 // handle Kross::Api::Object instances.
114 //void callback(Kross::Api::Object*);
115 //void callback(Kross::Api::List*);
116*/
117 private:
118 TQObject* m_receiver;
119 TQCString m_slot;
120 };
121
122}}
123
124#endif
125
virtual const TQString getClassName() const
Definition eventslot.cpp:41
TDESharedPtr< EventSlot > Ptr
Shared pointer to implement reference-counting.
Definition eventslot.h:45
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:68
TDESharedPtr< Object > Ptr
Shared pointer to implement reference-counting.
Definition object.h:56
The common Kross API used as common codebase.
Definition callable.h:33
The Kross scripting bridge to embed scripting functionality into an application.
Definition callable.h:33