CallControlsL.xaml.cs 5.56 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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
/*
CallControlsL.xaml.cs
Copyright (C) 2015  Belledonne Communications, Grenoble, France
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 2
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, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using Linphone.Model;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Imaging;

namespace Linphone.Controls
{
    /// <summary>
    /// 
    /// </summary>
    public partial class CallControlsL : UserControl
    {
        private const string speakerOn = "/Assets/Incall_Icons/speaker_on.png";
        private const string speakerOff = "/Assets/Incall_Icons/speaker_off.png";
        private const string bluetoothOn = "/Assets/Incall_Icons/bluetooth_on.png";
        private const string bluetoothOff = "/Assets/Incall_Icons/bluetooth_off.png";
        private const string videoOn = "/Assets/Incall_Icons/video_on.png";
        private const string videoOff = "/Assets/Incall_Icons/video_off.png";
        private const string pauseOn = "/Assets/Incall_Icons/pause.png";
        private const string pauseOff = "/Assets/Incall_Icons/play.png";
        private const string micOn = "/Assets/Incall_Icons/micro_on.png";
        private const string micOff = "/Assets/Incall_Icons/micro_off.png";

        public delegate void HangUpClickEventHandler(object sender);
        public event HangUpClickEventHandler HangUpClick;

        public delegate void StatsClickEventHandler(object sender, bool areStatsVisible);
        public event StatsClickEventHandler StatsClick;

        public delegate void CameraClickEventHandler(object sender);
        public event CameraClickEventHandler CameraClick;

        public delegate void PauseClickEventHandler(object sender, bool isPaused);
        public event PauseClickEventHandler PauseClick;

        public delegate bool SpeakerClickEventHandler(object sender, bool isSpeakerOn);
        public event SpeakerClickEventHandler SpeakerClick;

        public delegate void MuteClickEventHandler(object sender, bool isMuteOn);
        public event MuteClickEventHandler MuteClick;

        public delegate void VideoClickEventHandler(object sender, bool isVideoOn);
        public event VideoClickEventHandler VideoClick;

        public delegate void DialpadClickEventHandler(object sender, bool isDialpadShown);
        public event DialpadClickEventHandler DialpadClick;

        public delegate void BluetoothClickEventHandler(object sender, bool isBluetoothOn);
        public event DialpadClickEventHandler BluetoothClick;

        /// <summary>
        /// Public constructor
        /// </summary>
        public CallControlsL()
        {
            this.InitializeComponent();
        }

        private void hangUp_Click(object sender, RoutedEventArgs e)
        {
            HangUpClick(this);
        }

        private void bluetooth_Click_1(object sender, RoutedEventArgs e)
        {
            /*bool isBluetoothToggled = (bool)bluetooth.IsChecked;
            bluetoothImg.Source = new BitmapImage(new Uri(isBluetoothToggled ? bluetoothOn : bluetoothOff, UriKind.RelativeOrAbsolute));
            BluetoothClick(this, isBluetoothToggled);*/
        }

        private void speaker_Click_1(object sender, RoutedEventArgs e)
        {
           /* bool isSpeakerToggled = (bool)speaker.IsChecked;
            if (SpeakerClick(this, isSpeakerToggled))
            {
                speakerImg.Source = new BitmapImage(new Uri(isSpeakerToggled ? speakerOn : speakerOff, UriKind.RelativeOrAbsolute));
            }*/
        }

        private void microphone_Click_1(object sender, RoutedEventArgs e)
        {
           /* bool isMicToggled = (bool)microphone.IsChecked;
            microImg.Source = new BitmapImage(new Uri(isMicToggled ? micOff : micOn, UriKind.RelativeOrAbsolute));
            MuteClick(this, isMicToggled);*/
        }

        private void stats_Click_1(object sender, RoutedEventArgs e)
        {
            /*bool areStatsVisible = (bool)stats.IsChecked;
            StatsClick(this, areStatsVisible);*/
        }

        private void video_Click_1(object sender, RoutedEventArgs e)
        {
           /* bool isVideoToggled = (bool)video.IsChecked;
            videoImg.Source = new BitmapImage(new Uri(isVideoToggled ? videoOn : videoOff, UriKind.RelativeOrAbsolute));
            VideoClick(this, isVideoToggled);*/
        }

        private void camera_Click_1(object sender, RoutedEventArgs e)
        {
            CameraClick(this);
        }

        private void dialpad_Click_1(object sender, RoutedEventArgs e)
        {
            //bool isDialpadChecked = (bool)dialpad.IsChecked;
           // DialpadClick(this, isDialpadChecked);
        }

        private void pause_Click_1(object sender, RoutedEventArgs e)
        {
           // bool isPauseToggled = (bool)pause.IsChecked;
           // pauseImg.Source = new BitmapImage(new Uri(isPauseToggled ? pauseOn : pauseOff, UriKind.RelativeOrAbsolute));
           // PauseClick(this, isPauseToggled);
        }
    }
}