diff options
author | Richard Nelson <richard@lindenlab.com> | 2009-08-24 20:04:52 +0000 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2009-08-24 20:04:52 +0000 |
commit | 138bf1132262c479dbbd5c95195db46b1efd065f (patch) | |
tree | be2286f245865008b4ca6d738194133542822d65 /indra/llui/llstyle.h | |
parent | c2619694fd2f94ad7da2d6e936494f4c16601212 (diff) |
merge -r 130399-131510 skinning-21 -> viewer-2.0.0-3
DEV-11254 DEV-11254 DEV-2003: DEV-21567 DEV-37301 EXT-104 EXT-138 EXT-217 EXT-256 EXT-259 EXT-259 EXT-328 EXT-348 EXT-386 EXT-399 EXT-403 EXT-460 EXT-492 EXT-492 EXT-531 EXT-537 EXT-684
improved text editor (handles multiple fonts simultaneously as well as inline widgets)
Diffstat (limited to 'indra/llui/llstyle.h')
-rw-r--r-- | indra/llui/llstyle.h | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index 32ddded2c8..dcf274a651 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -35,59 +35,59 @@ #include "v4color.h" #include "llui.h" +#include "llinitparam.h" class LLFontGL; class LLStyle : public LLRefCount { public: - LLStyle(); - LLStyle(const LLStyle &style); - LLStyle(BOOL is_visible, const LLColor4 &color, const std::string& font_name); - - LLStyle &operator=(const LLStyle &rhs); - - virtual void init (BOOL is_visible, const LLColor4 &color, const std::string& font_name); - - virtual const LLColor4& getColor() const { return mColor; } - virtual void setColor(const LLColor4 &color) { mColor = color; } - - virtual BOOL isVisible() const; - virtual void setVisible(BOOL is_visible); + struct Params : public LLInitParam::Block<Params> + { + Optional<bool> visible, + drop_shadow; + Optional<LLUIColor> color; + Optional<const LLFontGL*> font; + Optional<LLUIImage*> image; + Optional<std::string> link_href; + Params(); + }; + LLStyle(const Params& p = Params()); +public: + const LLColor4& getColor() const { return mColor; } + void setColor(const LLColor4 &color) { mColor = color; } - virtual const std::string& getFontString() const; - virtual void setFontName(const std::string& fontname); - virtual LLFontGL* getFont() const; + BOOL isVisible() const; + void setVisible(BOOL is_visible); - virtual const std::string& getLinkHREF() const { return mLink; } - virtual void setLinkHREF(const std::string& href); - virtual BOOL isLink() const; + void setFont(const LLFontGL* font); + const LLFontGL* getFont() const; - virtual LLUIImagePtr getImage() const; - virtual void setImage(const LLUUID& src); + const std::string& getLinkHREF() const { return mLink; } + void setLinkHREF(const std::string& href); + BOOL isLink() const; - virtual BOOL isImage() const { return ((mImageWidth != 0) && (mImageHeight != 0)); } - virtual void setImageSize(S32 width, S32 height); + LLUIImagePtr getImage() const; + void setImage(const LLUUID& src); - BOOL getIsEmbeddedItem() const { return mIsEmbeddedItem; } - void setIsEmbeddedItem( BOOL b ) { mIsEmbeddedItem = b; } + BOOL isImage() const { return ((mImageWidth != 0) && (mImageHeight != 0)); } + void setImageSize(S32 width, S32 height); // inlined here to make it easier to compare to member data below. -MG bool operator==(const LLStyle &rhs) const { return - mVisible == rhs.isVisible() - && mColor == rhs.getColor() - && mFontName == rhs.getFontString() - && mLink == rhs.getLinkHREF() + mVisible == rhs.mVisible + && mColor == rhs.mColor + && mFont == rhs.mFont + && mLink == rhs.mLink && mImagep == rhs.mImagep && mImageHeight == rhs.mImageHeight && mImageWidth == rhs.mImageWidth && mItalic == rhs.mItalic && mBold == rhs.mBold && mUnderline == rhs.mUnderline - && mDropShadow == rhs.mDropShadow - && mIsEmbeddedItem == rhs.mIsEmbeddedItem; + && mDropShadow == rhs.mDropShadow; } bool operator!=(const LLStyle& rhs) const { return !(*this == rhs); } @@ -101,16 +101,15 @@ public: S32 mImageHeight; protected: - virtual ~LLStyle() { } + ~LLStyle() { } private: BOOL mVisible; LLUIColor mColor; std::string mFontName; - LLFontGL* mFont; // cached for performance + const LLFontGL* mFont; // cached for performance std::string mLink; LLUIImagePtr mImagep; - BOOL mIsEmbeddedItem; }; typedef LLPointer<LLStyle> LLStyleSP; |