CallsViewModel.h 2.34 KB
Newer Older
1 2 3 4
#pragma once
/**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux                                *
* Author: Jger Nicolas <nicolas.jager@savoirfairelinux.com>              *
5
* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com>          *
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
*                                                                         *
* This program is free software; you can redistribute it and/or modify    *
* it under the terms of the GNU General Public License as published by    *
* the Free Software Foundation; either version 3 of the License, or       *
* (at your option) any later version.                                     *
*                                                                         *
* This program is distributed in the hope that it will be useful,         *
* but WITHOUT ANY WARRANTY; without even the implied warranty of          *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
* GNU General Public License for more details.                            *
*                                                                         *
* You should have received a copy of the GNU General Public License       *
* along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
**************************************************************************/
using namespace Platform::Collections;

namespace RingClientUWP
{
24 25 26
/* delegate */
delegate void CallRecieved(Call^ call);
delegate void CallStatusUpdated(Call^ call);
27 28
delegate void CallStarted();
delegate void CallEnded();
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

namespace ViewModel {
public ref class CallsViewModel sealed
{
internal:
    /* singleton */
    static property CallsViewModel^ instance
    {
        CallsViewModel^ get()
        {
            static CallsViewModel^ instance_ = ref new CallsViewModel();
            return instance_;
        }
    }

    /* properties */
45
    property Vector<String^>^ _callIdList
46
    {
47
        Vector<String^>^ get()
48
        {
49
            return callIdsList_;
50 51 52 53
        }
    }

    /* events */
54 55
    event CallRecieved^ callRecieved;
    event CallStatusUpdated^ callStatusUpdated;
56 57
    event CallStarted^ callStarted;
    event CallEnded^ callEnded;
58 59 60

private:
    CallsViewModel(); // singleton
61
    Vector<String^>^ callIdsList_;
62 63 64 65

};
}
}