PageRenderTime 33ms CodeModel.GetById 21ms app.highlight 7ms RepoModel.GetById 2ms 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
  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
 28#ifndef LL_LLNOTIFICATION_VISIBILITY_RULE_H
 29#define LL_LLNOTIFICATION_VISIBILITY_RULE_H
 30
 31#include "llinitparam.h"
 32//#include "llnotifications.h"
 33
 34
 35
 36// This is the class of object read from the XML file (notification_visibility.xml, 
 37// from the appropriate local language directory).
 38struct LLNotificationVisibilityRule
 39{
 40	struct Filter : public LLInitParam::Block<Filter>
 41	{
 42		Optional<std::string>	type,
 43								tag,
 44								name;
 45
 46		Filter()
 47		:	type("type"),
 48			tag("tag"),
 49			name("name")
 50		{}
 51	};
 52
 53	struct Respond : public LLInitParam::Block<Respond, Filter>
 54	{
 55		Mandatory<std::string> response;
 56
 57		Respond()
 58		:	response("response")
 59		{}
 60	};
 61
 62	struct Rule : public LLInitParam::ChoiceBlock<Rule>
 63	{
 64		Alternative<Filter>		show;
 65		Alternative<Filter>		hide;
 66		Alternative<Respond>	respond;
 67
 68		Rule()
 69		:	show("show"),
 70			hide("hide"),
 71			respond("respond")
 72		{}
 73	};
 74
 75	struct Rules : public LLInitParam::Block<Rules>
 76	{
 77		Multiple<Rule>	rules;
 78
 79		Rules()
 80		:	rules("")
 81		{}
 82	};
 83
 84	LLNotificationVisibilityRule(const Rule& p);
 85	
 86    // If true, this rule makes matching notifications visible.  Otherwise, it makes them invisible.
 87    bool mVisible;
 88
 89    // Which response to give when making a notification invisible.  An empty string means the notification should be cancelled instead of responded to.
 90	std::string mResponse;
 91
 92    // String to match against the notification's "type".  An empty string matches all notifications.
 93    std::string mType;
 94	
 95    // String to match against the notification's tag(s).  An empty string matches all notifications.
 96	std::string mTag;
 97
 98    // String to match against the notification's name.  An empty string matches all notifications.
 99	std::string mName;
100	
101};
102
103#endif //LL_LLNOTIFICATION_VISIBILITY_RULE_H
104