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 SYSTEM_PASTEBOARD_IMPL_H 17 #define SYSTEM_PASTEBOARD_IMPL_H 18 19 #include "ffi_remote_data.h" 20 #include "paste_data_impl.h" 21 22 namespace OHOS { 23 namespace MiscServicesCj { 24 #define PASTEBOARD_SUCCESS 0 25 #define PASTEBOARD_IS_BEGING_PROCESSED 12900003 26 #define PASTEBOARD_COPY_FORBIDDEN 12900004 27 #define PASTEBOARD_INVALID_PARAMETERS 401 28 29 class SystemPasteboardImpl : public OHOS::FFI::FFIData { 30 public: 31 SystemPasteboardImpl(); 32 static int32_t GetSystemPasteboardImpl(int64_t &id); 33 int32_t SetData(sptr<PasteDataImpl> dataImpl, std::shared_ptr<MiscServices::PasteData> data); 34 sptr<PasteDataImpl> GetSystemPasteboardPasteDataImpl(); 35 int32_t GetData(MiscServices::PasteData &pasteData); 36 bool HasData(); 37 void ClearData(); 38 bool IsRemoteData(); 39 bool HasDataType(std::string mimeType); 40 std::string GetDataSource(); GetRuntimeType()41 OHOS::FFI::RuntimeType *GetRuntimeType() override { return GetClassType(); } 42 43 private: 44 friend class OHOS::FFI::RuntimeType; 45 friend class OHOS::FFI::TypeBase; 46 static OHOS::FFI::RuntimeType *GetClassType(); 47 sptr<PasteDataImpl> value_; 48 std::shared_ptr<MiscServices::PasteData> pasteData_; 49 }; 50 51 } 52 } 53 54 #endif