PageRenderTime 21ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llnamebox.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 76 lines | 36 code | 15 blank | 25 comment | 0 complexity | 3a6fc3e9a25b70b1f458898bcb34c334 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llnamebox.h
  3. * @brief display and refresh a name from the name cache
  4. *
  5. * $LicenseInfo:firstyear=2003&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_LLNAMEBOX_H
  27. #define LL_LLNAMEBOX_H
  28. #include <set>
  29. #include "llview.h"
  30. #include "llstring.h"
  31. #include "llfontgl.h"
  32. #include "lltextbox.h"
  33. class LLNameBox
  34. : public LLTextBox
  35. {
  36. public:
  37. struct Params : public LLInitParam::Block<Params, LLTextBox::Params>
  38. {
  39. Optional<bool> is_group;
  40. Optional<bool> link;
  41. Params()
  42. : is_group("is_group", false)
  43. , link("link", false)
  44. {}
  45. };
  46. virtual ~LLNameBox();
  47. void setNameID(const LLUUID& name_id, BOOL is_group);
  48. void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
  49. static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
  50. protected:
  51. LLNameBox (const Params&);
  52. friend class LLUICtrlFactory;
  53. private:
  54. void setName(const std::string& name, BOOL is_group);
  55. static std::set<LLNameBox*> sInstances;
  56. private:
  57. LLUUID mNameID;
  58. BOOL mLink;
  59. std::string mInitialValue;
  60. };
  61. #endif