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