diff options
Diffstat (limited to 'indra/newview/llautoreplace.h')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llautoreplace.h | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/indra/newview/llautoreplace.h b/indra/newview/llautoreplace.h index f720cc4eda..9eecc2d981 100644..100755 --- a/indra/newview/llautoreplace.h +++ b/indra/newview/llautoreplace.h @@ -132,7 +132,7 @@ class LLAutoReplaceSettings LLSD getExampleLLSD(); /// Get the actual settings as LLSD - const LLSD& getAsLLSD(); + const LLSD& asLLSD(); ///< @note for use only in AutoReplace::saveToUserSettings private: @@ -183,49 +183,45 @@ class LLAutoReplaceSettings * When the end of a word is detected (defined as any punctuation character, * or any whitespace except newline or return), the preceding word is used * as a lookup key in an ordered list of maps. If a match is found in any - * map, the keyword is replaced by the associated value from the map. + * map, the replacement start index and length are returned along with the + * new replacement string. * * See the autoreplaceCallback method for how to add autoreplace functionality * to a text entry tool. */ class LLAutoReplace : public LLSingleton<LLAutoReplace> { - public: - LLAutoReplace(); - ~LLAutoReplace(); - - /// @return a pointer to the active instance - static LLAutoReplace* getInstance(); +public: + /// Callback that provides the hook for use in text entry methods + void autoreplaceCallback(S32& replacement_start, S32& replacement_length, LLWString& replacement_string, S32& cursor_pos, const LLWString& input_text); - /// Callback that provides the hook for use in text entry methods - void autoreplaceCallback(LLUIString& inputText, S32& cursorPos); + /// Get a copy of the current settings + LLAutoReplaceSettings getSettings(); - /// Get a copy of the current settings - LLAutoReplaceSettings getSettings(); + /// Commit new settings after making changes + void setSettings(const LLAutoReplaceSettings& settings); - /// Commit new settings after making changes - void setSettings(const LLAutoReplaceSettings& settings); - - private: - friend class LLSingleton<LLAutoReplace>; - static LLAutoReplace* sInstance; ///< the active settings instance +private: + friend class LLSingleton<LLAutoReplace>; + LLAutoReplace(); + /*virtual*/ void initSingleton(); - LLAutoReplaceSettings mSettings; ///< configuration information + LLAutoReplaceSettings mSettings; ///< configuration information - /// Read settings from persistent storage - void loadFromSettings(); + /// Read settings from persistent storage + void loadFromSettings(); - /// Make the newSettings active and write them to user storage - void saveToUserSettings(); + /// Make the newSettings active and write them to user storage + void saveToUserSettings(); - /// Compute the user settings file name - std::string getUserSettingsFileName(); + /// Compute the user settings file name + std::string getUserSettingsFileName(); - /// Compute the (read-ony) application settings file name - std::string getAppSettingsFileName(); + /// Compute the (read-ony) application settings file name + std::string getAppSettingsFileName(); - /// basename for the settings files - static const char* SETTINGS_FILE_NAME; + /// basename for the settings files + static const char* SETTINGS_FILE_NAME; }; #endif /* LLAUTOREPLACE_H */ |