1 /* 2 * Copyright (c) 2024 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 FOUNDATION_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_PICKER_PICKER_AUDIO_HAPTIC_STUB_H 17 #define FOUNDATION_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_PICKER_PICKER_AUDIO_HAPTIC_STUB_H 18 19 #include "adapter/ohos/entrance/picker/picker_haptic_interface.h" 20 21 namespace OHOS::Ace::NG { 22 class PickerAudioHapticStub : public IPickerAudioHaptic { 23 public: 24 enum class ThreadStatus { 25 NONE, 26 START, 27 READY, 28 PLAYING, 29 PLAY_ONCE, 30 HANDLE_DELTA, 31 }; 32 PickerAudioHapticStub() = default; 33 ~PickerAudioHapticStub() = default; Play(size_t speed)34 void Play(size_t speed) 35 { 36 playThreadStatus_ = ThreadStatus::PLAYING; 37 } PlayOnce()38 void PlayOnce() 39 { 40 playThreadStatus_ = ThreadStatus::PLAY_ONCE; 41 } Stop()42 void Stop() {} HandleDelta(double dy)43 void HandleDelta(double dy) 44 { 45 playThreadStatus_ = ThreadStatus::HANDLE_DELTA; 46 } 47 ThreadStatus playThreadStatus_ = ThreadStatus::NONE; 48 }; 49 } // namespace OHOS::Ace::NG 50 #endif // FOUNDATION_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_PICKER_PICKER_AUDIO_HAPTIC_STUB_H 51