PageRenderTime 182ms CodeModel.GetById 70ms app.highlight 3ms RepoModel.GetById 108ms app.codeStats 0ms

/indra/newview/lltoastpanel.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 70 lines | 25 code | 9 blank | 36 comment | 0 complexity | e81c7feae9dd420df991599f8828f9d3 MD5 | raw file
 1/** 
 2 * @file lltoastpanel.h
 3 * @brief Creates a panel of a specific kind for a toast.
 4 *
 5 * $LicenseInfo:firstyear=2003&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_LLTOASTPANEL_H
28#define LL_LLTOASTPANEL_H
29
30#include "llpanel.h"
31#include "lltextbox.h"
32#include "llnotificationptr.h"
33
34#include <string>
35
36class LLToastPanelBase: public LLPanel 
37{
38public:
39	virtual void init(LLSD& data){};
40};
41
42/**
43 * Base class for all panels that can be added to the toast.
44 * All toast panels should contain necessary logic for representing certain notification
45 * but shouldn't contain logic related to this panel lifetime control and positioning
46 * on the parent view.
47 */
48class LLToastPanel: public LLPanel {
49public:
50	LLToastPanel(const LLNotificationPtr&);
51	virtual ~LLToastPanel() = 0;
52
53	virtual std::string getTitle();
54	virtual const LLUUID& getID();
55
56	static const S32 MIN_PANEL_HEIGHT;
57
58	/**
59	 * Builder method for constructing notification specific panels.
60	 * Normally type of created panels shouldn't be publicated and should be hidden
61	 * from other functionality.
62	 */
63	static LLToastPanel* buidPanelFromNotification(
64			const LLNotificationPtr& notification);
65protected:
66	LLNotificationPtr mNotification;
67	void snapToMessageHeight(LLTextBase* message, S32 maxLineCount);
68};
69
70#endif /* LL_TOASTPANEL_H */