2015-04-26 13:50:59 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright 2015 Marco Martin <mart@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public
|
|
|
|
|
* License version 2 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 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; see the file COPYING. If not, write to
|
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef DIALERUTILS_H
|
|
|
|
|
#define DIALERUTILS_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
2015-04-26 14:42:14 +00:00
|
|
|
#include <QPointer>
|
|
|
|
|
#include <KNotification>
|
2015-04-26 13:50:59 +00:00
|
|
|
|
2015-06-18 23:24:46 +00:00
|
|
|
#include <TelepathyQt/Account>
|
|
|
|
|
|
2015-04-26 13:50:59 +00:00
|
|
|
class DialerUtils : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2015-06-18 23:24:46 +00:00
|
|
|
Q_PROPERTY(QString callState READ callState NOTIFY callStateChanged);
|
2015-04-26 13:50:59 +00:00
|
|
|
public:
|
|
|
|
|
|
2015-06-18 23:24:46 +00:00
|
|
|
DialerUtils(const Tp::AccountPtr &simAccount, QObject *parent = 0);
|
2015-04-26 13:50:59 +00:00
|
|
|
virtual ~DialerUtils();
|
|
|
|
|
|
2015-06-18 23:24:46 +00:00
|
|
|
QString callState() const;
|
|
|
|
|
void setCallState(const QString &state);
|
|
|
|
|
|
2015-04-26 14:42:14 +00:00
|
|
|
Q_INVOKABLE void resetMissedCalls();
|
2015-06-18 23:24:46 +00:00
|
|
|
Q_INVOKABLE void dial(const QString &number);
|
2015-04-26 14:42:14 +00:00
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
void missedCallsActionTriggered();
|
2015-06-18 23:24:46 +00:00
|
|
|
void callStateChanged();
|
|
|
|
|
void acceptCall();
|
|
|
|
|
void rejectCall();
|
|
|
|
|
void hangUp();
|
2015-04-26 14:42:14 +00:00
|
|
|
|
2015-04-26 13:50:59 +00:00
|
|
|
private:
|
2015-04-26 14:42:14 +00:00
|
|
|
QPointer <KNotification> m_callsNotification;
|
2015-04-28 09:18:56 +00:00
|
|
|
QPointer <KNotification> m_ringingNotification;
|
2015-04-26 14:42:14 +00:00
|
|
|
int m_missedCalls;
|
2015-06-18 23:24:46 +00:00
|
|
|
QString m_callState;
|
|
|
|
|
Tp::AccountPtr m_simAccount;
|
2015-04-26 13:50:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|