• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 TELEPHONY_BASE_CONNECTION_H
17 #define TELEPHONY_BASE_CONNECTION_H
18 
19 #include "telephony_errors.h"
20 #include "telephony_log_wrapper.h"
21 #include "core_manager_inner.h"
22 #include "call_manager_inner_type.h"
23 #include "cellular_call_data_struct.h"
24 
25 namespace OHOS {
26 namespace Telephony {
27 class BaseConnection {
28 public:
29     /**
30      * Constructor
31      */
32     BaseConnection();
33 
34     /**
35      * Destructor
36      */
37     virtual ~BaseConnection() = default;
38 
39     /**
40      * Set or Update CallReportInfo
41      *
42      * @param CallReportInfo
43      */
44     void SetOrUpdateCallReportInfo(CallReportInfo &callReportInfo);
45 
46     /**
47      * Get CallReportInfo
48      *
49      * @return CallReportInfo
50      */
51     CallReportInfo GetCallReportInfo();
52 
53     /**
54      * SetStatus
55      *
56      * @param state
57      */
58     void SetStatus(TelCallState state);
59 
60     /**
61      * Get connection Status
62      *
63      * @return TelCallState
64      */
65     TelCallState GetStatus() const;
66 
67     /**
68      * IsRingingState.
69      *
70      * @return bool
71      */
72     bool IsRingingState() const;
73 
74     /**
75      * Set Flag
76      *
77      * @param bool
78      */
79     void SetFlag(bool flag);
80 
81     /**
82      * Get Flag
83      *
84      * @return bool
85      */
86     bool GetFlag() const;
87 
88     /**
89      * Set Index
90      *
91      * @param int32_t
92      */
93     void SetIndex(int32_t index);
94 
95     /**
96      * Get Index
97      *
98      * @return int32_t
99      */
100     int32_t GetIndex() const;
101 
102 private:
103     bool flag_ = false;
104     int32_t index_ = 1;
105     CallReportInfo callReportInfo_;
106 };
107 } // namespace Telephony
108 } // namespace OHOS
109 #endif // TELEPHONY_BASE_CONNECTION_H
110