PageRenderTime 75ms CodeModel.GetById 63ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llui/llwindowshade.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 78 lines | 41 code | 12 blank | 25 comment | 0 complexity | 97042d75771b446039521bc689f81dbd MD5 | raw file
 1/**
 2 * @file llwindowshade.h
 3 * @brief Notification dialog that slides down and optionally disabled a piece of UI
 4 *
 5 * $LicenseInfo:firstyear=2006&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
27#ifndef LL_LLWINDOWSHADE_H
28#define LL_LLWINDOWSHADE_H
29
30#include "lluictrl.h"
31#include "llnotifications.h"
32#include "lluiimage.h"
33
34class LLWindowShade : public LLUICtrl
35{
36public:
37	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
38	{
39		Optional<LLUIImage*>			bg_image;
40		Optional<LLUIColor>				text_color,
41										shade_color;
42		Optional<bool>					modal,
43										can_close;
44
45		Params();
46	};
47
48	void show(LLNotificationPtr);
49	/*virtual*/ void draw();
50	void hide();
51	
52	bool isShown() const;
53
54	void setBackgroundImage(LLUIImage* image);
55	void setTextColor(LLColor4 color);
56	void setCanClose(bool can_close);
57
58private:
59	void displayLatestNotification();
60	LLNotificationPtr getCurrentNotification();
61	friend class LLUICtrlFactory;
62
63	LLWindowShade(const Params& p);
64	void initFromParams(const Params& params);
65
66	void onCloseNotification();
67	void onClickNotificationButton(const std::string& name);
68	void onEnterNotificationText(LLUICtrl* ctrl, const std::string& name);
69	void onClickIgnore(LLUICtrl* ctrl);
70
71	std::vector<LLNotificationPtr>	mNotifications;
72	LLSD				mNotificationResponse;
73	bool				mModal;
74	S32					mFormHeight;
75	LLUIColor			mTextColor;
76};
77
78#endif // LL_LLWINDOWSHADE_H