dbuscallmanager.h 4.55 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004-2017 Savoir-faire Linux Inc.
3
 *
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *  Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
 *
 *  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 3 of the License, 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.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
 */

21 22
#ifndef __RING_DBUSCALLMANAGER_H__
#define __RING_DBUSCALLMANAGER_H__
23 24 25 26 27 28 29

#include <vector>
#include <map>
#include <string>

#include "dbus_cpp.h"

30
#if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6)
31 32 33 34 35 36 37 38 39 40
/* This warning option only exists for gcc 4.6.0 and greater. */
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif

#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "dbuscallmanager.adaptor.h"
#pragma GCC diagnostic warning "-Wignored-qualifiers"
#pragma GCC diagnostic warning "-Wunused-parameter"

41
#if __GNUC__ >= 5 || (__GNUC__ >=4 && __GNUC_MINOR__ >= 6)
42 43 44 45 46 47 48
/* This warning option only exists for gcc 4.6.0 and greater. */
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif

#include <stdexcept>

class DBusCallManager :
Adrien Béraud's avatar
Adrien Béraud committed
49
    public cx::ring::Ring::CallManager_adaptor,
50 51 52 53 54 55 56
    public DBus::IntrospectableAdaptor,
    public DBus::ObjectAdaptor
{
    public:
        DBusCallManager(DBus::Connection& connection);

        // Methods
57
        std::string placeCall(const std::string& accountID, const std::string& to);
58 59 60 61 62
        bool refuse(const std::string& callID);
        bool accept(const std::string& callID);
        bool hangUp(const std::string& callID);
        bool hold(const std::string& callID);
        bool unhold(const std::string& callID);
63
        bool muteLocalMedia(const std::string& callid, const std::string& mediaType, const bool& mute);
64 65
        bool transfer(const std::string& callID, const std::string& to);
        bool attendedTransfer(const std::string& transferID, const std::string& targetID);
66 67
        std::map<std::string, std::string> getCallDetails(const std::string& callID);
        std::vector<std::string> getCallList();
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
        void removeConference(const std::string& conference_id);
        bool joinParticipant(const std::string& sel_callID, const std::string& drag_callID);
        void createConfFromParticipantList(const std::vector< std::string >& participants);
        bool isConferenceParticipant(const std::string& call_id);
        bool addParticipant(const std::string& callID, const std::string& confID);
        bool addMainParticipant(const std::string& confID);
        bool detachParticipant(const std::string& callID);
        bool joinConference(const std::string& sel_confID, const std::string& drag_confID);
        bool hangUpConference(const std::string& confID);
        bool holdConference(const std::string& confID);
        bool unholdConference(const std::string& confID);
        std::vector<std::string> getConferenceList();
        std::vector<std::string> getParticipantList(const std::string& confID);
        std::vector<std::string> getDisplayNames(const std::string& confID);
        std::string getConferenceId(const std::string& callID);
        std::map<std::string, std::string> getConferenceDetails(const std::string& callID);
        bool startRecordedFilePlayback(const std::string& filepath);
        void stopRecordedFilePlayback(const std::string& filepath);
        bool toggleRecording(const std::string& callID);
        void setRecording(const std::string& callID);
        void recordPlaybackSeek(const double& value);
        bool getIsRecording(const std::string& callID);
90
        void switchInput(const std::string& callID, const std::string& input);
91 92 93
        std::string getCurrentAudioCodecName(const std::string& callID);
        void playDTMF(const std::string& key);
        void startTone(const int32_t& start, const int32_t& type);
94
        void sendTextMessage(const std::string& callID, const std::map<std::string, std::string>& messages, const bool& isMixed);
Gasuleg's avatar
Gasuleg committed
95 96
        void startSmartInfo(const uint32_t& refreshTimeMs);
        void stopSmartInfo();
97 98
};

Adrien Béraud's avatar
Adrien Béraud committed
99
#endif // __RING_CALLMANAGER_H__