summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/objectdump.h
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-11-09 11:10:24 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-11-09 13:28:55 (GMT)
commitcc2d8068fea504483b2602128e2169b482feb308 (patch)
tree58a7d6e1e3b4ea4b047a7bcae268afe064e8b95f /src/3rdparty/phonon/mmf/objectdump.h
parent149e986ce129ccc656942d79fb1c9687dbe7958c (diff)
downloadQt-cc2d8068fea504483b2602128e2169b482feb308.zip
Qt-cc2d8068fea504483b2602128e2169b482feb308.tar.gz
Qt-cc2d8068fea504483b2602128e2169b482feb308.tar.bz2
Replace mmfphonondebug.lib with #ifndef QT_NO_DEBUG.
The debug{} directive in src/plugins/phonon/mmf/plugin/plugin.pro does not have any effect - this can be seen by looking at the generated MMP file, which has a STATICLIBRARY directive which is applied in both UDEB and UREL builds. This is the general problem that .pro files cannot tell distinction between the different targets that one makespec covers. Also remove objectdumpstub; objectdump was originally prepared for QtGui inclusion, but since that never happened, no other platforms than Symbian needs to be covered. Task-number: QTBUG-5466 Reviewed-by: Gareth Stockwell
Diffstat (limited to 'src/3rdparty/phonon/mmf/objectdump.h')
-rw-r--r--src/3rdparty/phonon/mmf/objectdump.h166
1 files changed, 166 insertions, 0 deletions
diff --git a/src/3rdparty/phonon/mmf/objectdump.h b/src/3rdparty/phonon/mmf/objectdump.h
new file mode 100644
index 0000000..e94b3ac
--- /dev/null
+++ b/src/3rdparty/phonon/mmf/objectdump.h
@@ -0,0 +1,166 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef OBJECTDUMP_H
+#define OBJECTDUMP_H
+
+#include "objectdump_global.h"
+
+#include <QObject>
+#include <QList>
+#include <QByteArray>
+#include <QScopedPointer>
+
+QT_BEGIN_NAMESPACE
+
+namespace ObjectDump
+{
+
+/**
+ * Abstract base for annotator classes invoked by QVisitor.
+ */
+class OBJECTDUMP_EXPORT QAnnotator : public QObject
+{
+ Q_OBJECT
+public:
+ virtual ~QAnnotator();
+ virtual QList<QByteArray> annotation(const QObject& object) = 0;
+};
+
+/**
+ * Annotator which replicates QObject::dumpObjectTree functionality.
+ */
+class OBJECTDUMP_EXPORT QAnnotatorBasic : public QAnnotator
+{
+ Q_OBJECT
+public:
+ QList<QByteArray> annotation(const QObject& object);
+};
+
+/**
+ * Annotator which returns widget information.
+ */
+class OBJECTDUMP_EXPORT QAnnotatorWidget : public QAnnotator
+{
+ Q_OBJECT
+public:
+ QList<QByteArray> annotation(const QObject& object);
+};
+
+
+class QDumperPrivate;
+
+/**
+ * Class used to dump information about individual QObjects.
+ */
+class OBJECTDUMP_EXPORT QDumper : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QDumper)
+
+public:
+ QDumper();
+ ~QDumper();
+
+ /**
+ * Specify a prefix, to be printed on each line of output.
+ */
+ void setPrefix(const QString& prefix);
+
+ /**
+ * Takes ownership of annotator.
+ */
+ void addAnnotator(QAnnotator* annotator);
+
+ /**
+ * Invoke each annotator on the object and write to debug output.
+ */
+ void dumpObject(const QObject& object);
+
+private:
+ QScopedPointer<QDumperPrivate> d_ptr;
+
+};
+
+
+class QVisitorPrivate;
+
+/**
+ * Visitor class which dumps information about nodes in the object tree.
+ */
+class OBJECTDUMP_EXPORT QVisitor : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QVisitor)
+
+public:
+ QVisitor();
+ ~QVisitor();
+
+ /**
+ * Specify a prefix, to be printed on each line of output.
+ */
+ void setPrefix(const QString& prefix);
+
+ /**
+ * Set number of spaces by which each level of the tree is indented.
+ */
+ void setIndent(unsigned indent);
+
+ /**
+ * Called by the visitor algorithm before starting the visit.
+ */
+ void visitPrepare();
+
+ /**
+ * Called by the visitor algorithm as each node is visited.
+ */
+ void visitNode(const QObject& object);
+
+ /**
+ * Called by the visitor algorithm when the visit is complete.
+ */
+ void visitComplete();
+
+ /**
+ * Takes ownership of annotator.
+ */
+ void addAnnotator(QAnnotator* annotator);
+
+private:
+ QScopedPointer<QVisitorPrivate> d_ptr;
+
+};
+
+
+//-----------------------------------------------------------------------------
+// Utility functions
+//-----------------------------------------------------------------------------
+
+void OBJECTDUMP_EXPORT addDefaultAnnotators(QDumper& dumper);
+void OBJECTDUMP_EXPORT addDefaultAnnotators(QVisitor& visitor);
+
+void OBJECTDUMP_EXPORT dumpTreeFromRoot(const QObject& root, QVisitor& visitor);
+void OBJECTDUMP_EXPORT dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor);
+void OBJECTDUMP_EXPORT dumpAncestors(const QObject& leaf, QVisitor& visitor);
+
+} // namespace ObjectDump
+
+QT_END_NAMESPACE
+
+#endif