PageRenderTime 27ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llui/llnotificationvisibilityrule.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 104 lines | 49 code | 21 blank | 34 comment | 0 complexity | a85a56bfc65d072cc43dac76e1bc06fb MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llnotificationvisibility.h
  3. * @brief Rules for
  4. * @author Monroe
  5. *
  6. * $LicenseInfo:firstyear=2010&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLNOTIFICATION_VISIBILITY_RULE_H
  28. #define LL_LLNOTIFICATION_VISIBILITY_RULE_H
  29. #include "llinitparam.h"
  30. //#include "llnotifications.h"
  31. // This is the class of object read from the XML file (notification_visibility.xml,
  32. // from the appropriate local language directory).
  33. struct LLNotificationVisibilityRule
  34. {
  35. struct Filter : public LLInitParam::Block<Filter>
  36. {
  37. Optional<std::string> type,
  38. tag,
  39. name;
  40. Filter()
  41. : type("type"),
  42. tag("tag"),
  43. name("name")
  44. {}
  45. };
  46. struct Respond : public LLInitParam::Block<Respond, Filter>
  47. {
  48. Mandatory<std::string> response;
  49. Respond()
  50. : response("response")
  51. {}
  52. };
  53. struct Rule : public LLInitParam::ChoiceBlock<Rule>
  54. {
  55. Alternative<Filter> show;
  56. Alternative<Filter> hide;
  57. Alternative<Respond> respond;
  58. Rule()
  59. : show("show"),
  60. hide("hide"),
  61. respond("respond")
  62. {}
  63. };
  64. struct Rules : public LLInitParam::Block<Rules>
  65. {
  66. Multiple<Rule> rules;
  67. Rules()
  68. : rules("")
  69. {}
  70. };
  71. LLNotificationVisibilityRule(const Rule& p);
  72. // If true, this rule makes matching notifications visible. Otherwise, it makes them invisible.
  73. bool mVisible;
  74. // Which response to give when making a notification invisible. An empty string means the notification should be cancelled instead of responded to.
  75. std::string mResponse;
  76. // String to match against the notification's "type". An empty string matches all notifications.
  77. std::string mType;
  78. // String to match against the notification's tag(s). An empty string matches all notifications.
  79. std::string mTag;
  80. // String to match against the notification's name. An empty string matches all notifications.
  81. std::string mName;
  82. };
  83. #endif //LL_LLNOTIFICATION_VISIBILITY_RULE_H