1bc03f14fSopenharmony_ci/* 2bc03f14fSopenharmony_ci * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 3bc03f14fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4bc03f14fSopenharmony_ci * you may not use this file except in compliance with the License. 5bc03f14fSopenharmony_ci * You may obtain a copy of the License at 6bc03f14fSopenharmony_ci * 7bc03f14fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8bc03f14fSopenharmony_ci * 9bc03f14fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10bc03f14fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11bc03f14fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12bc03f14fSopenharmony_ci * See the License for the specific language governing permissions and 13bc03f14fSopenharmony_ci * limitations under the License. 14bc03f14fSopenharmony_ci */ 15bc03f14fSopenharmony_ci 16bc03f14fSopenharmony_ci#ifndef PASTE_BOARD_SERVICE_PROXY_H 17bc03f14fSopenharmony_ci#define PASTE_BOARD_SERVICE_PROXY_H 18bc03f14fSopenharmony_ci 19bc03f14fSopenharmony_ci#include "i_pasteboard_observer.h" 20bc03f14fSopenharmony_ci#include "i_pasteboard_service.h" 21bc03f14fSopenharmony_ci#include "iremote_proxy.h" 22bc03f14fSopenharmony_ci 23bc03f14fSopenharmony_cinamespace OHOS { 24bc03f14fSopenharmony_cinamespace MiscServices { 25bc03f14fSopenharmony_ciclass PasteboardServiceProxy : public IRemoteProxy<IPasteboardService> { 26bc03f14fSopenharmony_cipublic: 27bc03f14fSopenharmony_ci explicit PasteboardServiceProxy(const sptr<IRemoteObject> &object); 28bc03f14fSopenharmony_ci ~PasteboardServiceProxy() = default; 29bc03f14fSopenharmony_ci DISALLOW_COPY_AND_MOVE(PasteboardServiceProxy); 30bc03f14fSopenharmony_ci virtual void Clear() override; 31bc03f14fSopenharmony_ci virtual int32_t GetRecordValueByType(uint32_t dataId, uint32_t recordId, PasteDataEntry &value) override; 32bc03f14fSopenharmony_ci virtual int32_t GetPasteData(PasteData &data, int32_t &syncTime) override; 33bc03f14fSopenharmony_ci virtual bool HasPasteData() override; 34bc03f14fSopenharmony_ci virtual std::set<Pattern> DetectPatterns(const std::set<Pattern> &patternsToCheck) override; 35bc03f14fSopenharmony_ci virtual int32_t SetPasteData(PasteData &pasteData, const sptr<IPasteboardDelayGetter> delayGetter, 36bc03f14fSopenharmony_ci const sptr<IPasteboardEntryGetter> entryGetter) override; 37bc03f14fSopenharmony_ci virtual bool IsRemoteData() override; 38bc03f14fSopenharmony_ci virtual int32_t GetDataSource(std::string &bundleName) override; 39bc03f14fSopenharmony_ci virtual bool HasDataType(const std::string &mimeType) override; 40bc03f14fSopenharmony_ci virtual void SubscribeObserver(PasteboardObserverType type, 41bc03f14fSopenharmony_ci const sptr<IPasteboardChangedObserver> &observer) override; 42bc03f14fSopenharmony_ci virtual void UnsubscribeObserver(PasteboardObserverType type, 43bc03f14fSopenharmony_ci const sptr<IPasteboardChangedObserver> &observer) override; 44bc03f14fSopenharmony_ci virtual void UnsubscribeAllObserver(PasteboardObserverType type) override; 45bc03f14fSopenharmony_ci virtual int32_t SetGlobalShareOption(const std::map<uint32_t, ShareOption> &globalShareOptions) override; 46bc03f14fSopenharmony_ci virtual int32_t RemoveGlobalShareOption(const std::vector<uint32_t> &tokenIds) override; 47bc03f14fSopenharmony_ci virtual std::map<uint32_t, ShareOption> GetGlobalShareOption(const std::vector<uint32_t> &tokenIds) override; 48bc03f14fSopenharmony_ci virtual int32_t SetAppShareOptions(const ShareOption &shareOptions) override; 49bc03f14fSopenharmony_ci virtual int32_t RemoveAppShareOptions() override; 50bc03f14fSopenharmony_ci virtual void PasteStart(const std::string &pasteId) override; 51bc03f14fSopenharmony_ci virtual void PasteComplete(const std::string &deviceId, const std::string &pasteId) override; 52bc03f14fSopenharmony_ci virtual int32_t RegisterClientDeathObserver(sptr<IRemoteObject> observer) override; 53bc03f14fSopenharmony_ci 54bc03f14fSopenharmony_ciprivate: 55bc03f14fSopenharmony_ci static inline BrokerDelegator<PasteboardServiceProxy> delegator_; 56bc03f14fSopenharmony_ci void ProcessObserver(uint32_t code, PasteboardObserverType type, 57bc03f14fSopenharmony_ci const sptr<IPasteboardChangedObserver> &observer); 58bc03f14fSopenharmony_ci static constexpr int32_t MAX_GET_GLOBAL_SHARE_OPTION_SIZE = 2000; 59bc03f14fSopenharmony_ci}; 60bc03f14fSopenharmony_ci} // namespace MiscServices 61bc03f14fSopenharmony_ci} // namespace OHOS 62bc03f14fSopenharmony_ci#endif // PASTE_BOARD_SERVICE_PROXY_H