Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 1 | #pragma once
|
| 2 | /**************************************************************************
|
| 3 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 4 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 5 | * *
|
| 6 | * This program is free software; you can redistribute it and/or modify *
|
| 7 | * it under the terms of the GNU General Public License as published by *
|
| 8 | * the Free Software Foundation; either version 3 of the License, or *
|
| 9 | * (at your option) any later version. *
|
| 10 | * *
|
| 11 | * This program is distributed in the hope that it will be useful, *
|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 14 | * GNU General Public License for more details. *
|
| 15 | * *
|
| 16 | * You should have received a copy of the GNU General Public License *
|
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 18 | **************************************************************************/
|
| 19 | using namespace Platform::Collections;
|
| 20 |
|
| 21 | namespace RingClientUWP
|
| 22 | {
|
Nicolas Jager | d76940f | 2016-08-31 14:44:04 -0400 | [diff] [blame] | 23 | /* delegate */
|
| 24 | delegate void CallRecieved(Call^ call);
|
| 25 | delegate void CallStatusUpdated(Call^ call);
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 26 |
|
| 27 | namespace ViewModel {
|
| 28 | public ref class CallsViewModel sealed
|
| 29 | {
|
| 30 | internal:
|
| 31 | /* singleton */
|
| 32 | static property CallsViewModel^ instance
|
| 33 | {
|
| 34 | CallsViewModel^ get()
|
| 35 | {
|
| 36 | static CallsViewModel^ instance_ = ref new CallsViewModel();
|
| 37 | return instance_;
|
| 38 | }
|
| 39 | }
|
| 40 |
|
| 41 | /* functions */
|
| 42 | Call^ addNewCall(String^ accountId, String^ callId, String^ from);
|
Nicolas Jager | d76940f | 2016-08-31 14:44:04 -0400 | [diff] [blame] | 43 | void clearCallsList();
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 44 | void setState(String^ callId, String^ state, int code); // used ?
|
| 45 | Call^ findCall(String^ callId);
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 46 |
|
| 47 | /* properties */
|
| 48 | property Vector<Call^>^ CallsList
|
| 49 | {
|
| 50 | Vector<Call^>^ get()
|
| 51 | {
|
| 52 | return CallsList_;
|
| 53 | }
|
| 54 | }
|
| 55 |
|
| 56 | /* events */
|
Nicolas Jager | d76940f | 2016-08-31 14:44:04 -0400 | [diff] [blame] | 57 | event CallRecieved^ callRecieved;
|
| 58 | event CallStatusUpdated^ callStatusUpdated;
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 59 |
|
| 60 | private:
|
| 61 | CallsViewModel(); // singleton
|
Nicolas Jager | 7c409f3 | 2016-09-08 09:35:16 -0400 | [diff] [blame] | 62 | Vector<Call^>^ CallsList_; // refacto : change C to c
|
Nicolas Jager | a92f131 | 2016-08-25 08:01:22 -0400 | [diff] [blame] | 63 |
|
| 64 | };
|
| 65 | }
|
| 66 | }
|