#3758 clean up: move EUnderlineLink
parent
f450b42acf
commit
1eb34b43fb
|
|
@ -37,7 +37,7 @@ bool LLChatMentionHelper::isActive(const LLUICtrl* ctrl) const
|
|||
return mHostHandle.get() == ctrl;
|
||||
}
|
||||
|
||||
bool LLChatMentionHelper::isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos)
|
||||
bool LLChatMentionHelper::isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos) const
|
||||
{
|
||||
if (cursor_pos <= 0 || cursor_pos > static_cast<S32>(wtext.size()))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class LLChatMentionHelper : public LLSingleton<LLChatMentionHelper>
|
|||
public:
|
||||
|
||||
bool isActive(const LLUICtrl* ctrl) const;
|
||||
bool isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos = nullptr);
|
||||
bool isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos = nullptr) const;
|
||||
void showHelper(LLUICtrl* host_ctrl, S32 local_x, S32 local_y, const std::string& av_name, std::function<void(std::string)> commit_cb);
|
||||
void hideHelper(const LLUICtrl* ctrl = nullptr);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,14 @@ public:
|
|||
Params();
|
||||
};
|
||||
LLStyle(const Params& p = Params());
|
||||
|
||||
enum EUnderlineLink
|
||||
{
|
||||
UNDERLINE_ALWAYS = 0,
|
||||
UNDERLINE_ON_HOVER,
|
||||
UNDERLINE_NEVER
|
||||
};
|
||||
|
||||
public:
|
||||
const LLUIColor& getColor() const { return mColor; }
|
||||
void setColor(const LLUIColor &color) { mColor = color; }
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ protected:
|
|||
bool operator()(const LLTextSegmentPtr& a, const LLTextSegmentPtr& b) const;
|
||||
};
|
||||
typedef std::multiset<LLTextSegmentPtr, compare_segment_end> segment_set_t;
|
||||
typedef LLUrlMatch::EUnderlineLink e_underline;
|
||||
typedef LLStyle::EUnderlineLink e_underline;
|
||||
|
||||
// member functions
|
||||
LLTextBase(const Params &p);
|
||||
|
|
|
|||
|
|
@ -666,14 +666,14 @@ std::string LLUrlEntryAgent::getTooltip(const std::string &string) const
|
|||
return LLTrans::getString("TooltipAgentUrl");
|
||||
}
|
||||
|
||||
LLUrlMatch::EUnderlineLink LLUrlEntryAgent::getUnderline(const std::string& string) const
|
||||
LLStyle::EUnderlineLink LLUrlEntryAgent::getUnderline(const std::string& string) const
|
||||
{
|
||||
std::string url = getUrl(string);
|
||||
if (LLStringUtil::endsWith(url, "/about") || LLStringUtil::endsWith(url, "/inspect"))
|
||||
{
|
||||
return LLUrlMatch::EUnderlineLink::UNDERLINE_ON_HOVER;
|
||||
return LLStyle::EUnderlineLink::UNDERLINE_ON_HOVER;
|
||||
}
|
||||
return LLUrlMatch::EUnderlineLink::UNDERLINE_ALWAYS;
|
||||
return LLStyle::EUnderlineLink::UNDERLINE_ALWAYS;
|
||||
}
|
||||
|
||||
std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
|
||||
|
|
@ -781,9 +781,9 @@ LLUrlEntryAgentMention::LLUrlEntryAgentMention()
|
|||
mIcon = std::string();
|
||||
}
|
||||
|
||||
LLUrlMatch::EUnderlineLink LLUrlEntryAgentMention::getUnderline(const std::string& string) const
|
||||
LLStyle::EUnderlineLink LLUrlEntryAgentMention::getUnderline(const std::string& string) const
|
||||
{
|
||||
return LLUrlMatch::EUnderlineLink::UNDERLINE_NEVER;
|
||||
return LLStyle::EUnderlineLink::UNDERLINE_NEVER;
|
||||
}
|
||||
|
||||
LLStyle::Params LLUrlEntryAgentMention::getStyle(const std::string& url) const
|
||||
|
|
@ -1406,7 +1406,7 @@ std::string LLUrlEntrySLLabel::getTooltip(const std::string &string) const
|
|||
return LLUrlEntryBase::getTooltip(string);
|
||||
}
|
||||
|
||||
LLUrlMatch::EUnderlineLink LLUrlEntrySLLabel::getUnderline(const std::string& string) const
|
||||
LLStyle::EUnderlineLink LLUrlEntrySLLabel::getUnderline(const std::string& string) const
|
||||
{
|
||||
std::string url = getUrl(string);
|
||||
LLUrlMatch match;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include "llavatarname.h"
|
||||
#include "llhost.h" // for resolving parcel name by parcel id
|
||||
#include "llurlmatch.h"
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
|
@ -97,7 +96,7 @@ public:
|
|||
/// Return the name of a SL location described by this Url, if any
|
||||
virtual std::string getLocation(const std::string &url) const { return ""; }
|
||||
|
||||
virtual LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const { return LLUrlMatch::EUnderlineLink::UNDERLINE_ALWAYS; }
|
||||
virtual LLStyle::EUnderlineLink getUnderline(const std::string& string) const { return LLStyle::EUnderlineLink::UNDERLINE_ALWAYS; }
|
||||
|
||||
virtual bool isTrusted() const { return false; }
|
||||
|
||||
|
|
@ -233,7 +232,7 @@ public:
|
|||
/*virtual*/ LLStyle::Params getStyle(const std::string &url) const;
|
||||
/*virtual*/ LLUUID getID(const std::string &string) const;
|
||||
|
||||
LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const;
|
||||
LLStyle::EUnderlineLink getUnderline(const std::string& string) const;
|
||||
|
||||
protected:
|
||||
/*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon);
|
||||
|
|
@ -253,7 +252,7 @@ public:
|
|||
LLUrlEntryAgentMention();
|
||||
|
||||
LLStyle::Params getStyle(const std::string& url) const;
|
||||
LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const;
|
||||
LLStyle::EUnderlineLink getUnderline(const std::string& string) const;
|
||||
bool getSkipProfileIcon(const std::string& string) const { return true; };
|
||||
};
|
||||
|
||||
|
|
@ -505,7 +504,7 @@ public:
|
|||
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
|
||||
/*virtual*/ std::string getUrl(const std::string &string) const;
|
||||
/*virtual*/ std::string getTooltip(const std::string &string) const;
|
||||
LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const;
|
||||
LLStyle::EUnderlineLink getUnderline(const std::string& string) const;
|
||||
};
|
||||
|
||||
///
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ LLUrlMatch::LLUrlMatch() :
|
|||
mIcon(""),
|
||||
mMenuName(""),
|
||||
mLocation(""),
|
||||
mUnderline(UNDERLINE_ALWAYS),
|
||||
mUnderline(e_underline::UNDERLINE_ALWAYS),
|
||||
mTrusted(false),
|
||||
mSkipProfileIcon(false)
|
||||
{
|
||||
|
|
@ -47,7 +47,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std
|
|||
const std::string& query, const std::string &tooltip,
|
||||
const std::string &icon, const LLStyle::Params& style,
|
||||
const std::string &menu, const std::string &location,
|
||||
const LLUUID& id, EUnderlineLink underline, bool trusted, bool skip_icon)
|
||||
const LLUUID& id, e_underline underline, bool trusted, bool skip_icon)
|
||||
{
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
|
|
|
|||
|
|
@ -46,13 +46,6 @@ class LLUrlMatch
|
|||
public:
|
||||
LLUrlMatch();
|
||||
|
||||
enum EUnderlineLink
|
||||
{
|
||||
UNDERLINE_ALWAYS = 0,
|
||||
UNDERLINE_ON_HOVER,
|
||||
UNDERLINE_NEVER
|
||||
};
|
||||
|
||||
/// return true if this object does not contain a valid Url match yet
|
||||
bool empty() const { return mUrl.empty(); }
|
||||
|
||||
|
|
@ -86,7 +79,8 @@ public:
|
|||
/// return the SL location that this Url describes, or "" if none.
|
||||
std::string getLocation() const { return mLocation; }
|
||||
|
||||
EUnderlineLink getUnderline() const { return mUnderline; }
|
||||
typedef LLStyle::EUnderlineLink e_underline;
|
||||
e_underline getUnderline() const { return mUnderline; }
|
||||
|
||||
/// Return true if Url is trusted.
|
||||
bool isTrusted() const { return mTrusted; }
|
||||
|
|
@ -98,7 +92,7 @@ public:
|
|||
const std::string& query, const std::string &tooltip, const std::string &icon,
|
||||
const LLStyle::Params& style, const std::string &menu,
|
||||
const std::string &location, const LLUUID& id,
|
||||
EUnderlineLink underline = UNDERLINE_ALWAYS, bool trusted = false, bool skip_icon = false);
|
||||
e_underline underline = e_underline::UNDERLINE_ALWAYS, bool trusted = false, bool skip_icon = false);
|
||||
|
||||
const LLUUID& getID() const { return mID; }
|
||||
private:
|
||||
|
|
@ -113,7 +107,7 @@ private:
|
|||
std::string mLocation;
|
||||
LLUUID mID;
|
||||
LLStyle::Params mStyle;
|
||||
EUnderlineLink mUnderline;
|
||||
e_underline mUnderline;
|
||||
bool mTrusted;
|
||||
bool mSkipProfileIcon;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue