diff --git a/native/cocos/platform/openharmony/modules/System.cpp b/native/cocos/platform/openharmony/modules/System.cpp index 7477ac368a..3d17a02c77 100644 --- a/native/cocos/platform/openharmony/modules/System.cpp +++ b/native/cocos/platform/openharmony/modules/System.cpp @@ -103,4 +103,8 @@ bool System::openURL(const std::string& url) { return false; } -} // namespace cc \ No newline at end of file +void System::copyTextToClipboard(const std::string& text) { + //copyTextToClipboardJNI(text); +} + +} // namespace cc diff --git a/native/cocos/platform/openharmony/modules/System.h b/native/cocos/platform/openharmony/modules/System.h index b1b5ab36a2..c2f2d791c2 100644 --- a/native/cocos/platform/openharmony/modules/System.h +++ b/native/cocos/platform/openharmony/modules/System.h @@ -62,6 +62,7 @@ public: @return True if the resource located by the URL was successfully opened; otherwise false. */ bool openURL(const std::string& url) override; + void copyTextToClipboard(const std::string& text) override; }; } // namespace cc \ No newline at end of file diff --git a/native/cocos/platform/openharmony/modules/SystemWindow.cpp b/native/cocos/platform/openharmony/modules/SystemWindow.cpp index 22ef3c10a1..a5c60667c2 100644 --- a/native/cocos/platform/openharmony/modules/SystemWindow.cpp +++ b/native/cocos/platform/openharmony/modules/SystemWindow.cpp @@ -59,10 +59,6 @@ bool SystemWindow::createWindow(const char* title, void SystemWindow::setCursorEnabled(bool value) { } -void SystemWindow::copyTextToClipboard(const std::string& text) { - //copyTextToClipboardJNI(text); -} - uint32_t SystemWindow::getWindowId() const { return _windowId; } diff --git a/native/cocos/platform/openharmony/modules/SystemWindow.h b/native/cocos/platform/openharmony/modules/SystemWindow.h index 91fe8d7973..41a1b37698 100644 --- a/native/cocos/platform/openharmony/modules/SystemWindow.h +++ b/native/cocos/platform/openharmony/modules/SystemWindow.h @@ -51,7 +51,7 @@ public: @brief enable/disable(lock) the cursor, default is enabled */ void setCursorEnabled(bool value) override; - void copyTextToClipboard(const std::string& text) override; + private: void* _windowHandle{nullptr}; uint32_t _windowId{0};