PageRenderTime 35ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/llavatarname.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 95 lines | 23 code | 17 blank | 55 comment | 0 complexity | 097a2e18f9da8d210d8afe4308ec2de6 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llavatarname.h
  3. * @brief Represents name-related data for an avatar, such as the
  4. * username/SLID ("bobsmith123" or "james.linden") and the display
  5. * name ("James Cook")
  6. *
  7. * $LicenseInfo:firstyear=2010&license=viewerlgpl$
  8. * Second Life Viewer Source Code
  9. * Copyright (C) 2010, Linden Research, Inc.
  10. *
  11. * This library is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU Lesser General Public
  13. * License as published by the Free Software Foundation;
  14. * version 2.1 of the License only.
  15. *
  16. * This library is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * Lesser General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public
  22. * License along with this library; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. *
  25. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  26. * $/LicenseInfo$
  27. */
  28. #ifndef LLAVATARNAME_H
  29. #define LLAVATARNAME_H
  30. #include <string>
  31. class LLSD;
  32. class LL_COMMON_API LLAvatarName
  33. {
  34. public:
  35. LLAvatarName();
  36. bool operator<(const LLAvatarName& rhs) const;
  37. LLSD asLLSD() const;
  38. void fromLLSD(const LLSD& sd);
  39. // For normal names, returns "James Linden (james.linden)"
  40. // When display names are disabled returns just "James Linden"
  41. std::string getCompleteName() const;
  42. // Returns "James Linden" or "bobsmith123 Resident" for backwards
  43. // compatibility with systems like voice and muting
  44. // *TODO: Eliminate this in favor of username only
  45. std::string getLegacyName() const;
  46. // "bobsmith123" or "james.linden", US-ASCII only
  47. std::string mUsername;
  48. // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode
  49. // Contains data whether or not user has explicitly set
  50. // a display name; may duplicate their username.
  51. std::string mDisplayName;
  52. // For "James Linden", "James"
  53. // For "bobsmith123", "bobsmith123"
  54. // Used to communicate with legacy systems like voice and muting which
  55. // rely on old-style names.
  56. // *TODO: Eliminate this in favor of username only
  57. std::string mLegacyFirstName;
  58. // For "James Linden", "Linden"
  59. // For "bobsmith123", "Resident"
  60. // see above for rationale
  61. std::string mLegacyLastName;
  62. // If true, both display name and SLID were generated from
  63. // a legacy first and last name, like "James Linden (james.linden)"
  64. bool mIsDisplayNameDefault;
  65. // Under error conditions, we may insert "dummy" records with
  66. // names like "???" into caches as placeholders. These can be
  67. // shown in UI, but are not serialized.
  68. bool mIsTemporaryName;
  69. // Names can change, so need to keep track of when name was
  70. // last checked.
  71. // Unix time-from-epoch seconds for efficiency
  72. F64 mExpires;
  73. // You can only change your name every N hours, so record
  74. // when the next update is allowed
  75. // Unix time-from-epoch seconds
  76. F64 mNextUpdate;
  77. };
  78. #endif