PageRenderTime 31ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llagentaccess.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 86 lines | 37 code | 15 blank | 34 comment | 0 complexity | 3ab86bfa5e6e6aca546afbccc6241985 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llagentaccess.h
  3. * @brief LLAgentAccess class implementation - manages maturity and godmode info
  4. *
  5. * $LicenseInfo:firstyear=2001&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_LLAGENTACCESS_H
  27. #define LL_LLAGENTACCESS_H
  28. #include "stdtypes.h"
  29. // forward declaration so that we don't have to include the whole class
  30. class LLControlGroup;
  31. class LLAgentAccess
  32. {
  33. public:
  34. LLAgentAccess(LLControlGroup& savedSettings);
  35. bool getAdminOverride() const;
  36. void setAdminOverride(bool b);
  37. void setGodLevel(U8 god_level);
  38. bool isGodlike() const;
  39. bool isGodlikeWithoutAdminMenuFakery() const;
  40. U8 getGodLevel() const;
  41. // rather than just expose the preference setting, we're going to actually
  42. // expose what the client code cares about -- what the user should see
  43. // based on a combination of the is* and prefers* flags, combined with God bit.
  44. bool wantsPGOnly() const;
  45. bool canAccessMature() const;
  46. bool canAccessAdult() const;
  47. bool prefersPG() const;
  48. bool prefersMature() const;
  49. bool prefersAdult() const;
  50. bool isTeen() const;
  51. bool isMature() const;
  52. bool isAdult() const;
  53. void setTeen(bool teen);
  54. void setMaturity(char text);
  55. static int convertTextToMaturity(char text);
  56. void setTransition(); // sets the transition bit, which defaults to false
  57. bool isInTransition() const;
  58. bool canSetMaturity(S32 maturity);
  59. private:
  60. U8 mAccess; // SIM_ACCESS_MATURE etc
  61. U8 mGodLevel;
  62. bool mAdminOverride;
  63. // this should be deleted after the 60-day AO transition.
  64. // It should be safe to remove it in Viewer 2009
  65. // It's set by a special short-term flag in login.cgi
  66. // called ao_transition. When that's gone, this can go, along with
  67. // all of the code that depends on it.
  68. bool mAOTransition;
  69. LLControlGroup& mSavedSettings;
  70. };
  71. #endif // LL_LLAGENTACCESS_H