Release 4.0.0-preview1-00285
[platform/core/csapi/tizenfx.git] / src / Tizen.Tapi / Tizen.Tapi / CallData.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System.Collections.Generic;
18
19 namespace Tizen.Tapi
20 {
21     /// <summary>
22     /// A class containing information about call idle status notification data.
23     /// </summary>
24     public class CallIdleStatusNotificationData
25     {
26         internal uint Id;
27         internal CallEndCause Cause;
28
29         internal CallIdleStatusNotificationData()
30         {
31         }
32
33         /// <summary>
34         /// Notification id.
35         /// </summary>
36         /// <value>Notificatio id in unsigned integer format.</value>
37         public uint NotiId
38         {
39             get
40             {
41                 return Id;
42             }
43         }
44
45         /// <summary>
46         /// End cause for the call indicates whether the call is released normally or due to some other cause.
47         /// </summary>
48         /// <value>En cause enum value.</value>
49         public CallEndCause EndCause
50         {
51             get
52             {
53                 return Cause;
54             }
55         }
56     }
57
58     /// <summary>
59     /// A class which contains calling name information.
60     /// </summary>
61     public class CallerNameInfo
62     {
63         internal CallNameMode Mode;
64         internal string NameData;
65
66         internal CallerNameInfo()
67         {
68         }
69
70         /// <summary>
71         /// Display mode of the name.
72         /// </summary>
73         /// <value>Enum value for call name mode</value>
74         public CallNameMode NameMode
75         {
76             get
77             {
78                 return Mode;
79             }
80         }
81
82         /// <summary>
83         /// Calling party name string.
84         /// </summary>
85         /// <value>String value representing calling party name.</value>
86         public string Name
87         {
88             get
89             {
90                 return NameData;
91             }
92         }
93     }
94
95     /// <summary>
96     /// A class which contains details about call information.
97     /// </summary>
98     public class CallIncomingInfo
99     {
100         internal uint Handle;
101         internal CallType Type;
102         internal string Number;
103         internal CallerNameInfo Name;
104         internal CallCliMode Cli;
105         internal CallNoCliCause Cause;
106         internal bool IsFwded;
107         internal CallActiveLine Line;
108
109         internal CallIncomingInfo()
110         {
111         }
112
113         /// <summary>
114         /// Call handle indicates the handle of the call for the application.
115         /// </summary>
116         /// <value>Call handle represented in unsigned integer format.</value>
117         public uint CallHandle
118         {
119             get
120             {
121                 return Handle;
122             }
123         }
124
125         /// <summary>
126         /// Call type.
127         /// </summary>
128         /// <value>Call type indicating whether the requested call is a voice or video call.</value>
129         public CallType CallType
130         {
131             get
132             {
133                 return Type;
134             }
135         }
136
137         /// <summary>
138         /// Caller number, null terminated ASCII.
139         /// </summary>
140         /// <value>A string representing calling party number.</value>
141         public string CallerNumber
142         {
143             get
144             {
145                 return Number;
146             }
147         }
148
149         /// <summary>
150         /// Call name info. If there is no information from the network, this information will be null.
151         /// </summary>
152         /// <value>A CallerNameInfo which contains information about the calling party name.</value>
153         public CallerNameInfo NameInfo
154         {
155             get
156             {
157                 return Name;
158             }
159         }
160
161         /// <summary>
162         /// CLI mode.
163         /// </summary>
164         /// <value>Enum value representing CLI mode.</value>
165         public CallCliMode CliMode
166         {
167             get
168             {
169                 return Cli;
170             }
171         }
172
173         /// <summary>
174         /// No CLI cause.
175         /// </summary>
176         /// <value>Enum value representing the cause for no CLI.</value>
177         public CallNoCliCause CliCause
178         {
179             get
180             {
181                 return Cause;
182             }
183         }
184
185         /// <summary>
186         /// Checks whether the incoming call is a forwarded call or not.
187         /// </summary>
188         /// <value>True or false. If the incoming call is a forwarded call, then true else false.</value>
189         public bool IsForwarded
190         {
191             get
192             {
193                 return IsFwded;
194             }
195         }
196
197         /// <summary>
198         /// Current Active Line.
199         /// </summary>
200         /// <value>Enum value representing call active line.</value>
201         public CallActiveLine ActiveLine
202         {
203             get
204             {
205                 return Line;
206             }
207         }
208     }
209
210     /// <summary>
211     /// A class which contains information about call line control.
212     /// </summary>
213     public class CallRecordLineControl
214     {
215         internal byte PolarityInc;
216         internal byte Toggle;
217         internal byte ReversePol;
218         internal byte PowerTime;
219
220         internal CallRecordLineControl()
221         {
222         }
223
224         /// <summary>
225         /// Polarity included.
226         /// </summary>
227         /// <value>Polarity value represented in byte format.</value>
228         public byte PolarityIncluded
229         {
230             get
231             {
232                 return PolarityInc;
233             }
234         }
235
236         /// <summary>
237         /// Toggle mode.
238         /// </summary>
239         /// <value>Toggle mode represented in byte format.</value>
240         public byte ToggleMode
241         {
242             get
243             {
244                 return Toggle;
245             }
246         }
247
248         /// <summary>
249         /// Reverse polarity.
250         /// </summary>
251         /// <value>Reverse polarity value represented in byte format.</value>
252         public byte ReversePolarity
253         {
254             get
255             {
256                 return ReversePol;
257             }
258         }
259
260         /// <summary>
261         /// Power denial time.
262         /// </summary>
263         /// <value>Time value in byte which represents power denial time.</value>
264         public byte PowerDenialTime
265         {
266             get
267             {
268                 return PowerTime;
269             }
270         }
271     }
272
273     /// <summary>
274     /// A class which contains information about call record.
275     /// </summary>
276     public class CallRecord
277     {
278         internal uint Id;
279         internal CallRecordType Type;
280         internal string Name;
281         internal string Number;
282         internal CallRecordLineControl LineCtrl;
283
284         internal CallRecord()
285         {
286         }
287
288         /// <summary>
289         /// Call id
290         /// </summary>
291         /// <value>Call id which is represented in unsigned integer format.</value>
292         public uint CallId
293         {
294             get
295             {
296                 return Id;
297             }
298         }
299
300         /// <summary>
301         /// Call record type.
302         /// </summary>
303         /// <value>An enum value representing the call record type.</value>
304         public CallRecordType CallRecordType
305         {
306             get
307             {
308                 return Type;
309             }
310         }
311
312         /// <summary>
313         /// Name record.
314         /// </summary>
315         /// <remarks>
316         /// This value will be filled only if CallRecordType is Name, otherwise it is null.
317         /// </remarks>
318         /// <value>Name record represented in string.</value>
319         public string NameRecord
320         {
321             get
322             {
323                 return Name;
324             }
325         }
326
327         /// <summary>
328         /// Number record.
329         /// </summary>
330         /// <remarks>
331         /// This value will be filled only if CallRecordType is Record, otherwise it is null.
332         /// </remarks>
333         /// <value>Number record reprensented in string.</value>
334         public string NumberRecord
335         {
336             get
337             {
338                 return Number;
339             }
340         }
341
342         /// <summary>
343         /// Gets the line control info.
344         /// </summary>
345         /// <remarks>
346         /// This value will be filled only if CallRecordType is LineControl, otherwise it is null.
347         /// </remarks>
348         /// <value>An instance of CallRecordLineControl class.</value>
349         public CallRecordLineControl LineControlInfo
350         {
351             get
352             {
353                 return LineCtrl;
354             }
355         }
356     }
357
358     /// <summary>
359     /// A class which contains information about call signal notification.
360     /// </summary>
361     public class CallSignalNotification
362     {
363         internal CallAlertSignal Signal;
364         internal CallAlertPitch Pitch;
365         internal CallToneSignal Tone;
366         internal CallIsdnAlertSignal Isdn;
367         internal CallIs54bAlertSignal Is54b;
368
369         internal CallSignalNotification()
370         {
371         }
372
373         /// <summary>
374         /// Gets the call signal type.
375         /// </summary>
376         /// <value>Signal type of the call represented as CallAlertSignal enum.</value>
377         public CallAlertSignal SignalType
378         {
379             get
380             {
381                 return Signal;
382             }
383         }
384
385         /// <summary>
386         /// Gets the call pitch type.
387         /// </summary>
388         /// <value>Pitch type of the call represented as CallAlertPitch enum.</value>
389         public CallAlertPitch PitchType
390         {
391             get
392             {
393                 return Pitch;
394             }
395         }
396
397         /// <summary>
398         /// Gets the call signal tone type.
399         /// </summary>
400         /// <remarks>
401         /// This value will be filled only if SignalType is Tone.
402         /// </remarks>
403         /// <value>Signal tone type of the call represented in CallToneSignal enum.</value>
404         public CallToneSignal ToneType
405         {
406             get
407             {
408                 return Tone;
409             }
410         }
411
412         /// <summary>
413         /// Gets the signal ISDN Alert type.
414         /// </summary>
415         /// <remarks>
416         /// This value will be filled only if SignalType is IsdnAlert.
417         /// </remarks>
418         /// <value>Signal ISDN alert type of the call represented in CallIsdnAlertSignal enum.</value>
419         public CallIsdnAlertSignal IsdnAlertType
420         {
421             get
422             {
423                 return Isdn;
424             }
425         }
426
427         /// <summary>
428         /// Gets the signal IS54B alert type.
429         /// </summary>
430         /// <remarks>
431         /// This value will be filled only if SignalType is Is54bAlert.
432         /// </remarks>
433         /// <value>Signal IS54B alerty type of the call represented in CallIs54bAlertSignal enum.</value>
434         public CallIs54bAlertSignal Is54bAlertType
435         {
436             get
437             {
438                 return Is54b;
439             }
440         }
441     }
442
443     /// <summary>
444     /// A class which contains information about call upgrade/downgrade request of VoLTE call.
445     /// </summary>
446     public class CallUpgradeDowngradeRequestNoti
447     {
448         internal int Handle;
449         internal CallConfigType Type;
450
451         internal CallUpgradeDowngradeRequestNoti()
452         {
453         }
454
455         /// <summary>
456         /// Gets the call handle.
457         /// </summary>
458         /// <value>Call handle value represented in integer format.</value>
459         public int CallHandle
460         {
461             get
462             {
463                 return Handle;
464             }
465         }
466
467         /// <summary>
468         /// Gets the call upgrade/downgrade config type.
469         /// </summary>
470         /// <value>Call upgrade/downgrade type represented in CallConfigType enum.</value>
471         public CallConfigType UpgradeType
472         {
473             get
474             {
475                 return Type;
476             }
477         }
478     }
479
480     /// <summary>
481     /// A class which contains information about an outgoing call.
482     /// </summary>
483     public class CallInformation
484     {
485         private CallType _type;
486         private EmergencyType _etype;
487         private string _number;
488         private CallInformation()
489         {
490         }
491
492         /// <summary>
493         /// A parameterized constructor of CallInformation.
494         /// </summary>
495         /// <param name="type">Type of call(voice, data, video, emergency).</param>
496         /// <param name="etype">Emergency category.</param>
497         /// <param name="phoneNumber">Destination phone number.</param>
498         public CallInformation(CallType type, EmergencyType etype, string phoneNumber)
499         {
500             _type = type;
501             _etype = etype;
502             _number = phoneNumber;
503         }
504
505         internal CallType Type
506         {
507             get
508             {
509                 return _type;
510             }
511         }
512
513         internal EmergencyType EType
514         {
515             get
516             {
517                 return _etype;
518             }
519         }
520
521         internal string PhoneNumber
522         {
523             get
524             {
525                 return _number;
526             }
527         }
528     }
529
530     /// <summary>
531     /// A class which contains information about call end response data.
532     /// </summary>
533     public class CallEndData
534     {
535         private CallEndType _type;
536         private uint _id;
537
538         private CallEndData()
539         {
540         }
541
542         internal CallEndData(CallEndType type, uint id)
543         {
544             _type = type;
545             _id = id;
546         }
547
548         /// <summary>
549         /// End type.
550         /// </summary>
551         public CallEndType Type
552         {
553             get
554             {
555                 return _type;
556             }
557         }
558
559         /// <summary>
560         /// Id.
561         /// </summary>
562         public uint Id
563         {
564             get
565             {
566                 return _id;
567             }
568         }
569     }
570
571     /// <summary>
572     /// A class which contains information about burst DTMF in CDMA.
573     /// </summary>
574     public class CallBurstDtmfData
575     {
576         private string _dtmf;
577         private CallDtmfPulseWidth _width;
578         private CallDtmfDigitInterval _interval;
579
580         private CallBurstDtmfData()
581         {
582         }
583
584         /// <summary>
585         /// A parameterized constructor of CallBurstDtmfData.
586         /// </summary>
587         /// <param name="dtmf">Burst DTMF string.</param>
588         /// <param name="width">DTMF Pulse Width.</param>
589         /// <param name="interval">DTMF Inter Digit Interval.</param>
590         public CallBurstDtmfData(string dtmf, CallDtmfPulseWidth width, CallDtmfDigitInterval interval)
591         {
592             _dtmf = dtmf;
593             _width = width;
594             _interval = interval;
595         }
596
597         internal string Dtmf
598         {
599             get
600             {
601                 return _dtmf;
602             }
603         }
604
605         internal CallDtmfPulseWidth Width
606         {
607             get
608             {
609                 return _width;
610             }
611         }
612
613         internal CallDtmfDigitInterval Interval
614         {
615             get
616             {
617                 return _interval;
618             }
619         }
620     }
621
622     /// <summary>
623     /// A class which contains information about call status.
624     /// </summary>
625     public class CallStatus
626     {
627         private int _handle;
628         private bool _isMoCall;
629         private string _number;
630         private CallType _type;
631         private CallState _state;
632         private bool _isConferenceState;
633         private bool _isVolteCall;
634         internal CallStatus()
635         {
636         }
637
638         /// <summary>
639         /// Call handle.
640         /// </summary>
641         public int CallHandle
642         {
643             get
644             {
645                 return _handle;
646             }
647
648             internal set
649             {
650                 _handle = value;
651             }
652         }
653
654         /// <summary>
655         /// Status will be true for MO calls. If MT call, then its false.
656         /// </summary>
657         public bool IsMoCall
658         {
659             get
660             {
661                 return _isMoCall;
662             }
663
664             internal set
665             {
666                 _isMoCall = value;
667             }
668         }
669
670         /// <summary>
671         /// Mobile number.
672         /// </summary>
673         public string PhoneNumber
674         {
675             get
676             {
677                 return _number;
678             }
679
680             internal set
681             {
682                 _number = value;
683             }
684         }
685
686         /// <summary>
687         /// Type of call(voice, data, emergency).
688         /// </summary>
689         public CallType Type
690         {
691             get
692             {
693                 return _type;
694             }
695
696             internal set
697             {
698                 _type = value;
699             }
700         }
701
702         /// <summary>
703         /// Current call state.
704         /// </summary>
705         public CallState State
706         {
707             get
708             {
709                 return _state;
710             }
711
712             internal set
713             {
714                 _state = value;
715             }
716         }
717
718         /// <summary>
719         /// Whether call is in conference state.
720         /// </summary>
721         public bool IsConferenceState
722         {
723             get
724             {
725                 return _isConferenceState;
726             }
727
728             internal set
729             {
730                 _isConferenceState = value;
731             }
732         }
733
734         /// <summary>
735         /// Whether call is volte call.
736         /// </summary>
737         public bool IsVolteCall
738         {
739             get
740             {
741                 return _isVolteCall;
742             }
743
744             internal set
745             {
746                 _isVolteCall = value;
747             }
748         }
749     }
750
751     /// <summary>
752     /// A class that contains call volume info.
753     /// </summary>
754     public class CallVolumeRecord
755     {
756         private SoundDevice _device;
757         private SoundType _type;
758         private SoundVolume _volume;
759         private CallVolumeRecord()
760         {
761         }
762
763         /// <summary>
764         /// A parameterized constructor of CallVolumeRecord.
765         /// </summary>
766         /// <param name="device">Call sound device.</param>
767         /// <param name="type">Call sound type.</param>
768         /// <param name="volume">Call sound volume.</param>
769         public CallVolumeRecord(SoundDevice device, SoundType type, SoundVolume volume)
770         {
771             _device = device;
772             _type = type;
773             _volume = volume;
774         }
775
776         /// <summary>
777         /// Call sound device info.
778         /// </summary>
779         public SoundDevice Device
780         {
781             get
782             {
783                 return _device;
784             }
785         }
786
787         /// <summary>
788         /// Call sound type info.
789         /// </summary>
790         public SoundType Type
791         {
792             get
793             {
794                 return _type;
795             }
796         }
797
798         /// <summary>
799         /// Call sound volume info.
800         /// </summary>
801         public SoundVolume Volume
802         {
803             get
804             {
805                 return _volume;
806             }
807         }
808     }
809
810     /// <summary>
811     /// A class which contains call volume info reponse data.
812     /// </summary>
813     public class CallVolumeInfo
814     {
815         private uint _id;
816         private IEnumerable<CallVolumeRecord> _recordList;
817
818         private CallVolumeInfo()
819         {
820         }
821
822         internal CallVolumeInfo(uint id, IEnumerable<CallVolumeRecord> list)
823         {
824             _id = id;
825             _recordList = list;
826         }
827
828         /// <summary>
829         /// Record number.
830         /// </summary>
831         public uint RecordId
832         {
833             get
834             {
835                 return _id;
836             }
837         }
838
839         /// <summary>
840         /// Volume info record.
841         /// </summary>
842         public IEnumerable<CallVolumeRecord> Records
843         {
844             get
845             {
846                 return _recordList;
847             }
848         }
849     }
850
851     /// <summary>
852     /// A class which contains call sound path and volume information.
853     /// </summary>
854     public class CallSoundPathInfo
855     {
856         private SoundPath _path;
857         private ExtraVolume _exVolume;
858         private CallSoundPathInfo()
859         {
860         }
861
862         /// <summary>
863         /// A parameterized constructor of CallSoundPathInfo.
864         /// </summary>
865         /// <param name="path">Sound path.</param>
866         /// <param name="exVolume">Extra volume status.</param>
867         public CallSoundPathInfo(SoundPath path, ExtraVolume exVolume)
868         {
869             _path = path;
870             _exVolume = exVolume;
871         }
872
873         internal SoundPath Path
874         {
875             get
876             {
877                 return _path;
878             }
879         }
880
881         internal ExtraVolume ExVolume
882         {
883             get
884             {
885                 return _exVolume;
886             }
887         }
888     }
889
890     /// <summary>
891     /// A class which contains call mute status reponse data.
892     /// </summary>
893     public class CallMuteStatusRecord
894     {
895         private SoundMutePath _path;
896         private SoundMuteStatus _status;
897         private CallMuteStatusRecord()
898         {
899         }
900
901         /// <summary>
902         /// A parameterized constructor of CallMuteStatusRecord.
903         /// </summary>
904         /// <param name="path">Mute path.</param>
905         /// <param name="status">Mute status.</param>
906         public CallMuteStatusRecord(SoundMutePath path, SoundMuteStatus status)
907         {
908             _path = path;
909             _status = status;
910         }
911
912         /// <summary>
913         /// Gets the sound mute path.
914         /// </summary>
915         public SoundMutePath Path
916         {
917             get
918             {
919                 return _path;
920             }
921         }
922
923         /// <summary>
924         /// Gets the sound mute status.
925         /// </summary>
926         public SoundMuteStatus Status
927         {
928             get
929             {
930                 return _status;
931             }
932         }
933     }
934 }