* Added an implicit type conversion operator so that a PlasmaScripting.Applet
[kdebindings.git] / ruby / krossruby / rubyobject.h
blobf34d46ce3bfb746dd67f967591578494fee09cb7
1 /***************************************************************************
2 * rubyobject.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
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 ***************************************************************************/
20 #ifndef KROSS_RUBY_OBJECT_H
21 #define KROSS_RUBY_OBJECT_H
23 #include "rubyconfig.h"
24 #include <kross/core/object.h>
26 #include <QString>
27 #include <QStringList>
29 namespace Kross {
31 /**
32 * The RubyObject class is used for Instances of Ruby
33 * Classes by the \a RubyExtension class.
35 class RubyObject : public Kross::Object
37 public:
39 /**
40 * Default constructor.
42 explicit RubyObject();
44 /**
45 * Constructor.
47 * \param object The Py::Object this \a RubyObject
48 * provides access to.
50 explicit RubyObject(const VALUE& object);
52 /**
53 * Destructor.
55 virtual ~RubyObject();
57 /**
58 * Pass a call to the object. Objects like \a Class
59 * are able to handle call's by just implementating
60 * this function.
62 * \param name Each call has a name that says what
63 * should be called. In the case of a \a Class
64 * the name is the functionname.
65 * \param args The list of arguments passed to
66 * the call.
67 * \return The call-result as QVariant
69 virtual QVariant callMethod(const QString& name,
70 const QVariantList& args = QVariantList());
72 /**
73 * Return a list of supported callable objects.
75 * \return List of supported calls.
77 virtual QStringList methodNames();
79 /**
80 * Return ruby object used in this object.
82 * \return ruby object.
84 VALUE rbObject();
86 private:
87 /// Private d-pointer class.
88 class Private;
89 Private* const d;
93 #endif