/indra/newview/llstylemap.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 51 lines · 15 code · 8 blank · 28 comment · 0 complexity · 1bac7b2ea04503da27821ed95e74f72b MD5 · raw file

  1. /**
  2. * @file LLStyleMap.h
  3. * @brief LLStyleMap class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLSTYLE_MAP_H
  27. #define LL_LLSTYLE_MAP_H
  28. #include "llstyle.h"
  29. #include "lluuid.h"
  30. #include "llsingleton.h"
  31. // Lightweight class for holding and managing mappings between UUIDs and links.
  32. // Used (for example) to create clickable name links off of IM chat.
  33. typedef std::map<LLUUID, LLStyle::Params> style_map_t;
  34. class LLStyleMap : public LLSingleton<LLStyleMap>
  35. {
  36. public:
  37. // Just like the [] accessor but it will add the entry in if it doesn't exist.
  38. const LLStyle::Params &lookupAgent(const LLUUID &source);
  39. const LLStyle::Params &lookup(const LLUUID &source, const std::string& link);
  40. private:
  41. style_map_t mMap;
  42. };
  43. #endif // LL_LLSTYLE_MAP_H