/** * @file llgestureautocompletehelper.h * * $LicenseInfo:firstyear=2026&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2026, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #pragma once #include "llhandle.h" #include "llsingleton.h" #include #include #include #include class LLFloater; class LLUICtrl; class LLGestureAutocompleteHelper : public LLSingleton { LLSINGLETON(LLGestureAutocompleteHelper) {} ~LLGestureAutocompleteHelper() override {} public: struct Row { std::string value; std::string trigger; std::string name; }; bool isActive(const LLUICtrl* ctrl) const; void showHelper( LLUICtrl* host_ctrl, const std::vector& rows, size_t total, std::function commit_cb); void hideHelper(const LLUICtrl* ctrl = nullptr); bool handleKey(const LLUICtrl* ctrl, KEY key, MASK mask); void onCommitGesture(const std::string& trigger); const std::vector& rows() const { return mRows; } size_t total() const { return mTotal; } protected: void setHostCtrl(LLUICtrl* host_ctrl); LLUICtrl* getHostCtrl() const { return mHostHandle.get(); } private: void refreshPicker(); LLHandle mHostHandle; LLHandle mHelperHandle; boost::signals2::connection mHostCtrlFocusLostConn; boost::signals2::connection mHelperCommitConn; std::function mGestureCommitCb; std::vector mRows; size_t mTotal = 0; };