blob: 553455e423d2fafd78f1f22c073aba9c89bed56d [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();
44 void setState(String^ callId, String^ state, int code);
Nicolas Jagera92f1312016-08-25 08:01:22 -040045
46 /* properties */
47 property Vector<Call^>^ CallsList
48 {
49 Vector<Call^>^ get()
50 {
51 return CallsList_;
52 }
53 }
54
55 /* events */
Nicolas Jagerd76940f2016-08-31 14:44:04 -040056 event CallRecieved^ callRecieved;
57 event CallStatusUpdated^ callStatusUpdated;
Nicolas Jagera92f1312016-08-25 08:01:22 -040058
59private:
60 CallsViewModel(); // singleton
61 Vector<Call^>^ CallsList_;
62
63};
64}
65}