Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 1 | /**************************************************************************
|
| 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 |
|
| 22 | using namespace Windows::ApplicationModel::Core;
|
| 23 | using namespace Platform;
|
| 24 | using namespace Windows::UI::Core;
|
| 25 |
|
| 26 | using namespace RingClientUWP;
|
| 27 |
|
Nicolas Jager | 5750df0 | 2016-09-13 11:20:33 -0400 | [diff] [blame] | 28 | // REFACTORING : for the whole Call class, change "from" to "peer"
|
| 29 |
|
Nicolas Jager | d76940f | 2016-08-31 14:44:04 -0400 | [diff] [blame] | 30 | Call::Call(String^ accountIdz, String^ callIdz, String^ fromz)
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 31 | {
|
Nicolas Jager | d76940f | 2016-08-31 14:44:04 -0400 | [diff] [blame] | 32 | this->accountId = accountIdz;
|
| 33 | this->callId = callIdz;
|
| 34 | this->from = fromz;
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 35 |
|
Nicolas Jager | 5750df0 | 2016-09-13 11:20:33 -0400 | [diff] [blame] | 36 | isOutGoing = false; // by default, we consider the call incomming, REFACTO : add this to the constructor params...
|
| 37 |
|
Nicolas Jager | c551c36 | 2016-10-01 19:24:50 -0400 | [diff] [blame] | 38 | this->state = CallStatus::NONE;
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 39 | this->code = -1;
|
| 40 | }
|
| 41 |
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 42 | void
|
| 43 | Call::NotifyPropertyChanged(String^ propertyName)
|
| 44 | {
|
| 45 | CoreApplicationView^ view = CoreApplication::MainView;
|
| 46 | view->CoreWindow->Dispatcher->RunAsync(
|
Nicolas Jager | 9edbea3 | 2016-10-03 09:13:53 -0400 | [diff] [blame] | 47 | CoreDispatcherPriority::High,
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 48 | ref new DispatchedHandler([this, propertyName]()
|
| 49 | {
|
| 50 | PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
|
| 51 |
|
| 52 | }));
|
Nicolas Jager | f6a1032 | 2016-09-06 08:17:49 -0400 | [diff] [blame] | 53 | }
|
| 54 |
|
Nicolas Jager | 9edbea3 | 2016-10-03 09:13:53 -0400 | [diff] [blame] | 55 | //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 | //}
|