Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / common / QNetworkStubs.h
diff --git a/qmafw-gst-subtitles-renderer/unittests/common/QNetworkStubs.h b/qmafw-gst-subtitles-renderer/unittests/common/QNetworkStubs.h
new file mode 100644 (file)
index 0000000..4c31744
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * This file is part of QMAFW
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+ * reserved.
+ *
+ * Contact: Visa Smolander <visa.smolander@nokia.com>
+ *
+ * This software, including documentation, is protected by copyright controlled
+ * by Nokia Corporation. All rights are reserved. Copying, including
+ * reproducing, storing, adapting or translating, any or all of this material
+ * requires the prior written consent of Nokia Corporation. This material also
+ * contains confidential information which may not be disclosed to others
+ * without the prior written consent of Nokia.
+ *
+ */
+
+#ifndef QNETWORKSTUBS_H
+#define QNETWORKSTUBS_H
+
+#include <QObject>
+#include <QtNetwork/QNetworkConfiguration>
+
+class QNetworkConfigurationManager;
+
+class NetworkStubHelper : public QObject
+{
+    Q_OBJECT
+
+    static int networkConfigurationManagerInstances;
+
+    friend class QNetworkConfiguration;
+    friend class QNetworkConfigurationManager;
+public:
+    static bool currentCreatedConfigIsValid;
+
+    void emitConfigurationChange(const QNetworkConfiguration &config,
+                                 QNetworkConfiguration::StateFlags confState)
+    {
+        m_currentConfState = confState;
+        Q_EMIT configurationChange(config);
+    }
+
+    void changeCurrentConfiguration(int id);
+
+Q_SIGNALS:
+    void configurationChange(QNetworkConfiguration config);
+
+private:
+    QNetworkConfiguration::StateFlags m_currentConfState;
+};
+
+#endif // QNETWORKSTUBS_H