• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-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 CALL_SETTING_MANAGER_H
17 #define CALL_SETTING_MANAGER_H
18 
19 #include <cstring>
20 #include <memory>
21 
22 #include "pac_map.h"
23 
24 #include "cellular_call_connection.h"
25 
26 namespace OHOS {
27 namespace Telephony {
28 class CallSettingManager {
29 public:
30     CallSettingManager();
31     ~CallSettingManager();
32 
33     int32_t GetCallWaiting(int32_t slotId);
34     int32_t SetCallWaiting(int32_t slotId, bool activate);
35     int32_t GetCallRestriction(int32_t slotId, CallRestrictionType type);
36     int32_t SetCallRestriction(int32_t slotId, CallRestrictionInfo &info);
37     int32_t GetCallTransferInfo(int32_t slotId, CallTransferType type);
38     int32_t SetCallTransferInfo(int32_t slotId, CallTransferInfo &info);
39     int32_t SetCallPreferenceMode(int32_t slotId, int32_t mode);
40     int32_t GetImsConfig(int32_t slotId, ImsConfigItem item);
41     int32_t SetImsConfig(int32_t slotId, ImsConfigItem item, std::u16string &value);
42     int32_t GetImsFeatureValue(int32_t slotId, FeatureType type);
43     int32_t SetImsFeatureValue(int32_t slotId, FeatureType type, int32_t value);
44     int32_t EnableImsSwitch(int32_t slotId);
45     int32_t DisableImsSwitch(int32_t slotId);
46     int32_t IsImsSwitchEnabled(int32_t slotId, bool &enabled);
47 
48 private:
49     int32_t CallWaitingPolicy(int32_t slotId);
50     int32_t GetCallRestrictionPolicy(int32_t slotId, CallRestrictionType type);
51     int32_t SetCallRestrictionPolicy(int32_t slotId, CallRestrictionInfo &info);
52     int32_t GetCallTransferInfoPolicy(int32_t slotId, CallTransferType type);
53     int32_t SetCallTransferInfoPolicy(int32_t slotId, CallTransferInfo &info);
54 
55 private:
56     std::shared_ptr<CellularCallConnection> cellularCallConnectionPtr_;
57 };
58 } // namespace Telephony
59 } // namespace OHOS
60 #endif // CALL_SETTING_MANAGER_H
61