blob: 1854a8fe2ff61de3ca67f7db71118823d5140ce9 [file] [log] [blame]
Nicolas Jagera92f1312016-08-25 08:01:22 -04001/**************************************************************************
2* Copyright (C) 2016 by Savoir-faire Linux *
3* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
4* *
5* This program is free software; you can redistribute it and/or modify *
6* it under the terms of the GNU General Public License as published by *
7* the Free Software Foundation; either version 3 of the License, or *
8* (at your option) any later version. *
9* *
10* This program is distributed in the hope that it will be useful, *
11* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13* GNU General Public License for more details. *
14* *
15* You should have received a copy of the GNU General Public License *
16* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17**************************************************************************/
18#include "pch.h"
19
20#include "Call.h"
21
22using namespace Windows::ApplicationModel::Core;
23using namespace Platform;
24using namespace Windows::UI::Core;
25
26using namespace RingClientUWP;
27
Nicolas Jager5750df02016-09-13 11:20:33 -040028// REFACTORING : for the whole Call class, change "from" to "peer"
29
Nicolas Jagerd76940f2016-08-31 14:44:04 -040030Call::Call(String^ accountIdz, String^ callIdz, String^ fromz)
Nicolas Jagera92f1312016-08-25 08:01:22 -040031{
Nicolas Jagerd76940f2016-08-31 14:44:04 -040032 this->accountId = accountIdz;
33 this->callId = callIdz;
34 this->from = fromz;
Nicolas Jagera92f1312016-08-25 08:01:22 -040035
Nicolas Jager5750df02016-09-13 11:20:33 -040036 isOutGoing = false; // by default, we consider the call incomming, REFACTO : add this to the constructor params...
37
Nicolas Jagerc551c362016-10-01 19:24:50 -040038 this->state = CallStatus::NONE;
Nicolas Jagera92f1312016-08-25 08:01:22 -040039 this->code = -1;
40}
41
Nicolas Jagera92f1312016-08-25 08:01:22 -040042void
43Call::NotifyPropertyChanged(String^ propertyName)
44{
45 CoreApplicationView^ view = CoreApplication::MainView;
46 view->CoreWindow->Dispatcher->RunAsync(
Nicolas Jager9edbea32016-10-03 09:13:53 -040047 CoreDispatcherPriority::High,
Nicolas Jagera92f1312016-08-25 08:01:22 -040048 ref new DispatchedHandler([this, propertyName]()
49 {
50 PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
51
52 }));
Nicolas Jagerf6a10322016-09-06 08:17:49 -040053}
54
Nicolas Jager9edbea32016-10-03 09:13:53 -040055//void RingClientUWP::Call::refuse()
56//{
57// RingD::instance->refuseIncommingCall(this);
58//}
59//
60//void RingClientUWP::Call::accept()
61//{
62// RingD::instance->acceptIncommingCall(this);
63//}
64//
65//void RingClientUWP::Call::cancel()
66//{
67// MSG_("!2--->> cancel");
68// RingD::instance->cancelOutGoingCall(this);
69//}