• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CELLULAR_CALL_SUPPLEMENT_REQUEST_IMS_H
17 #define CELLULAR_CALL_SUPPLEMENT_REQUEST_IMS_H
18 
19 #include "base_request.h"
20 #include "cellular_call_handler.h"
21 
22 namespace OHOS {
23 namespace Telephony {
24 class SupplementRequestIms : BaseRequest {
25 public:
26     /**
27      * @brief SetClipRequest Set Clip Request
28      *
29      * @param slotId Indicates the card slot index number,
30      * ranging from {@code 0} to the maximum card slot index number supported by the device.
31      * @param action Indicates the action for SetClip,
32      * 1, means turn on clip; 0, means turn off clip.
33      * @param index Indicates the index of command.
34      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
35      */
36     int32_t SetClipRequest(int32_t slotId, int32_t action, int32_t index);
37 
38     /**
39      * @brief GetClipRequest Get Clip Request
40      *
41      * @param slotId Indicates the card slot index number,
42      * ranging from {@code 0} to the maximum card slot index number supported by the device.
43      * @param index Indicates the index of command.
44      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
45      */
46     int32_t GetClipRequest(int32_t slotId, int32_t index);
47 
48     /**
49      * @brief SetClirRequest Set Clir Request
50      *
51      * @param slotId Indicates the card slot index number,
52      * ranging from {@code 0} to the maximum card slot index number supported by the device.
53      * @param action Indicates the action for SetClir,
54      * 1, means turn on clir; 0, means turn off clir.
55      * @param index Indicates the index of command.
56      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
57      */
58     int32_t SetClirRequest(int32_t slotId, int32_t action, int32_t index);
59 
60     /**
61      * @brief GetClirRequest Get Clir Request
62      *
63      * @param slotId Indicates the card slot index number,
64      * ranging from {@code 0} to the maximum card slot index number supported by the device.
65      * @param index Indicates the index of command.
66      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
67      */
68     int32_t GetClirRequest(int32_t slotId, int32_t index);
69 
70     /**
71      * @brief GetCallTransferRequest Get Call Transfer Request
72      *
73      * @param slotId Indicates the card slot index number,
74      * ranging from {@code 0} to the maximum card slot index number supported by the device.
75      * @param reason Indicates the reason of the get call transfer.
76      * @param index Indicates the index of command.
77      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
78      */
79     int32_t GetCallTransferRequest(int32_t slotId, int32_t reason, int32_t index);
80 
81     /**
82      * @brief SetCallTransferRequest Set Call Transfer Request with timer
83      *
84      * @param slotId Indicates the card slot index number,
85      * ranging from {@code 0} to the maximum card slot index number supported by the device.
86      * @param cfInfo Indicates the reason/mode/transferNum/timer of the set call transfer.
87      * @param classType Indicates a sum of service class for setting call transfer.
88      * @param index Indicates the index of command.
89      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
90      */
91     int32_t SetCallTransferRequest(int32_t slotId, const CallTransferInfo &cfInfo, int32_t classType, int32_t index);
92 
93     /**
94      * @brief confirm whether IMS can set call transfer time.
95      *
96      * @param slotId Indicates the card slot index number,
97      * ranging from {@code 0} to the maximum card slot index number supported by the device.
98      * @param result, The result of can set or not
99      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
100      */
101     int32_t CanSetCallTransferTime(int32_t slotId, bool &result);
102 
103     /**
104      * @brief GetCallRestrictionRequest Get Call Restriction Request
105      *
106      * @param slotId Indicates the card slot index number,
107      * ranging from {@code 0} to the maximum card slot index number supported by the device.
108      * @param fac Indicates the facility of the get call restriction.
109      * @param index Indicates the index of command.
110      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
111      */
112     int32_t GetCallRestrictionRequest(int32_t slotId, const std::string &fac, int32_t index);
113 
114     /**
115      * @brief SetCallRestrictionRequest Set Call Restriction Request
116      *
117      * @param slotId Indicates the card slot index number,
118      * ranging from {@code 0} to the maximum card slot index number supported by the device.
119      * @param fac Indicates the facility of the set call restriction.
120      * @param mode Indicates the mode of the set call restriction.
121      * @param pw Indicates password or "" if not required.
122      * @param index Indicates the index of command.
123      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
124      */
125     int32_t SetCallRestrictionRequest(int32_t slotId, std::string &fac, int32_t mode, std::string &pw, int32_t index);
126 
127     /**
128      * @brief SetCallWaitingRequest Set CallWaiting Request
129      *
130      * @param slotId Indicates the card slot index number,
131      * ranging from {@code 0} to the maximum card slot index number supported by the device.
132      * @param activate Indicates the action for SetCallWaiting,
133      * true, means turn on CallWaiting; false, means turn off CallWaiting.
134      * @param classType Call waiting and conditions +CCWA,
135      * the value was {@code ServiceClassType}, See 3GPP TS 22.083.
136      * @param index Indicates the index of command.
137      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
138      */
139     int32_t SetCallWaitingRequest(int32_t slotId, bool activate, int32_t classType, int32_t index);
140 
141     /**
142      * @brief GetCallWaitingRequest Get Call Waiting Request
143      *
144      * @param slotId Indicates the card slot index number,
145      * ranging from {@code 0} to the maximum card slot index number supported by the device.
146      * @param index Indicates the index of command.
147      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
148      */
149     int32_t GetCallWaitingRequest(int32_t slotId, int32_t index);
150 
151     /**
152      * @brief SetColrRequest Set Colr Request
153      *
154      * @param slotId Indicates the card slot index number,
155      * ranging from {@code 0} to the maximum card slot index number supported by the device.
156      * @param presentation Indicates the action for SetClir,
157      * 1, means turn on colr; 0, means turn off colr.
158      * @param index Indicates the index of command.
159      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
160      */
161     int32_t SetColrRequest(int32_t slotId, int32_t presentation, int32_t index);
162 
163     /**
164      * @brief GetColrRequest Get Colr Request
165      *
166      * @param slotId Indicates the card slot index number,
167      * ranging from {@code 0} to the maximum card slot index number supported by the device.
168      * @param index Indicates the index of command.
169      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
170      */
171     int32_t GetColrRequest(int32_t slotId, int32_t index);
172 
173     /**
174      * @brief SetColpRequest Set Colp Request
175      *
176      * @param slotId Indicates the card slot index number,
177      * ranging from {@code 0} to the maximum card slot index number supported by the device.
178      * @param action Indicates the action for SetClir,
179      * 1, means turn on colp; 0, means turn off colp.
180      * @param index Indicates the index of command.
181      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
182      */
183     int32_t SetColpRequest(int32_t slotId, int32_t action, int32_t index);
184 
185     /**
186      * @brief GetColpRequest Get Colp Request
187      *
188      * @param slotId Indicates the card slot index number,
189      * ranging from {@code 0} to the maximum card slot index number supported by the device.
190      * @param index Indicates the index of command.
191      * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure.
192      */
193     int32_t GetColpRequest(int32_t slotId, int32_t index);
194 
195 private:
196     /**
197      * GetMMIHandler
198      *
199      * @return std::shared_ptr<MMIHandler>
200      */
201     std::shared_ptr<CellularCallHandler> GetMMIHandler(int32_t slotId) const;
202 
203 private:
204     ModuleServiceUtils moduleUtils_;
205 };
206 } // namespace Telephony
207 } // namespace OHOS
208 #endif // CELLULAR_CALL_SUPPLEMENT_REQUEST_IMS_H
209