diff options
Diffstat (limited to 'indra/llui/llcommandmanager.h')
-rw-r--r-- | indra/llui/llcommandmanager.h | 66 |
1 files changed, 55 insertions, 11 deletions
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index 6481a05689..8f9f956ec7 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -52,22 +52,34 @@ public: LLCommandId(const std::string& name) : mName(name) - {} + { + mUUID = LLUUID::generateNewID(name); + } LLCommandId(const Params& p) : mName(p.name) - {} + { + mUUID = LLUUID::generateNewID(p.name); + } + LLCommandId(const LLUUID& uuid) + : mName(""), + mUUID(uuid) + + { + } + const std::string& name() const { return mName; } + const LLUUID& uuid() const { return mUUID; } bool operator!=(const LLCommandId& command) const { - return (mName != command.mName); + return (mUUID != command.mUUID); } bool operator==(const LLCommandId& command) const { - return (mName == command.mName); + return (mUUID == command.mUUID); } bool operator<(const LLCommandId& command) const @@ -79,45 +91,77 @@ public: private: std::string mName; + LLUUID mUUID; }; typedef std::list<LLCommandId> command_id_list_t; + class LLCommand { public: struct Params : public LLInitParam::Block<Params> { Mandatory<bool> available_in_toybox; - Mandatory<std::string> function; Mandatory<std::string> icon; Mandatory<std::string> label_ref; Mandatory<std::string> name; - Optional<LLSD> parameter; Mandatory<std::string> tooltip_ref; + Mandatory<std::string> execute_function; + Optional<LLSD> execute_parameters; + + Optional<std::string> is_enabled_function; + Optional<LLSD> is_enabled_parameters; + + Optional<std::string> is_running_function; + Optional<LLSD> is_running_parameters; + + Optional<std::string> is_starting_function; + Optional<LLSD> is_starting_parameters; + Params(); }; LLCommand(const LLCommand::Params& p); const bool availableInToybox() const { return mAvailableInToybox; } - const std::string& functionName() const { return mFunction; } const std::string& icon() const { return mIcon; } const LLCommandId& id() const { return mIdentifier; } const std::string& labelRef() const { return mLabelRef; } - const LLSD& parameter() const { return mParameter; } const std::string& tooltipRef() const { return mTooltipRef; } + const std::string& executeFunctionName() const { return mExecuteFunction; } + const LLSD& executeParameters() const { return mExecuteParameters; } + + const std::string& isEnabledFunctionName() const { return mIsEnabledFunction; } + const LLSD& isEnabledParameters() const { return mIsEnabledParameters; } + + const std::string& isRunningFunctionName() const { return mIsRunningFunction; } + const LLSD& isRunningParameters() const { return mIsRunningParameters; } + + const std::string& isStartingFunctionName() const { return mIsStartingFunction; } + const LLSD& isStartingParameters() const { return mIsStartingParameters; } + private: LLCommandId mIdentifier; bool mAvailableInToybox; - std::string mFunction; std::string mIcon; std::string mLabelRef; - LLSD mParameter; std::string mTooltipRef; + + std::string mExecuteFunction; + LLSD mExecuteParameters; + + std::string mIsEnabledFunction; + LLSD mIsEnabledParameters; + + std::string mIsRunningFunction; + LLSD mIsRunningParameters; + + std::string mIsStartingFunction; + LLSD mIsStartingParameters; }; @@ -148,7 +192,7 @@ protected: void addCommand(LLCommand * command); private: - typedef std::map<LLCommandId, U32> CommandIndexMap; + typedef std::map<LLUUID, U32> CommandIndexMap; typedef std::vector<LLCommand *> CommandVector; CommandVector mCommands; |