summaryrefslogtreecommitdiff
path: root/indra/llui/llstyle.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llstyle.h')
-rw-r--r--indra/llui/llstyle.h67
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;