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 #ifndef OHOS_P2P_PENABLING_STATE_H
16 #define OHOS_P2P_PENABLING_STATE_H
17 
18 #include "state.h"
19 #include "wifi_p2p_group_manager.h"
20 #include "wifi_p2p_device_manager.h"
21 
22 namespace OHOS {
23 namespace Wifi {
24 class P2pStateMachine;
25 class P2pEnablingState : public State {
26     FRIEND_GTEST(P2pEnablingState);
27 
28 public:
29     /**
30      * @Description Construct a new P2pEnablingState object
31      * @param None
32      * @return None
33      */
34     P2pEnablingState(P2pStateMachine &, WifiP2pGroupManager &, WifiP2pDeviceManager &);
35 
36     /**
37      * @Description Destroy the P2pEnablingState object
38      * @param None
39      * @return None
40      */
41     ~P2pEnablingState() = default;
42 
43     /**
44      * @Description - Called when entering state
45      * @param None
46      * @return None
47      */
48     virtual void GoInState() override;
49 
50     /**
51      * @Description - Called when exiting state
52      * @param None
53      * @return None
54      */
55     virtual void GoOutState() override;
56 
57     /**
58      * @Description - Message Processing Function
59      * @param msg - Message object pointer
60      * @return - bool true:success   false:fail
61      */
62     virtual bool ExecuteStateMsg(InternalMessagePtr msg) override;
63 
64 private:
65     P2pStateMachine &p2pStateMachine;
66     WifiP2pGroupManager &groupManager;
67     WifiP2pDeviceManager &deviceManager;
68 };
69 } // namespace Wifi
70 } // namespace OHOS
71 
72 #endif /* OHOS_P2P_PENABLING_STATE_H */
73