summaryrefslogtreecommitdiff
path: root/indra/newview/llautoreplace.h
diff options
context:
space:
mode:
authorcallum_linden <none@none>2013-04-17 13:38:04 -0700
committercallum_linden <none@none>2013-04-17 13:38:04 -0700
commit88eff41649b13f00f636e54e093fd5b8becf5f8c (patch)
treef099a81df2c66e9940aa85ad1f47cc982a5eecc1 /indra/newview/llautoreplace.h
parent010c87788d5c698d6cfe5782ac02d9a3924124cf (diff)
parentfac6ee27f2d3277494f011271064b0e5e7e02554 (diff)
Merge with viewer-development
Diffstat (limited to 'indra/newview/llautoreplace.h')
-rw-r--r--indra/newview/llautoreplace.h54
1 files changed, 25 insertions, 29 deletions
diff --git a/indra/newview/llautoreplace.h b/indra/newview/llautoreplace.h
index f720cc4eda..9eecc2d981 100644
--- 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 */