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