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 OHOS_P2P_INVITATION_RECEIVED_STATE_H 17 #define OHOS_P2P_INVITATION_RECEIVED_STATE_H 18 19 #include "state.h" 20 #include "p2p_macro.h" 21 #include "wifi_p2p_group_manager.h" 22 #include "wifi_p2p_device_manager.h" 23 24 namespace OHOS { 25 namespace Wifi { 26 class P2pStateMachine; 27 class InvitationReceivedState : public State { 28 FRIEND_GTEST(InvitationReceivedState); 29 30 public: 31 /** 32 * @Description Construct a new Invitation Recelved State object 33 * @param None 34 * @return None 35 */ 36 37 InvitationReceivedState(P2pStateMachine &, WifiP2pGroupManager &, WifiP2pDeviceManager &); 38 /** 39 * @Description Destroy the Invitation Recelved State object 40 * @param None 41 * @return None 42 */ 43 ~InvitationReceivedState() = 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_INVITATION_RECELVED_STATE_H */ 74