1/* 2 * Copyright (c) 2025 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 */ 15sequenceable OHOS.IRemoteObject; 16interface OHOS.MiscServices.IPasteboardDelayGetter; 17interface OHOS.MiscServices.IPasteboardEntryGetter; 18interface OHOS.MiscServices.IPasteboardChangedObserver; 19interface OHOS.MiscServices.IPasteboardDisposableObserver; 20interface OHOS.MiscServices.IEntityRecognitionObserver; 21import PasteboardTypes; 22option_stub_hooks on; 23 24interface OHOS.MiscServices.IPasteboardService { 25 [ipccode 1] void RegisterClientDeathObserver([in] IRemoteObject observer); 26 [ipccode 2] void SubscribeObserver([in] PasteboardObserverType type, [in] IPasteboardChangedObserver observer); 27 [ipccode 3] void UnsubscribeObserver([in] PasteboardObserverType type, [in] IPasteboardChangedObserver observer); 28 [ipccode 4] void UnsubscribeAllObserver([in] PasteboardObserverType type); 29 [ipccode 5] void SubscribeEntityObserver( 30 [in] EntityType entityType, [in] unsigned int expectedDataLength, [in] IEntityRecognitionObserver observer); 31 [ipccode 6] void UnsubscribeEntityObserver( 32 [in] EntityType entityType, [in] unsigned int expectedDataLength, [in] IEntityRecognitionObserver observer); 33 [ipccode 7] void SubscribeDisposableObserver([in] IPasteboardDisposableObserver observer, 34 [in] String targetBundleName, [in] DisposableType type, [in] unsigned int maxLength); 35 [ipccode 8] void ResubscribeObserver([in] PasteboardObserverType type, [in] IPasteboardChangedObserver observer); 36 37 [ipccode 100] void Clear(); 38 [ipccode 101] void SetPasteDataOnly([in] FileDescriptor fd, [in] long memSize, [in] unsigned char[] buffer); 39 [ipccode 102] void SetPasteDataDelayData([in] FileDescriptor fd, [in] long memSize, [in] unsigned char[] buffer, 40 [in] IPasteboardDelayGetter delayGetter); 41 [ipccode 103] void SetPasteDataEntryData([in] FileDescriptor fd, [in] long memSize, [in] unsigned char[] buffer, 42 [in] IPasteboardEntryGetter entryGetter); 43 [ipccode 104] void SetPasteData([in] FileDescriptor fd, [in] long memSize, [in] unsigned char[] buffer, 44 [in] IPasteboardDelayGetter delayGetter, [in] IPasteboardEntryGetter entryGetter); 45 46 [ipccode 200] void GetPasteData([out] FileDescriptor fd, [out] long memSize, [out] unsigned char[] buffer, 47 [in] String pasteId, [out] int syncTime); 48 [ipccode 201] void GetRecordValueByType([in] unsigned int dataId, [in] unsigned int recordId, 49 [inout] long rawDataSize, [inout] unsigned char[] buffer, [inout] FileDescriptor fd); 50 [ipccode 202] void PasteStart([in] String pasteId); 51 [ipccode 203] void PasteComplete([in] String deviceId, [in] String pasteId); 52 [ipccode 204] void ShowProgress([in] String progressKey, [in] IRemoteObject observer); 53 54 [ipccode 300] void HasPasteData([out] boolean funcResult); 55 [ipccode 301] void HasDataType([in] String mimeType, [out] boolean funcResult); 56 [ipccode 302] void GetMimeTypes([out] String[] funcResult); 57 [ipccode 303] void GetDataSource([out] String bundleName); 58 [ipccode 304] void IsRemoteData([out] boolean funcResult); 59 [ipccode 305] void GetChangeCount([out] unsigned int changeCount); 60 [ipccode 306] void DetectPatterns([in] Pattern[] patternsToCheck, [out] Pattern[] funcResult); 61 62 [ipccode 400] void SetGlobalShareOption([in] Map<unsigned int, int> globalShareOptions); 63 [ipccode 401] void RemoveGlobalShareOption([in] unsigned int[] tokenIds); 64 [ipccode 402] void GetGlobalShareOption([in] unsigned int[] tokenIds, [out] Map<unsigned int, int> funcResult); 65 [ipccode 403] void SetAppShareOptions([in] int shareOptions); 66 [ipccode 404] void RemoveAppShareOptions(); 67} 68