KTutorial  0.5.1
ClassRegisterAdaptor.h
00001 /***************************************************************************
00002  *   Copyright (C) 2010 by Daniel Calviño Sánchez <danxuliu@gmail.com>     *
00003  *   Copyright (C) 2011 by Daniel Calviño Sánchez <danxuliu@gmail.com>     *
00004  *   Copyright (C) 2012 by Daniel Calviño Sánchez <danxuliu@gmail.com>     *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  *   This program is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU General Public License for more details.                          *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this program; If not, see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 
00020 #ifndef KTUTORIAL_EDITORSUPPORT_CLASSREGISTERADAPTOR_H
00021 #define KTUTORIAL_EDITORSUPPORT_CLASSREGISTERADAPTOR_H
00022 
00023 #include <QDBusAbstractAdaptor>
00024 #include <QStringList>
00025 
00026 namespace ktutorial {
00027 namespace editorsupport {
00028 class ObjectRegister;
00029 }
00030 }
00031 
00032 namespace ktutorial {
00033 namespace editorsupport {
00034 
00041 class ClassRegisterAdaptor: public QDBusAbstractAdaptor {
00042 Q_OBJECT
00043 Q_CLASSINFO("D-Bus Interface", "org.kde.ktutorial.ClassRegister")
00044 public:
00045 
00051     explicit ClassRegisterAdaptor(ObjectRegister* objectRegister);
00052 
00053 public Q_SLOTS:
00054 
00063     QString superClass(const QString& className) const;
00064 
00075     QStringList propertyList(const QString& className) const;
00076 
00087     QStringList signalList(const QString& className) const;
00088 
00089 private:
00090 
00094     ObjectRegister* mObjectRegister;
00095 
00107     bool isPropertyDefinedInClass(const QMetaProperty& metaProperty,
00108                                   const QMetaObject* metaObject) const;
00109 
00121     bool isSignalDefinedInClass(const QMetaMethod& metaMethod,
00122                                 const QMetaObject* metaObject) const;
00123 
00124 };
00125 
00126 }
00127 }
00128 
00129 #endif