lib

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 "object.h"
29#include "event.h"
30#include "list.h"
31#include "exception.h"
32#include "variant.h"
33
34namespace Kross { namespace Api {
35
42 template<class T>
43 class Class : public Event<T>
44 {
45 public:
46
50 typedef TDESharedPtr<T> Ptr;
51
57 Class(const TQString& name)
58 : Event<T>(name)
59 {
60 }
61
65 virtual ~Class()
66 {
67 }
68
69 template<typename TYPE>
70 static Object::Ptr toObject(TYPE t) { return t; }
71
72 operator T* () { return (T*)this; }
73 //operator Ptr () { return (T*)this; }
74
75 /*
76 virtual Object::Ptr call(const TQString& name, List::Ptr arguments)
77 {
78 krossdebug( TQString("Class::call(%1)").arg(name) );
79 return Event<T>::call(name, arguments);
80 }
81 */
82
83 };
84
85}}
86
87#endif
88
virtual ~Class()
Destructor.
Definition class.h:65
TDESharedPtr< T > Ptr
Shared pointer to implement reference-counting.
Definition class.h:50
Class(const TQString &name)
Constructor.
Definition class.h:57
Event(const TQString &name)
Constructor.
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