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