Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / common / QNetworkStubs.h
1 /*
2  * This file is part of QMAFW
3  *
4  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
5  * reserved.
6  *
7  * Contact: Visa Smolander <visa.smolander@nokia.com>
8  *
9  * This software, including documentation, is protected by copyright controlled
10  * by Nokia Corporation. All rights are reserved. Copying, including
11  * reproducing, storing, adapting or translating, any or all of this material
12  * requires the prior written consent of Nokia Corporation. This material also
13  * contains confidential information which may not be disclosed to others
14  * without the prior written consent of Nokia.
15  *
16  */
17
18 #ifndef QNETWORKSTUBS_H
19 #define QNETWORKSTUBS_H
20
21 #include <QObject>
22 #include <QtNetwork/QNetworkConfiguration>
23
24 class QNetworkConfigurationManager;
25
26 class NetworkStubHelper : public QObject
27 {
28     Q_OBJECT
29
30     static int networkConfigurationManagerInstances;
31
32     friend class QNetworkConfiguration;
33     friend class QNetworkConfigurationManager;
34 public:
35     static bool currentCreatedConfigIsValid;
36
37     void emitConfigurationChange(const QNetworkConfiguration &config,
38                                  QNetworkConfiguration::StateFlags confState)
39     {
40         m_currentConfState = confState;
41         Q_EMIT configurationChange(config);
42     }
43
44     void changeCurrentConfiguration(int id);
45
46 Q_SIGNALS:
47     void configurationChange(QNetworkConfiguration config);
48
49 private:
50     QNetworkConfiguration::StateFlags m_currentConfState;
51 };
52
53 #endif // QNETWORKSTUBS_H