llstylemap.cpp

Go to the documentation of this file.
00001 
00032 #include "llviewerprecompiledheaders.h"
00033 
00034 #include "llstylemap.h"
00035 #include "llstring.h"
00036 #include "llui.h"
00037 #include "llviewercontrol.h"
00038 #include "llagent.h"
00039 
00040 LLStyleMap::LLStyleMap()
00041 {
00042 }
00043 
00044 LLStyleMap::~LLStyleMap()
00045 {
00046 }
00047 
00048 LLStyleMap &LLStyleMap::instance()
00049 {
00050         static LLStyleMap mStyleMap;
00051         return mStyleMap;
00052 }
00053 
00054 // This is similar to the [] accessor except that if the entry doesn't already exist,
00055 // then this will create the entry.
00056 const LLStyleSP &LLStyleMap::lookup(const LLUUID &source)
00057 {
00058         // Find this style in the map or add it if not.  This map holds links to residents' profiles.
00059         if (find(source) == end())
00060         {
00061                 LLStyleSP style(new LLStyle);
00062                 style->setVisible(true);
00063                 style->setFontName(LLString::null);
00064                 if (source != gAgent.getID() && source != LLUUID::null)
00065                 {
00066                         style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
00067                         LLString link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());
00068                         style->setLinkHREF(link);
00069                 }
00070                 else
00071                         style->setColor(LLColor4::white);
00072                 (*this)[source] = style;
00073         }
00074         return (*this)[source];
00075 }

Generated on Fri May 16 08:34:02 2008 for SecondLife by  doxygen 1.5.5