class.h
1/***************************************************************************
2 * class.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_CLASS_H
21#define KROSS_API_CLASS_H
22
23#include <tqstring.h>
24//#include <tqvaluelist.h>
25//#include <tqmap.h>
26#include <tqobject.h>
27
28//#include "../main/krossconfig.h"
29#include "object.h"
30#include "event.h"
31#include "list.h"
32#include "exception.h"
33#include "variant.h"
34
35namespace Kross { namespace Api {
36
43 template<class T>
44 class Class : public Event<T>
45 {
46 public:
47
51 typedef TDESharedPtr<T> Ptr;
52
58 Class(const TQString& name)
59 : Event<T>(name)
60 {
61 }
62
66 virtual ~Class()
67 {
68 }
69
70 template<typename TYPE>
71 static Object::Ptr toObject(TYPE t) { return t; }
72
73 operator T* () { return (T*)this; }
74 //operator Ptr () { return (T*)this; }
75
76 /*
77 virtual Object::Ptr call(const TQString& name, List::Ptr arguments)
78 {
79 krossdebug( TQString("Class::call(%1)").arg(name) );
80 return Event<T>::call(name, arguments);
81 }
82 */
83
84 };
85
86}}
87
88#endif
89
From Event inherited template-class to represent class-structures.
Definition class.h:45
virtual ~Class()
Destructor.
Definition class.h:66
TDESharedPtr< T > Ptr
Shared pointer to implement reference-counting.
Definition class.h:51
Class(const TQString &name)
Constructor.
Definition class.h:58
Template class for all kinds of callable events.
Definition event.h:46
TDESharedPtr< Object > Ptr
Shared pointer to implement reference-counting.
Definition object.h:57
The Kross scripting bridge to embed scripting functionality into an application.
Definition callable.h:31