Call.h 2.39 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#pragma once
/**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux                                *
* Author: Jger Nicolas <nicolas.jager@savoirfairelinux.com>              *
*                                                                         *
* 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;
using namespace Windows::UI::Xaml::Data;

namespace RingClientUWP
{
Nicolas Jager's avatar
Nicolas Jager committed
24 25 26
/* enumerations. */
public enum class CallStatus { NONE, INCOMING_RINGING, OUTGOING_RINGING, SEARCHING, IN_PROGRESS, ENDED };

27 28 29
public ref class Call sealed : public INotifyPropertyChanged
{
public:
Nicolas Jager's avatar
Nicolas Jager committed
30

31 32 33 34 35 36 37 38 39
    /* functions */
    Call(String^ accountId, String^ callId, String^ from);

    /* properties */
    virtual event PropertyChangedEventHandler^ PropertyChanged;

    property String^ accountId;
    property String^ callId;
    property String^ from;
Nicolas Jager's avatar
Nicolas Jager committed
40 41 42 43 44 45 46 47 48
    property CallStatus state {
        CallStatus get() {
            return state_;
        }
        void set(CallStatus value) {
            state_ = value;
            PropertyChanged(this, ref new PropertyChangedEventArgs("state"));
        }
    }
Nicolas Jager's avatar
Nicolas Jager committed
49
    property bool isOutGoing;
50 51 52 53 54 55 56 57
    property int code;

    /* events */

protected:
    /* properties */
    void NotifyPropertyChanged(String^ propertyName);

58
internal:
59 60 61
    //void refuse();
    //void accept();
    //void cancel();
62

Nicolas Jager's avatar
Nicolas Jager committed
63 64 65
private:
    CallStatus state_;

66 67 68
};
}