blob: 4bc06a317ba76e7467690b886dd88ac22068c2c0 [file] [log] [blame]
Nicolas Jagera92f1312016-08-25 08:01:22 -04001#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**************************************************************************/
19using namespace Platform::Collections;
20
21namespace RingClientUWP
22{
Nicolas Jagerd76940f2016-08-31 14:44:04 -040023/* delegate */
24delegate void CallRecieved(Call^ call);
25delegate void CallStatusUpdated(Call^ call);
Nicolas Jagera92f1312016-08-25 08:01:22 -040026
27namespace ViewModel {
28public ref class CallsViewModel sealed
29{
30internal:
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 Jagerd76940f2016-08-31 14:44:04 -040043 void clearCallsList();
Nicolas Jager7c409f32016-09-08 09:35:16 -040044 void setState(String^ callId, String^ state, int code); // used ?
45 Call^ findCall(String^ callId);
Nicolas Jagera92f1312016-08-25 08:01:22 -040046
47 /* properties */
48 property Vector<Call^>^ CallsList
49 {
50 Vector<Call^>^ get()
51 {
52 return CallsList_;
53 }
54 }
55
56 /* events */
Nicolas Jagerd76940f2016-08-31 14:44:04 -040057 event CallRecieved^ callRecieved;
58 event CallStatusUpdated^ callStatusUpdated;
Nicolas Jagera92f1312016-08-25 08:01:22 -040059
60private:
61 CallsViewModel(); // singleton
Nicolas Jager7c409f32016-09-08 09:35:16 -040062 Vector<Call^>^ CallsList_; // refacto : change C to c
Nicolas Jagera92f1312016-08-25 08:01:22 -040063
64};
65}
66}