1 /* 2 * Copyright (C) 2023 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 PASTE_BOARD_SERVICE_INTERFACE_H 17 #define PASTE_BOARD_SERVICE_INTERFACE_H 18 19 #include "i_pasteboard_entry_getter.h" 20 #include "i_pasteboard_delay_getter.h" 21 #include "i_pasteboard_observer.h" 22 #include "iremote_broker.h" 23 #include "paste_data.h" 24 #include "pasteboard_pattern.h" 25 26 namespace OHOS { 27 namespace MiscServices { 28 class IPasteboardService : public IRemoteBroker { 29 public: 30 virtual void Clear() = 0; 31 virtual int32_t GetRecordValueByType(uint32_t dataId, uint32_t recordId, PasteDataEntry &value) = 0; 32 virtual int32_t GetPasteData(PasteData &data, int32_t &syncTime) = 0; 33 virtual bool HasPasteData() = 0; 34 virtual int32_t SetPasteData(PasteData &pasteData, const sptr<IPasteboardDelayGetter> delayGetter, 35 const sptr<IPasteboardEntryGetter> entryGetter) = 0; 36 virtual bool IsRemoteData() = 0; 37 virtual int32_t GetDataSource(std::string &bundleName) = 0; 38 virtual std::vector<std::string> GetMimeTypes() = 0; 39 virtual bool HasDataType(const std::string &mimeType) = 0; 40 virtual std::set<Pattern> DetectPatterns(const std::set<Pattern> &patternsToCheck) = 0; 41 virtual void SubscribeObserver(PasteboardObserverType type, const sptr<IPasteboardChangedObserver> &observer) = 0; 42 virtual void UnsubscribeObserver(PasteboardObserverType type, 43 const sptr<IPasteboardChangedObserver> &observer) = 0; 44 virtual void UnsubscribeAllObserver(PasteboardObserverType type) = 0; 45 virtual int32_t SetGlobalShareOption(const std::map<uint32_t, ShareOption> &globalShareOptions) = 0; 46 virtual int32_t RemoveGlobalShareOption(const std::vector<uint32_t> &tokenIds) = 0; 47 virtual std::map<uint32_t, ShareOption> GetGlobalShareOption(const std::vector<uint32_t> &tokenIds) = 0; 48 virtual int32_t SetAppShareOptions(const ShareOption &shareOptions) = 0; 49 virtual int32_t RemoveAppShareOptions() = 0; 50 virtual void PasteStart(const std::string &pasteId) = 0; 51 virtual void PasteComplete(const std::string &deviceId, const std::string &pasteId) = 0; 52 virtual int32_t RegisterClientDeathObserver(sptr<IRemoteObject> observer) = 0; 53 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.pasteboard.IPasteboardService"); 54 }; 55 } // namespace MiscServices 56 } // namespace OHOS 57 #endif // PASTE_BOARD_SERVICE_INTERFACE_H