PageRenderTime 14ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llchicletbar.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 105 lines | 37 code | 18 blank | 50 comment | 0 complexity | 7bb2f116473352a3dbb7575709139528 MD5 | raw file
  1/** 
  2* @file llchicletbar.h
  3* @brief LLChicletBar class header file
  4*
  5* $LicenseInfo:firstyear=2011&license=viewerlgpl$
  6* Second Life Viewer Source Code
  7* Copyright (C) 2011, 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_LLCHICLETBAR_H
 28#define LL_LLCHICLETBAR_H
 29
 30#include "llpanel.h"
 31#include "llimview.h"
 32
 33class LLChicletPanel;
 34class LLIMChiclet;
 35class LLLayoutPanel;
 36class LLLayoutStack;
 37
 38class LLChicletBar
 39	: public LLSingleton<LLChicletBar>
 40	, public LLPanel
 41	, public LLIMSessionObserver
 42{
 43	LOG_CLASS(LLChicletBar);
 44	friend class LLSingleton<LLChicletBar>;
 45public:
 46	~LLChicletBar();
 47
 48	BOOL postBuild();
 49
 50	LLChicletPanel*	getChicletPanel() { return mChicletPanel; }
 51
 52	// LLIMSessionObserver observe triggers
 53	virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
 54	virtual void sessionRemoved(const LLUUID& session_id);
 55	void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id);
 56
 57	S32 getTotalUnreadIMCount();
 58
 59	/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
 60
 61	/**
 62	 * Creates IM Chiclet based on session type (IM chat or Group chat)
 63	 */
 64	LLIMChiclet* createIMChiclet(const LLUUID& session_id);
 65
 66	/**
 67	 * Shows/hides panel with specified well button (IM or Notification)
 68	 *
 69	 * @param well_name - name of the well panel to be processed.
 70	 * @param visible - a flag specifying whether a button should be shown or hidden.
 71	 */
 72	void showWellButton(const std::string& well_name, bool visible);
 73
 74private:
 75	/**
 76	 * Updates child controls size and visibility when it is necessary to reduce total width.
 77	 *
 78	 * @param delta_width - value by which chiclet bar should be shrunk. It is a negative value.
 79	 * @returns positive value which chiclet bar can not process when it reaches its minimal width.
 80	 *		Zero if there was enough space to process delta_width.
 81	 */
 82	S32 processWidthDecreased(S32 delta_width);
 83
 84	/** helper function to log debug messages */
 85	void log(LLView* panel, const std::string& descr);
 86
 87	/**
 88	 * @return difference between current chiclet panel width and the minimum.
 89	 */
 90	S32 getChicletPanelShrinkHeadroom() const;
 91
 92	/**
 93	 * function adjusts Chiclet bar width to prevent overlapping with Mini-Location bar
 94	 * EXP-1463
 95	 */
 96	void fitWithTopInfoBar();
 97
 98protected:
 99	LLChicletBar(const LLSD& key = LLSD());
100
101	LLChicletPanel* 	mChicletPanel;
102	LLLayoutStack*		mToolbarStack;
103};
104
105#endif // LL_LLCHICLETBAR_H