Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Tapi / Tizen.Tapi / PhonebookData.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 which defines the list of phone book availability of the current SIM.
23     /// </summary>
24     public class SimPhonebookList
25     {
26         internal int PbFdn;
27         internal int PbAdn;
28         internal int PbSdn;
29         internal int PbUsim;
30         internal int PbAas;
31         internal int PbGas;
32
33         internal SimPhonebookList()
34         {
35         }
36
37         /// <summary>
38         /// Fixed Dialing Number.
39         /// </summary>
40         /// <value>Fdn represented in integer format.</value>
41         public int Fdn
42         {
43             get
44             {
45                 return PbFdn;
46             }
47         }
48
49         /// <summary>
50         /// SIM - ADN(2G phonebook, Under DF phonebook).
51         /// </summary>
52         /// <value>Adn represented in integer format.</value>
53         public int Adn
54         {
55             get
56             {
57                 return PbAdn;
58             }
59         }
60
61         /// <summary>
62         /// Service Dialing Number.
63         /// </summary>
64         /// <value>Sdn represented in integer format.</value>
65         public int Sdn
66         {
67             get
68             {
69                 return PbSdn;
70             }
71         }
72
73         /// <summary>
74         /// USIM - 3G phonebook.
75         /// </summary>
76         /// <value>Usim represented in integer format.</value>
77         public int Usim
78         {
79             get
80             {
81                 return PbUsim;
82             }
83         }
84
85         /// <summary>
86         /// Additional number Alpha String phonebook.
87         /// </summary>
88         /// <value>Aas represented in integer format.</value>
89         public int Aas
90         {
91             get
92             {
93                 return PbAas;
94             }
95         }
96
97         /// <summary>
98         /// Grouping information Alpha String phonebook.
99         /// </summary>
100         /// <value>Gas represented in integer format.</value>
101         public int Gas
102         {
103             get
104             {
105                 return PbGas;
106             }
107         }
108     }
109
110     /// <summary>
111     /// A class which defines phone book status of the current SIM.
112     /// </summary>
113     public class SimPhonebookStatus
114     {
115         internal bool InitStatus;
116         internal SimPhonebookList List;
117
118         internal SimPhonebookStatus()
119         {
120         }
121
122         /// <summary>
123         /// Init completed or not.
124         /// </summary>
125         /// <value>Boolean value to check the status of Init.</value>
126         public bool IsInitCompleted
127         {
128             get
129             {
130                 return InitStatus;
131             }
132         }
133
134         /// <summary>
135         /// List of phonebook.
136         /// </summary>
137         /// <value>An instance of SimPhonebookList containing the list of available phone book.</value>
138         public SimPhonebookList PbList
139         {
140             get
141             {
142                 return List;
143             }
144         }
145     }
146
147     /// <summary>
148     /// A class which defines phonebook contact change information.
149     /// </summary>
150     public class PhonebookContactChangeInfo
151     {
152         internal PhonebookType PbType;
153         internal ushort ChangedIndex;
154         internal PhonebookOperationType OpType;
155
156         internal PhonebookContactChangeInfo()
157         {
158         }
159
160         /// <summary>
161         /// Storage file type.
162         /// </summary>
163         /// <value>Type of phonebook storage represented as PhonebookType enum.</value>
164         public PhonebookType Type
165         {
166             get
167             {
168                 return PbType;
169             }
170         }
171
172         /// <summary>
173         /// Changed index.
174         /// </summary>
175         /// <value>Index value represented in unsigned short.</value>
176         public ushort Index
177         {
178             get
179             {
180                 return ChangedIndex;
181             }
182         }
183
184         /// <summary>
185         /// Phonebook operation.
186         /// </summary>
187         /// <value>Operation indicating the action on phonebook contact.</value>
188         public PhonebookOperationType Operation
189         {
190             get
191             {
192                 return OpType;
193             }
194         }
195     }
196
197     /// <summary>
198     /// A class which defines phone book storage count information.
199     /// </summary>
200     public class PhonebookStorageInfo
201     {
202         internal PhonebookType PbType;
203         internal ushort PbTotalRecord;
204         internal ushort PbUsedRecord;
205         internal PhonebookStorageInfo()
206         {
207         }
208
209         /// <summary>
210         /// Storage file type.
211         /// </summary>
212         /// <value>Type of phone book storage file.</value>
213         public PhonebookType Type
214         {
215             get
216             {
217                 return PbType;
218             }
219         }
220
221         /// <summary>
222         /// Total record count.
223         /// </summary>
224         /// <value>Count of total phonebook record.</value>
225         public ushort TotalRecord
226         {
227             get
228             {
229                 return PbTotalRecord;
230             }
231         }
232
233         /// <summary>
234         /// Used record count.
235         /// </summary>
236         /// <value>Number of used phonebook record.</value>
237         public ushort UsedRecord
238         {
239             get
240             {
241                 return PbUsedRecord;
242             }
243         }
244     }
245
246     /// <summary>
247     /// A class which defines phone book entry information.
248     /// </summary>
249     public class PhonebookMetaInfo
250     {
251         internal PhonebookType MetaType;
252         internal ushort MinIdx;
253         internal ushort MaxIdx;
254         internal ushort NumMaxLength;
255         internal ushort TextMaxLen;
256         internal ushort UsedRecCount;
257         internal PhonebookMetaInfo()
258         {
259         }
260
261         /// <summary>
262         /// Storage file type.
263         /// </summary>
264         /// <value>Type of phonebook storage.</value>
265         public PhonebookType Type
266         {
267             get
268             {
269                 return MetaType;
270             }
271         }
272
273         /// <summary>
274         /// Phone book minimum index.
275         /// </summary>
276         /// <value>Minimum index value of the phone book record.</value>
277         public ushort MinIndex
278         {
279             get
280             {
281                 return MinIdx;
282             }
283         }
284
285         /// <summary>
286         /// Phone book maximum index.
287         /// </summary>
288         /// <value>Maximum index value of the phone book record.</value>
289         public ushort MaxIndex
290         {
291             get
292             {
293                 return MaxIdx;
294             }
295         }
296
297         /// <summary>
298         /// Phone number's maximum length
299         /// </summary>
300         /// <value>Maximum length of the phone number.</value>
301         public ushort NumberMaxLength
302         {
303             get
304             {
305                 return NumMaxLength;
306             }
307         }
308
309         /// <summary>
310         /// Text's maximum length.
311         /// </summary>
312         /// <value>Maximum length of the text.</value>
313         public ushort TextMaxLength
314         {
315             get
316             {
317                 return TextMaxLen;
318             }
319         }
320
321         /// <summary>
322         /// Phone book used record count.
323         /// </summary>
324         /// <value>Number of used phone book record.</value>
325         public ushort UsedCount
326         {
327             get
328             {
329                 return UsedRecCount;
330             }
331         }
332     }
333
334     /// <summary>
335     /// A class which defines 3G phone book capability information.
336     /// </summary>
337     public class FileTypeCapabilityInfo3G
338     {
339         internal PhonebookFileType3G Type;
340         internal ushort MaxIdx;
341         internal ushort TextMaxLen;
342         internal ushort UsedRecCount;
343         internal FileTypeCapabilityInfo3G()
344         {
345         }
346
347         /// <summary>
348         /// 3G phonebook file type.
349         /// </summary>
350         /// <value>File type of the 3G phonebook.</value>
351         public PhonebookFileType3G FileType
352         {
353             get
354             {
355                 return Type;
356             }
357         }
358
359         /// <summary>
360         /// Max index.
361         /// </summary>
362         /// <value>Maximum index value present in 3G phonebook.</value>
363         public ushort MaxIndex
364         {
365             get
366             {
367                 return MaxIdx;
368             }
369         }
370
371         /// <summary>
372         /// Max text length.
373         /// </summary>
374         /// <value>Maximum text length in unsigned short.</value>
375         public ushort TextMaxLength
376         {
377             get
378             {
379                 return TextMaxLen;
380             }
381         }
382
383         /// <summary>
384         /// Used record count.
385         /// </summary>
386         /// <value>Number of used record in 3G phonebook.</value>
387         public ushort UsedCount
388         {
389             get
390             {
391                 return UsedRecCount;
392             }
393         }
394     }
395
396     /// <summary>
397     /// A class which manages Sim phonebook and its capabilities information.
398     /// </summary>
399     public class PhonebookMetaInfo3G
400     {
401         internal ushort FileCount;
402         internal IEnumerable<FileTypeCapabilityInfo3G> FileInfo;
403         internal PhonebookMetaInfo3G()
404         {
405         }
406
407         /// <summary>
408         /// Phonebook file type count.
409         /// </summary>
410         /// <value>Filetype count of the 3G phonebook.</value>
411         public ushort FileTypeCount
412         {
413             get
414             {
415                 return FileCount;
416             }
417         }
418
419         /// <summary>
420         /// Phonebook file type information.
421         /// </summary>
422         /// <value>A list of FileTypeCapabilityInfo3G instances.</value>
423         public IEnumerable<FileTypeCapabilityInfo3G> FileTypeInfo
424         {
425             get
426             {
427                 return FileInfo;
428             }
429         }
430     }
431
432     /// <summary>
433     /// A class which contains information about phonebook record.
434     /// </summary>
435     public class PhonebookRecord
436     {
437         private PhonebookType _type;
438         private ushort _index;
439         private ushort _nextIndex;
440         private string _name;
441         private TextEncryptionType _dcs;
442         private string _number;
443         private SimTypeOfNumber _ton;
444         private string _sne;
445         private TextEncryptionType _sneDcs;
446         private string _anr1;
447         private SimTypeOfNumber _anr1Ton;
448         private string _anr2;
449         private SimTypeOfNumber _anr2Ton;
450         private string _anr3;
451         private SimTypeOfNumber _anr3Ton;
452         private string _email1;
453         private string _email2;
454         private string _email3;
455         private string _email4;
456         private ushort _groupIndex;
457         private ushort _pbControl;
458
459         /// <summary>
460         /// Phonebook type.
461         /// </summary>
462         /// <value>Type of the phonebook used.</value>
463         public PhonebookType Type
464         {
465             get
466             {
467                 return _type;
468             }
469
470             set
471             {
472                 _type = value;
473             }
474         }
475
476         /// <summary>
477         /// Index.
478         /// </summary>
479         /// <value>Index value represented in unsigned short.</value>
480         public ushort Index
481         {
482             get
483             {
484                 return _index;
485             }
486
487             set
488             {
489                 _index = value;
490             }
491         }
492
493         /// <summary>
494         /// Next index (This field is not used in the add/update case).
495         /// </summary>
496         /// <value>Next index represented in unsigned short.</value>
497         public ushort NextIndex
498         {
499             get
500             {
501                 return _nextIndex;
502             }
503
504             set
505             {
506                 _nextIndex = value;
507             }
508         }
509
510         /// <summary>
511         /// Name.
512         /// </summary>
513         /// <value>Name in phonebook record.</value>
514         public string Name
515         {
516             get
517             {
518                 return _name;
519             }
520
521             set
522             {
523                 _name = value;
524             }
525         }
526
527         /// <summary>
528         /// Dcs.
529         /// </summary>
530         /// <value>Sim encryption type.</value>
531         public TextEncryptionType Dcs
532         {
533             get
534             {
535                 return _dcs;
536             }
537
538             set
539             {
540                 _dcs = value;
541             }
542         }
543
544         /// <summary>
545         /// Number.
546         /// </summary>
547         /// <value>Number in phonebook record.</value>
548         public string Number
549         {
550             get
551             {
552                 return _number;
553             }
554
555             set
556             {
557                 _number = value;
558             }
559         }
560
561         /// <summary>
562         /// Ton.
563         /// </summary>
564         /// <value>Sim type of number.</value>
565         public SimTypeOfNumber Ton
566         {
567             get
568             {
569                 return _ton;
570             }
571
572             set
573             {
574                 _ton = value;
575             }
576         }
577
578         /// <summary>
579         /// SNE(Second Name Entry).
580         /// </summary>
581         /// <value>Second name entry in byte array.</value>
582         public string Sne
583         {
584             get
585             {
586                 return _sne;
587             }
588
589             set
590             {
591                 _sne = value;
592             }
593         }
594
595         /// <summary>
596         /// SNE DCS.
597         /// </summary>
598         /// <value>SNE text encryption type.</value>
599         public TextEncryptionType SneDcs
600         {
601             get
602             {
603                 return _sneDcs;
604             }
605
606             set
607             {
608                 _sneDcs = value;
609             }
610         }
611
612         /// <summary>
613         /// Additional Number1.
614         /// </summary>
615         /// <value>Additional number1 represented in byte array.</value>
616         public string Anr1
617         {
618             get
619             {
620                 return _anr1;
621             }
622
623             set
624             {
625                 _anr1 = value;
626             }
627         }
628
629         /// <summary>
630         /// ANR1 TON.
631         /// </summary>
632         /// <value>Additional number1 type of number.</value>
633         public SimTypeOfNumber Anr1Ton
634         {
635             get
636             {
637                 return _anr1Ton;
638             }
639
640             set
641             {
642                 _anr1Ton = value;
643             }
644         }
645
646         /// <summary>
647         /// Additional Number2.
648         /// </summary>
649         /// <value>Additional number2 represented in byte array.</value>
650         public string Anr2
651         {
652             get
653             {
654                 return _anr2;
655             }
656
657             set
658             {
659                 _anr2 = value;
660             }
661         }
662
663         /// <summary>
664         /// ANR2 TON.
665         /// </summary>
666         /// <value>Additional number2 type of number.</value>
667         public SimTypeOfNumber Anr2Ton
668         {
669             get
670             {
671                 return _anr2Ton;
672             }
673
674             set
675             {
676                 _anr2Ton = value;
677             }
678         }
679
680         /// <summary>
681         /// Additional number3.
682         /// </summary>
683         /// <value>Additional number3 represented in byte array.</value>
684         public string Anr3
685         {
686             get
687             {
688                 return _anr3;
689             }
690
691             set
692             {
693                 _anr3 = value;
694             }
695         }
696
697         /// <summary>
698         /// ANR3 TON.
699         /// </summary>
700         /// <value>Additional number3 type of number.</value>
701         public SimTypeOfNumber Anr3Ton
702         {
703             get
704             {
705                 return _anr3Ton;
706             }
707
708             set
709             {
710                 _anr3Ton = value;
711             }
712         }
713
714         /// <summary>
715         /// Email1.
716         /// </summary>
717         /// <value>Email1 represented in byte array.</value>
718         public string Email1
719         {
720             get
721             {
722                 return _email1;
723             }
724
725             set
726             {
727                 _email1 = value;
728             }
729         }
730
731         /// <summary>
732         /// Email2.
733         /// </summary>
734         /// <value>Email2 represented in byte array.</value>
735         public string Email2
736         {
737             get
738             {
739                 return _email2;
740             }
741
742             set
743             {
744                 _email2 = value;
745             }
746         }
747
748         /// <summary>
749         /// Email3.
750         /// </summary>
751         /// <value>Email3 represented in byte array.</value>
752         public string Email3
753         {
754             get
755             {
756                 return _email3;
757             }
758
759             set
760             {
761                 _email3 = value;
762             }
763         }
764
765         /// <summary>
766         /// Email4.
767         /// </summary>
768         /// <value>Email4 reprensented in byte array.</value>
769         public string Email4
770         {
771             get
772             {
773                 return _email4;
774             }
775
776             set
777             {
778                 _email4 = value;
779             }
780         }
781
782         /// <summary>
783         /// Group index.
784         /// </summary>
785         /// <value>Group index represented in unsigned short.</value>
786         public ushort GroupIndex
787         {
788             get
789             {
790                 return _groupIndex;
791             }
792
793             set
794             {
795                 _groupIndex = value;
796             }
797         }
798
799         /// <summary>
800         /// Phonebook control.
801         /// </summary>
802         /// <value>Phonebook control represented in unsigned short.</value>
803         public ushort PbControl
804         {
805             get
806             {
807                 return _pbControl;
808             }
809
810             set
811             {
812                 _pbControl = value;
813             }
814         }
815     }
816 }