Added qmafw-gst-subtitles-renderer-0.0.55 for Meego Harmattan 1.2
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / unittests / ut_MafwMmcMonitor / ut_MafwMmcMonitorStubs.cpp
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 #include <gio/gio.h>
19 #include <QStringList>
20 #include <QDBusConnection>
21
22 QStringList stubMounts;
23
24 QStringList g_dbusConnectionParams;
25
26 // GVolumeMonitor
27
28 GVolumeMonitor *g_volume_monitor_get(void)
29 {
30     return (GVolumeMonitor*)1;
31 }
32
33 GList * g_volume_monitor_get_mounts(GVolumeMonitor *volume_monitor)
34 {
35     return (GList*)1;
36 }
37
38 // GObject
39
40 gulong   g_signal_connect_data                (gpointer           instance,
41                            const gchar   *detailed_signal,
42                            GCallback      c_handler,
43                            gpointer               data,
44                            GClosureNotify         destroy_data,
45                            GConnectFlags          connect_flags)
46 {
47     return 0;
48 }
49
50 void g_object_unref(gpointer object)
51 {
52 }
53
54 // GList
55
56 guint g_list_length(GList *list)
57 {
58     return stubMounts.size();
59 }
60
61 gpointer g_list_nth_data(GList *list, guint n)
62 {
63     return (void*)(n+1);
64 }
65
66 void g_list_free(GList *list)
67 {
68 }
69
70 // GMount
71
72 GFile * g_mount_get_root(GMount *mount)
73 {
74     return (GFile*)mount;
75 }
76
77 // GFile
78
79 char* g_file_get_uri(GFile *file)
80 {
81     return g_strdup(stubMounts[(int)file-1].toAscii().constData());
82 }
83
84
85 //QDBusConnection
86
87 QDBusConnection::QDBusConnection(const QString& /*name*/)
88 {
89 }
90
91 QDBusConnection QDBusConnection::sessionBus()
92 {
93     return QDBusConnection("...");
94 }
95
96 bool QDBusConnection::connect(const QString &service,
97                               const QString &path,
98                               const QString &interface,
99                               const QString &name,
100                               QObject *receiver,
101                               const char *slot)
102 {
103     g_dbusConnectionParams << service;
104     g_dbusConnectionParams << path;
105     g_dbusConnectionParams << interface;
106     g_dbusConnectionParams << name;
107     g_dbusConnectionParams << QString::number(reinterpret_cast<uint>(receiver));
108     g_dbusConnectionParams << slot;
109
110     return true;
111 }