Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
T
telepathy-ofono
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Librem5
Plasma
telepathy-ofono
Commits
bd274d07
Commit
bd274d07
authored
Feb 06, 2019
by
Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New upstream version 0.2.20161109
parent
61b9eef3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
141 changed files
with
15959 additions
and
864 deletions
+15959
-864
CMakeLists.txt
CMakeLists.txt
+125
-0
COPYING.LGPL
COPYING.LGPL
+165
-0
audiooutputsiface.cpp
audiooutputsiface.cpp
+167
-0
audiooutputsiface.h
audiooutputsiface.h
+148
-0
EnableCoverageReport.cmake
cmake/modules/EnableCoverageReport.cmake
+153
-0
FindLcov.cmake
cmake/modules/FindLcov.cmake
+29
-0
FindLibPhoneNumber.cmake
cmake/modules/FindLibPhoneNumber.cmake
+23
-0
Findgcovr.cmake
cmake/modules/Findgcovr.cmake
+31
-0
LibFindMacros.cmake
cmake/modules/LibFindMacros.cmake
+112
-0
ParseArguments.cmake
cmake/modules/ParseArguments.cmake
+52
-0
connection.cpp
connection.cpp
+1383
-0
connection.h
connection.h
+197
-0
countrycodes.qrc
countrycodes.qrc
+5
-0
countrycodes.txt
countrycodes.txt
+224
-0
dbustypes.h
dbustypes.h
+65
-0
.gitlab-ci.yml
debian/.gitlab-ci.yml
+0
-3
changelog
debian/changelog
+0
-649
compat
debian/compat
+0
-1
control
debian/control
+0
-42
copyright
debian/copyright
+0
-146
rules
debian/rules
+0
-18
format
debian/source/format
+0
-1
telepathy-ofono-ril-mc-plugin.install
debian/telepathy-ofono-ril-mc-plugin.install
+0
-1
telepathy-ofono.install
debian/telepathy-ofono.install
+0
-3
emergencymodeiface.cpp
emergencymodeiface.cpp
+163
-0
emergencymodeiface.h
emergencymodeiface.h
+133
-0
main.cpp
main.cpp
+42
-0
CMakeLists.txt
mc-plugin/CMakeLists.txt
+21
-0
mcp-account-manager-ofono.c
mc-plugin/mcp-account-manager-ofono.c
+346
-0
mcp-account-manager-ofono.h
mc-plugin/mcp-account-manager-ofono.h
+49
-0
mission-control-plugin.c
mc-plugin/mission-control-plugin.c
+39
-0
mmsdmanager.cpp
mmsdmanager.cpp
+99
-0
mmsdmanager.h
mmsdmanager.h
+48
-0
mmsdmessage.cpp
mmsdmessage.cpp
+71
-0
mmsdmessage.h
mmsdmessage.h
+51
-0
mmsdservice.cpp
mmsdservice.cpp
+142
-0
mmsdservice.h
mmsdservice.h
+59
-0
mmsgroupcache.cpp
mmsgroupcache.cpp
+146
-0
mmsgroupcache.h
mmsgroupcache.h
+44
-0
ofono.manager
ofono.manager
+13
-0
ofono.service.in
ofono.service.in
+3
-0
ofonocallchannel.cpp
ofonocallchannel.cpp
+381
-0
ofonocallchannel.h
ofonocallchannel.h
+98
-0
ofonoconferencecallchannel.cpp
ofonoconferencecallchannel.cpp
+304
-0
ofonoconferencecallchannel.h
ofonoconferencecallchannel.h
+83
-0
ofonotextchannel.cpp
ofonotextchannel.cpp
+518
-0
ofonotextchannel.h
ofonotextchannel.h
+84
-0
pendingmessagesmanager.cpp
pendingmessagesmanager.cpp
+90
-0
pendingmessagesmanager.h
pendingmessagesmanager.h
+41
-0
phoneutils.cpp
phoneutils.cpp
+134
-0
phoneutils_p.h
phoneutils_p.h
+51
-0
powerd.h
powerd.h
+34
-0
powerdaudiomodemediator.cpp
powerdaudiomodemediator.cpp
+63
-0
powerdaudiomodemediator.h
powerdaudiomodemediator.h
+46
-0
powerddbus.cpp
powerddbus.cpp
+43
-0
powerddbus.h
powerddbus.h
+38
-0
protocol.cpp
protocol.cpp
+60
-0
protocol.h
protocol.h
+45
-0
qpulseaudioengine.cpp
qpulseaudioengine.cpp
+800
-0
qpulseaudioengine.h
qpulseaudioengine.h
+124
-0
CMakeLists.txt
schema/CMakeLists.txt
+16
-0
update_schema.sh
schema/update_schema.sh
+25
-0
v1.sql
schema/v1.sql
+9
-0
v2.sql
schema/v2.sql
+10
-0
sqlitedatabase.cpp
sqlitedatabase.cpp
+237
-0
sqlitedatabase.h
sqlitedatabase.h
+53
-0
CMakeLists.txt
tests/CMakeLists.txt
+51
-0
CallTest.cpp
tests/CallTest.cpp
+544
-0
ConnectionTest.cpp
tests/ConnectionTest.cpp
+120
-0
MessagesTest.cpp
tests/MessagesTest.cpp
+190
-0
PhoneUtilsTest.cpp
tests/PhoneUtilsTest.cpp
+96
-0
ProtocolTest.cpp
tests/ProtocolTest.cpp
+49
-0
approvercall.cpp
tests/approvercall.cpp
+141
-0
approvercall.h
tests/approvercall.h
+59
-0
approvertext.cpp
tests/approvertext.cpp
+90
-0
approvertext.h
tests/approvertext.h
+50
-0
dbus-test-wrapper.sh.in
tests/dbus-test-wrapper.sh.in
+39
-0
handler.cpp
tests/handler.cpp
+146
-0
handler.h
tests/handler.h
+61
-0
CMakeLists.txt
tests/mock/CMakeLists.txt
+44
-0
CallVolumePrivate.xml
tests/mock/CallVolumePrivate.xml
+17
-0
MessageManagerPrivate.xml
tests/mock/MessageManagerPrivate.xml
+51
-0
MessagePrivate.xml
tests/mock/MessagePrivate.xml
+23
-0
ModemPrivate.xml
tests/mock/ModemPrivate.xml
+20
-0
NetworkRegistrationPrivate.xml
tests/mock/NetworkRegistrationPrivate.xml
+17
-0
SimManagerPrivate.xml
tests/mock/SimManagerPrivate.xml
+17
-0
VoiceCallManagerPrivate.xml
tests/mock/VoiceCallManagerPrivate.xml
+56
-0
VoiceCallPrivate.xml
tests/mock/VoiceCallPrivate.xml
+25
-0
callvolumeprivate.cpp
tests/mock/callvolumeprivate.cpp
+50
-0
callvolumeprivate.h
tests/mock/callvolumeprivate.h
+43
-0
libofono-qt_global.h
tests/mock/libofono-qt_global.h
+35
-0
messagemanagerprivate.cpp
tests/mock/messagemanagerprivate.cpp
+91
-0
messagemanagerprivate.h
tests/mock/messagemanagerprivate.h
+56
-0
messageprivate.cpp
tests/mock/messageprivate.cpp
+67
-0
messageprivate.h
tests/mock/messageprivate.h
+44
-0
mock_common.h
tests/mock/mock_common.h
+6
-0
modemprivate.cpp
tests/mock/modemprivate.cpp
+67
-0
modemprivate.h
tests/mock/modemprivate.h
+45
-0
networkregistrationprivate.cpp
tests/mock/networkregistrationprivate.cpp
+46
-0
networkregistrationprivate.h
tests/mock/networkregistrationprivate.h
+42
-0
ofonocallvolume.cpp
tests/mock/ofonocallvolume.cpp
+101
-0
ofonocallvolume.h
tests/mock/ofonocallvolume.h
+72
-0
ofonointerface.cpp
tests/mock/ofonointerface.cpp
+208
-0
ofonointerface.h
tests/mock/ofonointerface.h
+153
-0
ofonomessage.cpp
tests/mock/ofonomessage.cpp
+92
-0
ofonomessage.h
tests/mock/ofonomessage.h
+88
-0
ofonomessagemanager.cpp
tests/mock/ofonomessagemanager.cpp
+263
-0
ofonomessagemanager.h
tests/mock/ofonomessagemanager.h
+108
-0
ofonomessagewaiting.cpp
tests/mock/ofonomessagewaiting.cpp
+81
-0
ofonomessagewaiting.h
tests/mock/ofonomessagewaiting.h
+66
-0
ofonomodem.cpp
tests/mock/ofonomodem.cpp
+241
-0
ofonomodem.h
tests/mock/ofonomodem.h
+169
-0
ofonomodeminterface.cpp
tests/mock/ofonomodeminterface.cpp
+95
-0
ofonomodeminterface.h
tests/mock/ofonomodeminterface.h
+116
-0
ofonomodemmanager.cpp
tests/mock/ofonomodemmanager.cpp
+25
-0
ofonomodemmanager.h
tests/mock/ofonomodemmanager.h
+62
-0
ofononetworkregistration.cpp
tests/mock/ofononetworkregistration.cpp
+228
-0
ofononetworkregistration.h
tests/mock/ofononetworkregistration.h
+112
-0
ofonopropertysetting.h
tests/mock/ofonopropertysetting.h
+36
-0
ofonosimmanager.cpp
tests/mock/ofonosimmanager.cpp
+313
-0
ofonosimmanager.h
tests/mock/ofonosimmanager.h
+134
-0
ofonovoicecall.cpp
tests/mock/ofonovoicecall.cpp
+252
-0
ofonovoicecall.h
tests/mock/ofonovoicecall.h
+131
-0
ofonovoicecallmanager.cpp
tests/mock/ofonovoicecallmanager.cpp
+425
-0
ofonovoicecallmanager.h
tests/mock/ofonovoicecallmanager.h
+128
-0
simmanagerprivate.cpp
tests/mock/simmanagerprivate.cpp
+46
-0
simmanagerprivate.h
tests/mock/simmanagerprivate.h
+42
-0
voicecallmanagerprivate.cpp
tests/mock/voicecallmanagerprivate.cpp
+197
-0
voicecallmanagerprivate.h
tests/mock/voicecallmanagerprivate.h
+61
-0
voicecallprivate.cpp
tests/mock/voicecallprivate.cpp
+100
-0
voicecallprivate.h
tests/mock/voicecallprivate.h
+48
-0
ofonomockcontroller.cpp
tests/ofonomockcontroller.cpp
+135
-0
ofonomockcontroller.h
tests/ofonomockcontroller.h
+69
-0
telepathyhelper.cpp
tests/telepathyhelper.cpp
+289
-0
telepathyhelper.h
tests/telepathyhelper.h
+94
-0
generate_country_codes.py
tools/generate_country_codes.py
+23
-0
update_qrc.sh
update_qrc.sh
+19
-0
ussdiface.cpp
ussdiface.cpp
+311
-0
ussdiface.h
ussdiface.h
+243
-0
voicemailiface.cpp
voicemailiface.cpp
+201
-0
voicemailiface.h
voicemailiface.h
+149
-0
No files found.
CMakeLists.txt
0 → 100644
View file @
bd274d07
project
(
telepathy-ofono
)
cmake_minimum_required
(
VERSION 2.8
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/modules
)
set
(
TELEPATHY_OFONO telepathy-ofono
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
# Find includes in corresponding build directories
set
(
CMAKE_INCLUDE_CURRENT_DIR ON
)
# Standard install paths
include
(
GNUInstallDirs
)
# Check for include files
include
(
CheckIncludeFileCXX
)
include
(
EnableCoverageReport
)
#####################################################################
# Enable code coverage calculation with gcov/gcovr/lcov
# Usage:
# * Switch build type to coverage (use ccmake or cmake-gui)
# * Invoke make, make test, make coverage
# * Find html report in subdir coveragereport
# * Find xml report feasible for jenkins in coverage.xml
#####################################################################
IF
(
CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-ftest-coverage -fprofile-arcs"
)
SET
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-ftest-coverage -fprofile-arcs"
)
SET
(
CMAKE_MODULE_LINKER_FLAGS
"
${
CMAKE_MODULE_LINKER_FLAGS
}
-coverage"
)
SET
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-coverage"
)
ENABLE_COVERAGE_REPORT
(
TARGETS
${
TELEPATHY_OFONO
}
)
ENDIF
(
CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]
)
find_package
(
LibPhoneNumber REQUIRED
)
find_package
(
Qt5Core
)
find_package
(
Qt5DBus
)
find_package
(
Qt5Network
)
add_definitions
(
-DQT_NO_KEYWORDS
)
find_package
(
PkgConfig REQUIRED
)
pkg_check_modules
(
TP_QT5 REQUIRED TelepathyQt5
)
pkg_check_modules
(
SQLITE3 REQUIRED sqlite3
)
pkg_check_modules
(
MC_PLUGINS REQUIRED mission-control-plugins
)
pkg_check_modules
(
PULSEAUDIO libpulse
)
if
(
PULSEAUDIO_FOUND
)
add_definitions
(
-DUSE_PULSEAUDIO
)
set
(
USE_PULSEAUDIO ON
)
include_directories
(
${
PULSEAUDIO_INCLUDE_DIRS
}
)
endif
(
PULSEAUDIO_FOUND
)
find_program
(
DBUS_RUNNER dbus-test-runner
)
if
(
NOT DAEMON_DIR
)
set
(
DAEMON_DIR lib/telepathy
)
endif
(
NOT DAEMON_DIR
)
set
(
CMAKE_AUTOMOC ON
)
include_directories
(
${
TP_QT5_INCLUDE_DIRS
}
)
include_directories
(
${
Qt5Core_INCLUDE_DIRS
}
)
include_directories
(
${
Qt5DBus_INCLUDE_DIRS
}
)
include_directories
(
${
SQLITE3_INCLUDE_DIRS
}
)
include_directories
(
${
LibPhoneNumber_INCLUDE_DIRS
}
)
include_directories
(
/usr/include/telepathy-qt5/
)
include_directories
(
/usr/include/ofono-qt/
)
find_library
(
TELEPATHY_QT5_LIBRARIES telepathy-qt5
)
find_library
(
TELEPATHY_QT5_SERVICE_LIBRARIES telepathy-qt5-service
)
find_library
(
OFONO_QT_LIBRARIES ofono-qt
)
qt5_add_resources
(
telepathyfono_RES sqlitetelepathyofono.qrc countrycodes.qrc
)
# update the .qrc file automatically when there are new schema files
file
(
GLOB QRC_RESOURCE_FILES
${
CMAKE_CURRENT_SOURCE_DIR
}
/schema/*.sql
${
CMAKE_CURRENT_SOURCE_DIR
}
/schema/*.info
)
set
(
QRC_FILE
${
CMAKE_CURRENT_SOURCE_DIR
}
/sqlitetelepathyofono.qrc
)
add_custom_command
(
OUTPUT
${
QRC_FILE
}
COMMAND
${
CMAKE_CURRENT_SOURCE_DIR
}
/update_qrc.sh
${
QRC_FILE
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
DEPENDS
${
QRC_RESOURCE_FILES
}
)
add_custom_target
(
qrc_update DEPENDS
${
QRC_FILE
}
schema_update
)
set
(
TELEPATHY_OFONO_SRC
main.cpp
protocol.cpp
connection.cpp
ofonotextchannel.cpp
ofonocallchannel.cpp
ofonoconferencecallchannel.cpp
emergencymodeiface.cpp
voicemailiface.cpp
audiooutputsiface.cpp
mmsdmanager.cpp
mmsdservice.cpp
mmsdmessage.cpp
mmsgroupcache.cpp
pendingmessagesmanager.cpp
phoneutils.cpp
powerdaudiomodemediator.cpp
powerddbus.cpp
sqlitedatabase.cpp
ussdiface.cpp
${
telepathyfono_RES
}
)
if
(
USE_PULSEAUDIO
)
add_executable
(
${
TELEPATHY_OFONO
}
qpulseaudioengine.cpp
${
TELEPATHY_OFONO_SRC
}
)
else
(
USE_PULSEAUDIO
)
add_executable
(
${
TELEPATHY_OFONO
}
${
TELEPATHY_OFONO_SRC
}
)
endif
(
USE_PULSEAUDIO
)
qt5_use_modules
(
${
TELEPATHY_OFONO
}
Core DBus Sql
)
add_dependencies
(
${
TELEPATHY_OFONO
}
schema_update qrc_update
)
enable_testing
()
target_link_libraries
(
${
TELEPATHY_OFONO
}
${
Qt5Core_LIBRARIES
}
${
Qt5DBus_LIBRARIES
}
${
WAUDIO_LIBRARIES
}
-ltelepathy-qt5
${
TELEPATHY_QT5_SERVICE_LIBRARIES
}
${
Qt5Network_LIBRARIES
}
${
OFONO_QT_LIBRARIES
}
${
PULSEAUDIO_LIBRARIES
}
${
SQLITE3_LIBRARIES
}
${
LibPhoneNumber_LIBRARIES
}
)
install
(
TARGETS
${
TELEPATHY_OFONO
}
DESTINATION
${
DAEMON_DIR
}
)
configure_file
(
ofono.service.in org.freedesktop.Telepathy.ConnectionManager.ofono.service
)
install
(
FILES ofono.manager DESTINATION share/telepathy/managers
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/org.freedesktop.Telepathy.ConnectionManager.ofono.service DESTINATION share/dbus-1/services
)
add_subdirectory
(
schema
)
add_subdirectory
(
tests
)
add_subdirectory
(
mc-plugin
)
COPYING.LGPL
0 → 100644
View file @
bd274d07
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
audiooutputsiface.cpp
0 → 100644
View file @
bd274d07
/**
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3, as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
* SATISFACTORY QUALITY, 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 program. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Tiago Salem Herrmann <tiago.herrmann@canonical.com>
*/
#include <QDebug>
#include <TelepathyQt/Constants>
#include <TelepathyQt/DBusObject>
#include "audiooutputsiface.h"
QDBusArgument
&
operator
<<
(
QDBusArgument
&
argument
,
const
AudioOutput
&
output
)
{
argument
.
beginStructure
();
argument
<<
output
.
id
<<
output
.
type
<<
output
.
name
;
argument
.
endStructure
();
return
argument
;
}
const
QDBusArgument
&
operator
>>
(
const
QDBusArgument
&
argument
,
AudioOutput
&
output
)
{
argument
.
beginStructure
();
argument
>>
output
.
id
>>
output
.
type
>>
output
.
name
;
argument
.
endStructure
();
return
argument
;
}
// Chan.I.AudioOutputs
BaseChannelAudioOutputsInterface
::
Adaptee
::
Adaptee
(
BaseChannelAudioOutputsInterface
*
interface
)
:
QObject
(
interface
),
mInterface
(
interface
)
{
qDBusRegisterMetaType
<
AudioOutput
>
();
qDBusRegisterMetaType
<
AudioOutputList
>
();
}
struct
TP_QT_NO_EXPORT
BaseChannelAudioOutputsInterface
::
Private
{
Private
(
BaseChannelAudioOutputsInterface
*
parent
)
:
adaptee
(
new
BaseChannelAudioOutputsInterface
::
Adaptee
(
parent
))
{
}
AudioOutputList
audioOutputs
;
QString
activeAudioOutput
;
SetActiveAudioOutputCallback
setActiveAudioOutputCB
;
BaseChannelAudioOutputsInterface
::
Adaptee
*
adaptee
;
};
BaseChannelAudioOutputsInterface
::
Adaptee
::~
Adaptee
()
{
}
void
BaseChannelAudioOutputsInterface
::
Adaptee
::
setActiveAudioOutput
(
const
QString
&
id
,
const
ChannelInterfaceAudioOutputsAdaptor
::
SetActiveAudioOutputContextPtr
&
context
)
{
if
(
!
mInterface
->
mPriv
->
setActiveAudioOutputCB
.
isValid
())
{
context
->
setFinishedWithError
(
TP_QT_ERROR_NOT_IMPLEMENTED
,
QLatin1String
(
"Not implemented"
));
return
;
}
Tp
::
DBusError
error
;
mInterface
->
mPriv
->
setActiveAudioOutputCB
(
id
,
&
error
);
if
(
error
.
isValid
())
{
context
->
setFinishedWithError
(
error
.
name
(),
error
.
message
());
return
;
}
context
->
setFinished
();
}
BaseChannelAudioOutputsInterface
::
BaseChannelAudioOutputsInterface
()
:
AbstractChannelInterface
(
TP_QT_IFACE_CHANNEL_AUDIOOUTPUTS
),
mPriv
(
new
Private
(
this
))
{
}
BaseChannelAudioOutputsInterface
::~
BaseChannelAudioOutputsInterface
()
{
delete
mPriv
;
}
QString
BaseChannelAudioOutputsInterface
::
activeAudioOutput
()
const
{
return
mPriv
->
activeAudioOutput
;
}
AudioOutputList
BaseChannelAudioOutputsInterface
::
audioOutputs
()
const
{
return
mPriv
->
audioOutputs
;
}
void
BaseChannelAudioOutputsInterface
::
setSetActiveAudioOutputCallback
(
const
SetActiveAudioOutputCallback
&
cb
)
{
mPriv
->
setActiveAudioOutputCB
=
cb
;
}
void
BaseChannelAudioOutputsInterface
::
setActiveAudioOutput
(
const
QString
&
id
)
{
mPriv
->
activeAudioOutput
=
id
;
Q_EMIT
mPriv
->
adaptee
->
activeAudioOutputChanged
(
id
);
}
void
BaseChannelAudioOutputsInterface
::
setAudioOutputs
(
const
AudioOutputList
&
outputs
)
{
mPriv
->
audioOutputs
=
outputs
;
Q_EMIT
mPriv
->
adaptee
->
audioOutputsChanged
(
outputs
);
}
QVariantMap
BaseChannelAudioOutputsInterface
::
immutableProperties
()
const
{
QVariantMap
map
;
return
map
;
}
void
BaseChannelAudioOutputsInterface
::
createAdaptor
()
{
(
void
)
new
ChannelInterfaceAudioOutputsAdaptor
(
dbusObject
()
->
dbusConnection
(),
mPriv
->
adaptee
,
dbusObject
());
}
ChannelInterfaceAudioOutputsAdaptor
::
ChannelInterfaceAudioOutputsAdaptor
(
const
QDBusConnection
&
bus
,
QObject
*
adaptee
,
QObject
*
parent
)
:
Tp
::
AbstractAdaptor
(
bus
,
adaptee
,
parent
)
{
connect
(
adaptee
,
SIGNAL
(
audioOutputsChanged
(
AudioOutputList
)),
SIGNAL
(
AudioOutputsChanged
(
AudioOutputList
)));
connect
(
adaptee
,
SIGNAL
(
activeAudioOutputChanged
(
QString
)),
SIGNAL
(
ActiveAudioOutputChanged
(
QString
)));
}
ChannelInterfaceAudioOutputsAdaptor
::~
ChannelInterfaceAudioOutputsAdaptor
()
{
}
void
ChannelInterfaceAudioOutputsAdaptor
::
SetActiveAudioOutput
(
const
QString
&
id
,
const
QDBusMessage
&
dbusMessage
)
{
if
(
!
adaptee
()
->
metaObject
()
->
indexOfMethod
(
"setActiveAudioOutput(QString,ChannelInterfaceAudioOutputsAdaptor::SetActiveAudioOutputContextPtr)"
)
==
-
1
)
{
dbusConnection
().
send
(
dbusMessage
.
createErrorReply
(
TP_QT_ERROR_NOT_IMPLEMENTED
,
QLatin1String
(
"Not implemented"
)));
return
;
}
SetActiveAudioOutputContextPtr
ctx
=
SetActiveAudioOutputContextPtr
(
new
Tp
::
MethodInvocationContext
<
>
(
dbusConnection
(),
dbusMessage
));
QMetaObject
::
invokeMethod
(
adaptee
(),
"setActiveAudioOutput"
,
Q_ARG
(
QString
,
id
),
Q_ARG
(
ChannelInterfaceAudioOutputsAdaptor
::
SetActiveAudioOutputContextPtr
,
ctx
));
return
;
}
QString
ChannelInterfaceAudioOutputsAdaptor
::
ActiveAudioOutput
()
const
{
return
qvariant_cast
<
QString
>
(
adaptee
()
->
property
(
"activeAudioOutput"
));
}
AudioOutputList
ChannelInterfaceAudioOutputsAdaptor
::
AudioOutputs
()
const
{
return
qvariant_cast
<
AudioOutputList
>
(
adaptee
()
->
property
(
"audioOutputs"
));
}
audiooutputsiface.h
0 → 100644
View file @
bd274d07
/**
* Copyright (C) 2013 Canonical, Ltd.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3, as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
* SATISFACTORY QUALITY, 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 program. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Tiago Salem Herrmann <tiago.herrmann@canonical.com>
*/
#ifndef OFONOAUDIOOUTPUTSIFACE_H
#define OFONOAUDIOOUTPUTSIFACE_H
// telepathy-qt
#include <TelepathyQt/Constants>
#include <TelepathyQt/BaseChannel>
#include <TelepathyQt/AbstractAdaptor>
#include <TelepathyQt/DBusError>
#include <TelepathyQt/Callbacks>
#include "dbustypes.h"
#define TP_QT_IFACE_CHANNEL_AUDIOOUTPUTS "com.canonical.Telephony.AudioOutputs"
class
BaseChannelAudioOutputsInterface
;
typedef
Tp
::
SharedPtr
<
BaseChannelAudioOutputsInterface
>
BaseChannelAudioOutputsInterfacePtr
;
class
TP_QT_EXPORT
BaseChannelAudioOutputsInterface
:
public
Tp
::
AbstractChannelInterface
{
Q_OBJECT
Q_DISABLE_COPY
(
BaseChannelAudioOutputsInterface
)
public
:
static
BaseChannelAudioOutputsInterfacePtr
create
()
{
return
BaseChannelAudioOutputsInterfacePtr
(
new
BaseChannelAudioOutputsInterface
());
}
template
<
typename
BaseChannelAudioOutputsInterfaceSubclass
>
static
Tp
::
SharedPtr
<
BaseChannelAudioOutputsInterfaceSubclass
>
create
()
{
return
Tp
::
SharedPtr
<
BaseChannelAudioOutputsInterfaceSubclass
>
(
new
BaseChannelAudioOutputsInterfaceSubclass
());
}
QVariantMap
immutableProperties
()
const
;
virtual
~
BaseChannelAudioOutputsInterface
();
AudioOutputList
audioOutputs
()
const
;
QString
activeAudioOutput
()
const
;
typedef
Tp
::
Callback2
<
void
,
QString
,
Tp
::
DBusError
*>
SetActiveAudioOutputCallback
;
void
setSetActiveAudioOutputCallback
(
const
SetActiveAudioOutputCallback
&
cb
);
public
Q_SLOTS
:
void
setActiveAudioOutput
(
const
QString
&
id
);
void
setAudioOutputs
(
const
AudioOutputList
&
outputs
);
protected
:
BaseChannelAudioOutputsInterface
();
private
:
void
createAdaptor
();
class
Adaptee
;
friend
class
Adaptee
;
struct
Private
;
friend
struct
Private
;
Private
*
mPriv
;
};
class
TP_QT_EXPORT
ChannelInterfaceAudioOutputsAdaptor
:
public
Tp
::
AbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO
(
"D-Bus Interface"
,
TP_QT_IFACE_CHANNEL_AUDIOOUTPUTS
)
Q_CLASSINFO
(
"D-Bus Introspection"
,
""
" <interface name=
\"
com.canonical.Telephony.AudioOutputs
\"
>
\n
"
" <property access=
\"
read
\"
type=
\"
s
\"
name=
\"
ActiveAudioOutput
\"
/>
\n
"
" <property access=
\"
read
\"
type=
\"
a(sss)
\"
name=
\"
AudioOutputs
\"
/>
\n
"
" <method name=
\"
SetActiveAudioOutput
\"
>
\n
"
" <arg direction=
\"
in
\"
type=
\"
s
\"
name=
\"
id
\"
/>
\n
"
" </method>
\n
"
" <signal name=
\"
AudioOutputsChanged
\"
>
\n
"
" <arg type=
\"
a(sss)
\"
name=
\"
outputs
\"
/>
\n
"
" </signal>
\n
"
" <signal name=
\"
ActiveAudioOutputChanged
\"
>
\n
"
" <arg type=
\"
s
\"
name=
\"
id
\"
/>
\n
"
" </signal>
\n
"
" </interface>
\n
"
""
)
Q_PROPERTY
(
AudioOutputList
AudioOutputs
READ
AudioOutputs
)
Q_PROPERTY
(
QString
ActiveAudioOutput
READ
ActiveAudioOutput
)
public
:
ChannelInterfaceAudioOutputsAdaptor
(
const
QDBusConnection
&
dbusConnection
,
QObject
*
adaptee
,
QObject
*
parent
);
virtual
~
ChannelInterfaceAudioOutputsAdaptor
();
typedef
Tp
::
MethodInvocationContextPtr
<
>
SetActiveAudioOutputContextPtr
;
public
:
// PROPERTIES
QString
ActiveAudioOutput
()
const
;
AudioOutputList
AudioOutputs
()
const
;
public
Q_SLOTS
:
// METHODS
void
SetActiveAudioOutput
(
const
QString
&
id
,
const
QDBusMessage
&
dbusMessage
);
Q_SIGNALS
:
// SIGNALS
void
AudioOutputsChanged
(
const
AudioOutputList
&
outputs
);
void
ActiveAudioOutputChanged
(
const
QString
&
id
);
};
class
TP_QT_NO_EXPORT
BaseChannelAudioOutputsInterface
::
Adaptee
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
AudioOutputList
audioOutputs
READ
audioOutputs
)
Q_PROPERTY
(
QString
activeAudioOutput
READ
activeAudioOutput
)
public
:
Adaptee
(
BaseChannelAudioOutputsInterface
*
interface
);
~
Adaptee
();
AudioOutputList
audioOutputs
()
const
{
return
mInterface
->
audioOutputs
();
}
QString
activeAudioOutput
()
const
{
return
mInterface
->
activeAudioOutput
();
}
private
Q_SLOTS
:
void
setActiveAudioOutput
(
const
QString
&
id
,
const
ChannelInterfaceAudioOutputsAdaptor
::
SetActiveAudioOutputContextPtr
&
context
);
Q_SIGNALS
:
void
activeAudioOutputChanged
(
const
QString
&
id
);
void
audioOutputsChanged
(
const
AudioOutputList
&
outputs
);
public
:
BaseChannelAudioOutputsInterface
*
mInterface
;
};
#endif
cmake/modules/EnableCoverageReport.cmake
0 → 100644
View file @
bd274d07
# - Creates a special coverage build type and target on GCC.
#
# Defines a function ENABLE_COVERAGE_REPORT which generates the coverage target
# for selected targets. Optional arguments to this function are used to filter
# unwanted results using globbing expressions. Moreover targets with tests for
# the source code can be specified to trigger regenerating the report if the
# test has changed
#
# ENABLE_COVERAGE_REPORT(TARGETS target... [FILTER filter...] [TESTS test targets...])
#
# To generate a coverage report first build the project with
# CMAKE_BUILD_TYPE=coverage, then call make test and afterwards make coverage.
#
# The coverage report is based on gcov. Depending on the availability of lcov
# a HTML report will be generated and/or an XML report of gcovr is found.
# The generated coverage target executes all found solutions. Special targets
# exist to create e.g. only the xml report: coverage-xml.
#
# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation;
# either version 2, or (at your option)
# any later version.
#
# This program 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 General Public License for more details.
#
INCLUDE
(
ParseArguments
)
FIND_PACKAGE
(
Lcov
)
FIND_PACKAGE
(
gcovr
)
FUNCTION
(
ENABLE_COVERAGE_REPORT
)
# argument parsing
PARSE_ARGUMENTS
(
ARG
"FILTER;TARGETS;TESTS"
""
${
ARGN
}
)
SET
(
COVERAGE_RAW_FILE
"
${
CMAKE_BINARY_DIR
}
/coverage.raw.info"
)
SET
(
COVERAGE_FILTERED_FILE
"
${
CMAKE_BINARY_DIR
}
/coverage.info"
)
SET
(
COVERAGE_REPORT_DIR
"
${
CMAKE_BINARY_DIR
}
/coveragereport"
)
SET
(
COVERAGE_XML_FILE
"
${
CMAKE_BINARY_DIR
}
/coverage.xml"
)
SET
(
COVERAGE_XML_COMMAND_FILE
"
${
CMAKE_BINARY_DIR
}
/coverage-xml.cmake"
)
# decide if there is any tool to create coverage data
SET
(
TOOL_FOUND FALSE
)
IF
(
LCOV_FOUND OR GCOVR_FOUND
)
SET
(
TOOL_FOUND TRUE
)
ENDIF
()
IF
(
NOT TOOL_FOUND
)
MESSAGE
(
STATUS
"Cannot enable coverage targets because neither lcov nor gcovr are found."
)
ENDIF
()
STRING
(
TOLOWER
"
${
CMAKE_BUILD_TYPE
}
"
COVERAGE_BUILD_TYPE
)
IF
(
CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND
"
${
COVERAGE_BUILD_TYPE
}
"
MATCHES
"coverage"
)
MESSAGE
(
STATUS
"Coverage support enabled for targets:
${
ARG_TARGETS
}
"
)
# create coverage build type
SET
(
CMAKE_CXX_FLAGS_COVERAGE
${
CMAKE_CXX_FLAGS_DEBUG
}
PARENT_SCOPE
)
SET
(
CMAKE_C_FLAGS_COVERAGE
${
CMAKE_C_FLAGS_DEBUG
}
PARENT_SCOPE
)
SET
(
CMAKE_CONFIGURATION_TYPES
${
CMAKE_CONFIGURATION_TYPES
}
coverage PARENT_SCOPE
)
# instrument targets
SET_TARGET_PROPERTIES
(
${
ARG_TARGETS
}
PROPERTIES COMPILE_FLAGS --coverage
LINK_FLAGS --coverage
)
# html report
IF
(
LCOV_FOUND
)
MESSAGE
(
STATUS
"Enabling HTML coverage report"
)
# set up coverage target
ADD_CUSTOM_COMMAND
(
OUTPUT
${
COVERAGE_RAW_FILE
}