* limitations under the License.
*/
+using CallApp.Tizen.Call.Manager;
+using CallApp.Tizen.Call.View;
+using CallApp.Tizen.Call.ViewModel;
using Xamarin.Forms;
namespace CallApp
{
InitializeComponent();
- MainPage = null;
+ MainPage = new MainPage();
+
+ // FIXME: Test only
+ MainPage.BindingContext = new MainViewModel(new CallManager());
+ //
}
protected override void OnStart()
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Model;
+using CallApp.Tizen.Call.Provider;
+using System.Collections.Generic;
+
+namespace CallApp.Tizen.Call.Manager
+{
+ /// <summary>
+ /// Class for managing calls
+ /// </summary>
+ public class CallManager
+ {
+ public CallManager()
+ {
+ Calls = new List<CallBase>();
+ ContactsProvider = new ContactProvider();
+ }
+
+ /// <summary>
+ /// All calls of app
+ /// </summary>
+ public List<CallBase> Calls
+ {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// Gets a provider that provide info about contacts
+ /// </summary>
+ public ContactProvider ContactsProvider
+ {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// Joins a call
+ /// </summary>
+ public void JoinCall()
+ {
+ }
+
+ /// <summary>
+ /// Split a call
+ /// </summary>
+ public void SplitCall()
+ {
+ }
+
+ /// <summary>
+ /// Swap a calls
+ /// </summary>
+ public void SwapCalls()
+ {
+ }
+
+ /// <summary>
+ /// Accept call callback
+ /// </summary>
+ public void OnAcceptCall()
+ {
+ }
+
+ /// <summary>
+ /// End call callback
+ /// </summary>
+ public void OnEndCall()
+ {
+ }
+
+ /// <summary>
+ /// Hold call callback
+ /// </summary>
+ public void OnHoldCall()
+ {
+ }
+
+ /// <summary>
+ /// Incoming call callback
+ /// </summary>
+ public void OnIncomingCall()
+ {
+ }
+
+ /// <summary>
+ /// Joins call callback
+ /// </summary>
+ public void OnJoinCall()
+ {
+ }
+
+ /// <summary>
+ /// Outgoing call callback
+ /// </summary>
+ public void OnOutgoingCall()
+ {
+ }
+
+ /// <summary>
+ /// Rejects call callback
+ /// </summary>
+ public void OnRejectCall()
+ {
+ }
+
+ /// <summary>
+ /// Split call callback
+ /// </summary>
+ public void OnSplitCall()
+ {
+ }
+
+ /// <summary>
+ /// Swap call callback
+ /// </summary>
+ public void OnSwapCall()
+ {
+ }
+
+ /// <summary>
+ /// Unhold call callback
+ /// </summary>
+ public void OnUnholdCall()
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+
+namespace CallApp.Tizen.Call.Manager
+{
+ /// <summary>
+ /// Class for managing messages
+ /// </summary>
+ public class MessagesManager
+ {
+ /// <summary>
+ /// Launch messages' composer
+ /// </summary>
+ /// <param name="id">Id of contact number</param>
+ /// <param name="text">Text message to send</param>
+ public void LaunchComposer(uint id, string text)
+ {
+ }
+
+ /// <summary>
+ /// Gets default messages answers
+ /// </summary>
+ /// <returns>List of default messages answers</returns>
+ public List<string> GetMessageList()
+ {
+ return null;
+ }
+
+ /// <summary>
+ /// Send message with text from list of default messages answers
+ /// </summary>
+ /// <param name="id">Id of contact number</param>
+ /// <param name="index">Index from list of default messages answers</param>
+ public void SendMessage(uint id, int index)
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace CallApp.Tizen.Call.Manager
+{
+ /// <summary>
+ /// Class for managing settings
+ /// </summary>
+ public class SettingsManager
+ {
+ /// <summary>
+ /// Bluetooth state, on or off
+ /// </summary>
+ public bool BluetoothState
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Sound state, on or off
+ /// </summary>
+ public bool SoundState
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Speaker state, on or off
+ /// </summary>
+ public bool SpeakerState
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Ear jack plugged callback
+ /// </summary>
+ public void OnEarJackPlugged()
+ {
+ }
+
+ /// <summary>
+ /// Ear jack unplugged callback
+ /// </summary>
+ public void OnEarJackUnplugged()
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace CallApp.Tizen.Call.Model
+{
+ /// <summary>
+ /// Specifies the status of call
+ /// </summary>
+ public enum CallStatus
+ {
+ Active,
+ End,
+ Hold,
+ Incoming,
+ Outgoing
+ }
+
+ /// <summary>
+ /// Base class of call model
+ /// </summary>
+ public class CallBase
+ {
+ public CallBase(uint id)
+ {
+ Id = id;
+ }
+
+ /// <summary>
+ /// Gets or sets a call status
+ /// </summary>
+ public CallStatus Status
+ {
+ get;
+ internal set;
+ }
+
+ /// <summary>
+ /// Id of call
+ /// </summary>
+ public uint Id
+ {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// End a call
+ /// </summary>
+ public void End()
+ {
+ }
+
+ /// <summary>
+ /// Hold a call
+ /// </summary>
+ public void Hold()
+ {
+ }
+
+ /// <summary>
+ /// Unhold a call
+ /// </summary>
+ public void Unhold()
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace CallApp.Tizen.Call.Model
+{
+ /// <summary>
+ /// Model of call
+ /// </summary>
+ public class CallModel : CallBase
+ {
+ public CallModel(uint id) : base(id)
+ {
+ }
+
+ /// <summary>
+ /// Model of contact
+ /// </summary>
+ public ContactModel ContactModel
+ {
+ get;
+ internal set;
+ }
+
+ /// <summary>
+ /// Number of caller
+ /// </summary>
+ public string CallerNumber
+ {
+ get;
+ internal set;
+ }
+
+ /// <summary>
+ /// Accepts a call
+ /// </summary>
+ public void Accept()
+ {
+ }
+
+ /// <summary>
+ /// Rejects a call
+ /// </summary>
+ public void Reject()
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Collections.Generic;
+
+namespace CallApp.Tizen.Call.Model
+{
+ /// <summary>
+ /// Model of conference call
+ /// </summary>
+ public class ConferenceCallModel : CallBase
+ {
+ public ConferenceCallModel(uint id) : base(id)
+ {
+ }
+
+ /// <summary>
+ /// All calls of conference
+ /// </summary>
+ public List<CallModel> Calls
+ {
+ get;
+ internal set;
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.Model
+{
+ /// <summary>
+ /// Model of contact
+ /// </summary>
+ public class ContactModel
+ {
+ /// <summary>
+ /// Photo of contact
+ /// </summary>
+ public Image Photo
+ {
+ get;
+ internal set;
+ }
+
+ /// <summary>
+ /// Name of contact
+ /// </summary>
+ public string Name
+ {
+ get;
+ internal set;
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace CallApp.Tizen.Call.Provider
+{
+ /// <summary>
+ /// Represents a provider for contact info
+ /// </summary>
+ public class ContactProvider
+ {
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="CallApp.Tizen.Call.View.CallView">
+
+</ContentView>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.View
+{
+ /// <summary>
+ /// Represents Active or Outgoing call view
+ /// </summary>
+ public partial class CallView : ContentView
+ {
+ public CallView()
+ {
+ InitializeComponent();
+ }
+ }
+}
namespace CallApp.Tizen.Call.View
{
/// <summary>
- /// Partial class of ConferenceCallManagePage.xaml
+ /// Represents Conference call managing page
/// </summary>
public partial class ConferenceCallManagePage : ContentPage
{
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="CallApp.Tizen.Call.View.ConferenceCallView">
+
+</ContentView>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.View
+{
+ /// <summary>
+ /// Represents Conference call view
+ /// </summary>
+ public partial class ConferenceCallView : ContentView
+ {
+ public ConferenceCallView()
+ {
+ InitializeComponent();
+ }
+ }
+}
/// <summary>
/// A renderer for AnimatedCircleButton
/// </summary>
- class AnimatedCircleButtonRenderer : LayoutRenderer
+ public class AnimatedCircleButtonRenderer : LayoutRenderer
{
private ElmSharp.GestureLayer _gestureLayer = null;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="CallApp.Tizen.Call.View.EndCallView">
+
+</ContentView>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.View
+{
+ /// <summary>
+ /// Represents End call view
+ /// </summary>
+ public partial class EndCallView : ContentView
+ {
+ public EndCallView()
+ {
+ InitializeComponent();
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="CallApp.Tizen.Call.View.IncomingCallView">
+
+</ContentView>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.View
+{
+ /// <summary>
+ /// Represents Incoming call view
+ /// </summary>
+ public partial class IncomingCallView : ContentView
+ {
+ public IncomingCallView()
+ {
+ InitializeComponent();
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="CallApp.Tizen.Call.View.MainPage"
+ xmlns:CallViews="clr-namespace:CallApp.Tizen.Call.View"
+ xmlns:TizenUtilityConverters="clr-namespace:Tizen.Utility.Converters">
+
+ <ContentView.Resources>
+ <ResourceDictionary>
+ <TizenUtilityConverters:TypeToNameConverter x:Key="TypeToName" />
+
+ <ControlTemplate x:Key="CallControlTemplate">
+ <CallViews:CallView BindingContext="{TemplateBinding BindingContext.CurrentVM}" />
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="ConferenceControlTemplate">
+ <CallViews:ConferenceCallView BindingContext="{TemplateBinding BindingContext.CurrentVM}" />
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="EndControlTemplate">
+ <CallViews:EndCallView BindingContext="{TemplateBinding BindingContext.CurrentVM}" />
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="IncomingControlTemplate">
+ <CallViews:IncomingCallView BindingContext="{TemplateBinding BindingContext.CurrentVM}" />
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="MiniIncomingControlTemplate">
+ <CallViews:MiniIncomingCallView BindingContext="{TemplateBinding BindingContext.CurrentVM}" />
+ </ControlTemplate>
+ </ResourceDictionary>
+ </ContentView.Resources>
+
+ <ContentView>
+ <ContentView.Triggers>
+ <DataTrigger TargetType="ContentView" Binding="{Binding CurrentVM, Converter={StaticResource TypeToName}}" Value="CallViewModel">
+ <Setter Property="ControlTemplate" Value="{StaticResource CallControlTemplate}" />
+ </DataTrigger>
+
+ <DataTrigger TargetType="ContentView" Binding="{Binding CurrentVM, Converter={StaticResource TypeToName}}" Value="ConferenceCallViewModel">
+ <Setter Property="ControlTemplate" Value="{StaticResource ConferenceControlTemplate}" />
+ </DataTrigger>
+
+ <DataTrigger TargetType="ContentView" Binding="{Binding CurrentVM, Converter={StaticResource TypeToName}}" Value="EndCallViewModel">
+ <Setter Property="ControlTemplate" Value="{StaticResource EndControlTemplate}" />
+ </DataTrigger>
+
+ <DataTrigger TargetType="ContentView" Binding="{Binding CurrentVM, Converter={StaticResource TypeToName}}" Value="IncomingCallViewModel">
+ <Setter Property="ControlTemplate" Value="{StaticResource IncomingControlTemplate}" />
+ </DataTrigger>
+
+ <DataTrigger TargetType="ContentView" Binding="{Binding CurrentVM, Converter={StaticResource TypeToName}}" Value="MiniIncomingCallViewModel">
+ <Setter Property="ControlTemplate" Value="{StaticResource MiniIncomingControlTemplate}" />
+ </DataTrigger>
+ </ContentView.Triggers>
+ </ContentView>
+</ContentPage>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.View
+{
+ /// <summary>
+ /// Represents Main page of app for showing various views
+ /// </summary>
+ public partial class MainPage : ContentPage
+ {
+ public MainPage()
+ {
+ InitializeComponent();
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="CallApp.Tizen.Call.View.MiniIncomingCallView">
+
+</ContentView>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.View
+{
+ /// <summary>
+ /// Represents MiniIncoming call view
+ /// </summary>
+ public partial class MiniIncomingCallView : ContentView
+ {
+ public MiniIncomingCallView()
+ {
+ InitializeComponent();
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Manager;
+using CallApp.Tizen.Call.Model;
+using Tizen.Utility.Helpers;
+
+namespace CallApp.Tizen.Call.ViewModel
+{
+ /// <summary>
+ /// ViewModel of CallView
+ /// </summary>
+ public class CallViewModel : BaseModel
+ {
+ protected readonly CallManager _callManager = null;
+ protected readonly SettingsManager _settingsManager = new SettingsManager();
+
+ public CallViewModel(CallManager callManager)
+ {
+ _callManager = callManager;
+ }
+
+ /// <summary>
+ /// Gets or sets the active call
+ /// </summary>
+ public CallModel ActiveCall
+ {
+ get;
+
+ // FIXME: Make it private when Call API is completed, at this moment needed to test app
+ set;
+ }
+
+ /// <summary>
+ /// Gets or sets the call on hold
+ /// </summary>
+ public CallModel HoldCall
+ {
+ get;
+
+ // FIXME: Make it private when Call API is completed, at this moment needed to test app
+ set;
+ }
+
+ /// <summary>
+ /// Bluetooth state, on or off
+ /// </summary>
+ public bool BluetoothState
+ {
+ get
+ {
+ return _settingsManager.BluetoothState;
+ }
+
+ set
+ {
+ _settingsManager.BluetoothState = value;
+ }
+ }
+
+ /// <summary>
+ /// Sound state, on or off
+ /// </summary>
+ public bool SoundState
+ {
+ get
+ {
+ return _settingsManager.SoundState;
+ }
+
+ set
+ {
+ _settingsManager.SoundState = value;
+ }
+ }
+
+ /// <summary>
+ /// Speaker state, on or off
+ /// </summary>
+ public bool SpeakerState
+ {
+ get
+ {
+ return _settingsManager.SpeakerState;
+ }
+
+ set
+ {
+ _settingsManager.SpeakerState = value;
+ }
+ }
+
+ /// <summary>
+ /// Keypad state, showed or not
+ /// </summary>
+ public bool KeypadState
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Adds a call
+ /// </summary>
+ public void AddCall()
+ {
+ }
+
+ /// <summary>
+ /// Add a contact
+ /// </summary>
+ public void AddContact()
+ {
+ }
+
+ /// <summary>
+ /// Reject a call
+ /// </summary>
+ public void RejectCall()
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Manager;
+
+namespace CallApp.Tizen.Call.ViewModel
+{
+ /// <summary>
+ /// ViewModel of ConferenceCallView
+ /// </summary>
+ public class ConferenceCallViewModel : CallViewModel
+ {
+ public ConferenceCallViewModel(CallManager callManager) : base(callManager)
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Manager;
+using Tizen.Utility.Helpers;
+
+namespace CallApp.Tizen.Call.ViewModel
+{
+ /// <summary>
+ /// ViewModel of EndCallView
+ /// </summary>
+ public class EndCallViewModel : BaseModel
+ {
+ private readonly CallManager _callManager = null;
+ private readonly MessagesManager _messagesManager = new MessagesManager();
+
+ public EndCallViewModel(CallManager callManager)
+ {
+ _callManager = callManager;
+ }
+
+ /// <summary>
+ /// Callback a call
+ /// </summary>
+ public void CallBack()
+ {
+ }
+
+ /// <summary>
+ /// Send a message
+ /// </summary>
+ public void Message()
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Manager;
+using Tizen.Utility.Helpers;
+
+namespace CallApp.Tizen.Call.ViewModel
+{
+ /// <summary>
+ /// ViewModel of IncomingCallView
+ /// </summary>
+ public class IncomingCallViewModel : BaseModel
+ {
+ private readonly CallManager _callManager = null;
+ private readonly MessagesManager _messagesManager = new MessagesManager();
+
+ public IncomingCallViewModel(CallManager callManager)
+ {
+ _callManager = callManager;
+ }
+
+ /// <summary>
+ /// Accept a call
+ /// </summary>
+ public void AcceptCall()
+ {
+ }
+
+ /// <summary>
+ /// Reject a call
+ /// </summary>
+ public void RejectCall()
+ {
+ }
+
+ /// <summary>
+ /// Reject a call with message
+ /// </summary>
+ public void RejectCallWithMessage(string text)
+ {
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Manager;
+using Tizen.Utility.Helpers;
+
+namespace CallApp.Tizen.Call.ViewModel
+{
+ /// <summary>
+ /// ViewModel of MainPage
+ /// </summary>
+ public class MainViewModel : BaseModel
+ {
+ private readonly CallManager _callManager = null;
+
+ // FIXME: Due to warning "is assigned but its value is never used"
+ /*
+ private readonly CallViewModel _callVM = null;
+ private readonly ConferenceCallViewModel _conferenceCallVM = null;
+ private readonly EndCallViewModel _endCallVM = null;
+ private readonly IncomingCallViewModel _incomingCallVM = null;
+ private readonly MiniIncomingCallViewModel _miniIncomingCallVM = null;
+ */
+
+ public MainViewModel(CallManager callManager)
+ {
+ _callManager = callManager;
+
+ // FIXME: Test only
+ CurrentVM = new CallViewModel(_callManager);
+ //
+ }
+
+ /// <summary>
+ /// Current ViewModel
+ /// </summary>
+ private BaseModel _currentVM = null;
+ public BaseModel CurrentVM
+ {
+ get
+ {
+ return _currentVM;
+ }
+
+ set
+ {
+ _currentVM = value;
+
+ OnPropertyChanged();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using CallApp.Tizen.Call.Manager;
+
+namespace CallApp.Tizen.Call.ViewModel
+{
+ /// <summary>
+ /// ViewModel of MiniIncomingCallView
+ /// </summary>
+ public class MiniIncomingCallViewModel : IncomingCallViewModel
+ {
+ public MiniIncomingCallViewModel(CallManager callManager) : base(callManager)
+ {
+ }
+ }
+}
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="CallApp.Tizen.cs" />
+ <Compile Include="Call\Manager\CallManager.cs" />
+ <Compile Include="Call\Manager\MessagesManager.cs" />
+ <Compile Include="Call\Manager\SettingsManager.cs" />
+ <Compile Include="Call\Model\CallBase.cs" />
+ <Compile Include="Call\Model\CallModel.cs" />
+ <Compile Include="Call\Model\ConferenceCallModel.cs" />
+ <Compile Include="Call\Model\ContactModel.cs" />
+ <Compile Include="Call\Provider\ContactProvider.cs" />
+ <Compile Include="Call\ViewModel\CallViewModel.cs" />
+ <Compile Include="Call\ViewModel\MiniIncomingCallViewModel.cs" />
+ <Compile Include="Call\ViewModel\ConferenceCallViewModel.cs" />
+ <Compile Include="Call\ViewModel\EndCallViewModel.cs" />
+ <Compile Include="Call\ViewModel\IncomingCallViewModel.cs" />
+ <Compile Include="Call\ViewModel\MainViewModel.cs" />
+ <Compile Include="Call\View\CallView.xaml.cs">
+ <DependentUpon>CallView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Call\View\ConferenceCallView.xaml.cs">
+ <DependentUpon>ConferenceCallView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Call\View\Controls\AnimatedCircleButton.xaml.cs">
<DependentUpon>AnimatedCircleButton.xaml</DependentUpon>
</Compile>
<Compile Include="Call\View\ConferenceCallManagePage.xaml.cs">
<DependentUpon>ConferenceCallManagePage.xaml</DependentUpon>
</Compile>
+ <Compile Include="Call\View\EndCallView.xaml.cs">
+ <DependentUpon>EndCallView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Call\View\IncomingCallView.xaml.cs">
+ <DependentUpon>IncomingCallView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Call\View\MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Call\View\MiniIncomingCallView.xaml.cs">
+ <DependentUpon>MiniIncomingCallView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Common\Themes\CommonTheme.xaml.cs">
<DependentUpon>CommonTheme.xaml</DependentUpon>
</Compile>
<DependentUpon>GesturesContainer.xaml</DependentUpon>
</Compile>
<Compile Include="Tizen.Utility\Controls\Renderers\CustomImageRenderer.cs" />
+ <Compile Include="Tizen.Utility\Converters\TypeToNameConverter.cs" />
<Compile Include="Tizen.Utility\Converters\IsStringEmptyConverter.cs" />
<Compile Include="Tizen.Utility\Converters\IsNullConverter.cs" />
<Compile Include="Tizen.Utility\Helpers\BaseModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <Folder Include="Call\Model\" />
- <Folder Include="Call\ViewModel\" />
<Folder Include="lib\" />
</ItemGroup>
<ItemGroup>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Call\View\MainPage.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Call\View\CallView.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Call\View\ConferenceCallView.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Call\View\EndCallView.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Call\View\IncomingCallView.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Call\View\MiniIncomingCallView.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
/// <summary>
/// A renderer for CustomImage
/// </summary>
- class CustomImageRenderer : ImageRenderer
+ public class CustomImageRenderer : ImageRenderer
{
/// <summary cref="ImageRenderer.OnElementChanged(ElementChangedEventArgs{Image})" />
protected override void OnElementChanged(ElementChangedEventArgs<Image> e)
namespace Tizen.Utility.Converters
{
- class IsNullConverter : IValueConverter
+ /// <summary>
+ /// Converter to check whether the object is null or not
+ /// </summary>
+ public class IsNullConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
namespace Tizen.Utility.Converters
{
- class IsStringEmptyConverter : IValueConverter
+ /// <summary>
+ /// Converter to check whether the string is empty or not
+ /// </summary>
+ public class IsStringEmptyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Globalization;
+using Xamarin.Forms;
+
+namespace Tizen.Utility.Converters
+{
+ /// <summary>
+ /// Type to name converter
+ /// </summary>
+ public class TypeToNameConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ return value.GetType().Name;
+ }
+
+ return string.Empty;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
namespace Tizen.Utility.Helpers
{
- static class Logger
+ /// <summary>
+ /// Class for app logs
+ /// </summary>
+ public static class Logger
{
+ /// <summary>
+ /// Writes logs into console
+ /// </summary>
+ /// <param name="message">Message to write</param>
+ /// <param name="file">Caller file path</param>
+ /// <param name="method">Caller member name</param>
public static void Debug(string message, [CallerFilePath] string file = "", [CallerMemberName] string method = "")
{
Console.WriteLine("{0}, {1}, {2}", file, method, message);
/// <summary>
/// Helper with navigation logics through pages
/// </summary>
- class PageNavigator
+ public static class PageNavigator
{
/// <summary>
/// Navigate to new page in modal state
/// <summary>
/// Implementation of tap event through command. Can be attached to UI control
/// </summary>
- static class AttachedTapCommand
+ public static class AttachedTapCommand
{
/// <summary>
/// Property for attaching ICommand
/// <summary>
/// Extension for supporting Gestures in Triggers
/// </summary>
- public class GesturesInput
+ public static class GesturesInput
{
/// <summary>
/// Property for attaching tap gesture