1 /*
2  * Copyright (c) 2021-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 MISCDEVICE_SERVICE_PROXY_H
17 #define MISCDEVICE_SERVICE_PROXY_H
18 
19 #include "iremote_proxy.h"
20 #include "nocopyable.h"
21 
22 #include "i_miscdevice_service.h"
23 
24 namespace OHOS {
25 namespace Sensors {
26 class MiscdeviceServiceProxy : public IRemoteProxy<IMiscdeviceService> {
27 public:
28     explicit MiscdeviceServiceProxy(const sptr<IRemoteObject> &impl);
29     ~MiscdeviceServiceProxy() = default;
30     virtual int32_t Vibrate(int32_t vibratorId, int32_t timeOut, int32_t usage, bool systemUsage) override;
31     virtual int32_t PlayVibratorEffect(int32_t vibratorId, const std::string &effect,
32 	                                   int32_t loopCount, int32_t usage, bool systemUsage) override;
33 #ifdef OHOS_BUILD_ENABLE_VIBRATOR_CUSTOM
34     virtual int32_t PlayVibratorCustom(int32_t vibratorId, const RawFileDescriptor &rawFd, int32_t usage,
35         bool systemUsage, const VibrateParameter &parameter) override;
36 #endif // OHOS_BUILD_ENABLE_VIBRATOR_CUSTOM
37     virtual int32_t StopVibrator(int32_t vibratorId) override;
38     virtual int32_t StopVibrator(int32_t vibratorId, const std::string &mode) override;
39     virtual int32_t IsSupportEffect(const std::string &effect, bool &state) override;
40     virtual std::vector<LightInfoIPC> GetLightList() override;
41     virtual int32_t TurnOn(int32_t lightId, const LightColor &color, const LightAnimationIPC &animation) override;
42     virtual int32_t TurnOff(int32_t lightId) override;
43     virtual int32_t GetDelayTime(int32_t &delayTime) override;
44     virtual int32_t PlayPattern(const VibratePattern &pattern, int32_t usage,
45         bool systemUsage, const VibrateParameter &parameter) override;
46     virtual int32_t TransferClientRemoteObject(const sptr<IRemoteObject> &vibratorClient) override;
47     virtual int32_t PlayPrimitiveEffect(int32_t vibratorId, const std::string &effect, int32_t intensity,
48         int32_t usage, bool systemUsage, int32_t count) override;
49     virtual int32_t GetVibratorCapacity(VibratorCapacity &capacity) override;
50 
51 private:
52     DISALLOW_COPY_AND_MOVE(MiscdeviceServiceProxy);
53     static inline BrokerDelegator<MiscdeviceServiceProxy> delegator_;
54 };
55 } // namespace Sensors
56 } // namespace OHOS
57 #endif // MISCDEVICE_SERVICE_PROXY_H
58