<commit_before>/** 
 * @file llfloater.h
 * @brief LLFloater base class
 *
 * $LicenseInfo:firstyear=2002&license=viewergpl$
 * 
 * Copyright (c) 2002-2009, Linden Research, Inc.
 * 
 * Second Life Viewer Source Code
 * The source code in this file ("Source Code") is provided by Linden Lab
 * to you under the terms of the GNU General Public License, version 2.0
 * ("GPL"), unless you have obtained a separate licensing agreement
 * ("Other License"), formally executed by you and Linden Lab.  Terms of
 * the GPL can be found in doc/GPL-license.txt in this distribution, or
 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
 * 
 * There are special exceptions to the terms and conditions of the GPL as
 * it is applied to this Source Code. View the full text of the exception
 * in the file doc/FLOSS-exception.txt in this software distribution, or
 * online at
 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
 * 
 * By copying, modifying or distributing this software, you acknowledge
 * that you have read and understood your obligations described above,
 * and agree to abide by those obligations.
 * 
 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
 * COMPLETENESS OR PERFORMANCE.
 * $/LicenseInfo$
 */

// Floating "windows" within the GL display, like the inventory floater,
// mini-map floater, etc.


#ifndef LL_FLOATER_H
#define LL_FLOATER_H

#include "llpanel.h"
#include "lluuid.h"
#include "llnotifications.h"
#include <set>

class LLDragHandle;
class LLResizeHandle;
class LLResizeBar;
class LLButton;
class LLMultiFloater;
class LLFloater;


const BOOL RESIZE_YES = TRUE;
const BOOL RESIZE_NO = FALSE;

const BOOL DRAG_ON_TOP = FALSE;
const BOOL DRAG_ON_LEFT = TRUE;

const BOOL MINIMIZE_YES = TRUE;
const BOOL MINIMIZE_NO = FALSE;

const BOOL CLOSE_YES = TRUE;
const BOOL CLOSE_NO = FALSE;

const BOOL ADJUST_VERTICAL_YES = TRUE;
const BOOL ADJUST_VERTICAL_NO = FALSE;

// associates a given notification instance with a particular floater
class LLFloaterNotificationContext : 
	public LLNotificationContext
{
public:
	LLFloaterNotificationContext(LLHandle<LLFloater> floater_handle) :
		mFloaterHandle(floater_handle)
	{}

	LLFloater* getFloater() { return mFloaterHandle.get(); }
private:
	LLHandle<LLFloater> mFloaterHandle;
};

class LLFloater : public LLPanel
{
friend class LLFloaterView;
friend class LLFloaterReg;
friend class LLMultiFloater;
public:
	struct KeyCompare
	{
//		static bool compare(const LLSD& a, const LLSD& b);
		static bool equate(const LLSD& a, const LLSD& b);
/*==========================================================================*|
		bool operator()(const LLSD& a, const LLSD& b) const
		{
			return compare(a, b);
		}
|*==========================================================================*/
	};
	
	enum EFloaterButton
	{
		BUTTON_CLOSE = 0,
		BUTTON_RESTORE,
		BUTTON_MINIMIZE,
		BUTTON_TEAR_OFF,
		BUTTON_DOCK,
		BUTTON_UNDOCK,
		BUTTON_HELP,
		BUTTON_COUNT
	};
	
	struct Params 
	:	public LLInitParam::Block<Params, LLPanel::Params>
	{
		Optional<std::string>	title,
								short_title;
		
		Optional<bool>			single_instance,
								auto_tile,
								can_resize,
								can_minimize,
								can_close,
								can_drag_on_left,
								can_tear_off,
								save_rect,
								save_visibility,
								save_dock_state,
								can_dock;
		Optional<S32>			header_height,
								legacy_header_height; // HACK see initFromXML()

		// Images for top-right controls
		Optional<LLUIImage*>	close_image,
								restore_image,
								minimize_image,
								tear_off_image,
								dock_image,
								undock_image,
								help_image;
		Optional<LLUIImage*>	close_pressed_image,
								restore_pressed_image,
								minimize_pressed_image,
								tear_off_pressed_image,
								dock_pressed_image,
								undock_pressed_image,
								help_pressed_image;
		Optional<std::string>	close_tooltip,
								restore_tooltip,
								minimize_tooltip,
								tear_off_tooltip,
								dock_tooltip,
								undock_tooltip,
								heap_tooltip;
		
		Optional<CommitCallbackParam> open_callback,
									  close_callback;
		
		Params();
	};
	
	// use this to avoid creating your own default LLFloater::Param instance
	static const Params& getDefaultParams();

	// Load translations for tooltips for standard buttons
	static void initClass();

	LLFloater(const LLSD& key, const Params& params = getDefaultParams());<commit_msg>Clean up some unused parameters noted in code review with Richard.<commit_after>/** 
 * @file llfloater.h
 * @brief LLFloater base class
 *
 * $LicenseInfo:firstyear=2002&license=viewergpl$
 * 
 * Copyright (c) 2002-2009, Linden Research, Inc.
 * 
 * Second Life Viewer Source Code
 * The source code in this file ("Source Code") is provided by Linden Lab
 * to you under the terms of the GNU General Public License, version 2.0
 * ("GPL"), unless you have obtained a separate licensing agreement
 * ("Other License"), formally executed by you and Linden Lab.  Terms of
 * the GPL can be found in doc/GPL-license.txt in this distribution, or
 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
 * 
 * There are special exceptions to the terms and conditions of the GPL as
 * it is applied to this Source Code. View the full text of the exception
 * in the file doc/FLOSS-exception.txt in this software distribution, or
 * online at
 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
 * 
 * By copying, modifying or distributing this software, you acknowledge
 * that you have read and understood your obligations described above,
 * and agree to abide by those obligations.
 * 
 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
 * COMPLETENESS OR PERFORMANCE.
 * $/LicenseInfo$
 */

// Floating "windows" within the GL display, like the inventory floater,
// mini-map floater, etc.


#ifndef LL_FLOATER_H
#define LL_FLOATER_H

#include "llpanel.h"
#include "lluuid.h"
#include "llnotifications.h"
#include <set>

class LLDragHandle;
class LLResizeHandle;
class LLResizeBar;
class LLButton;
class LLMultiFloater;
class LLFloater;


const BOOL RESIZE_YES = TRUE;
const BOOL RESIZE_NO = FALSE;

const BOOL DRAG_ON_TOP = FALSE;
const BOOL DRAG_ON_LEFT = TRUE;

const BOOL MINIMIZE_YES = TRUE;
const BOOL MINIMIZE_NO = FALSE;

const BOOL CLOSE_YES = TRUE;
const BOOL CLOSE_NO = FALSE;

const BOOL ADJUST_VERTICAL_YES = TRUE;
const BOOL ADJUST_VERTICAL_NO = FALSE;

// associates a given notification instance with a particular floater
class LLFloaterNotificationContext : 
	public LLNotificationContext
{
public:
	LLFloaterNotificationContext(LLHandle<LLFloater> floater_handle) :
		mFloaterHandle(floater_handle)
	{}

	LLFloater* getFloater() { return mFloaterHandle.get(); }
private:
	LLHandle<LLFloater> mFloaterHandle;
};

class LLFloater : public LLPanel
{
friend class LLFloaterView;
friend class LLFloaterReg;
friend class LLMultiFloater;
public:
	struct KeyCompare
	{
//		static bool compare(const LLSD& a, const LLSD& b);
		static bool equate(const LLSD& a, const LLSD& b);
/*==========================================================================*|
		bool operator()(const LLSD& a, const LLSD& b) const
		{
			return compare(a, b);
		}
|*==========================================================================*/
	};
	
	enum EFloaterButton
	{
		BUTTON_CLOSE = 0,
		BUTTON_RESTORE,
		BUTTON_MINIMIZE,
		BUTTON_TEAR_OFF,
		BUTTON_DOCK,
		BUTTON_UNDOCK,
		BUTTON_HELP,
		BUTTON_COUNT
	};
	
	struct Params 
	:	public LLInitParam::Block<Params, LLPanel::Params>
	{
		Optional<std::string>	title,
								short_title;
		
		Optional<bool>			single_instance,
								auto_tile,
								can_resize,
								can_minimize,
								can_close,
								can_drag_on_left,
								can_tear_off,
								save_rect,
								save_visibility,
								save_dock_state,
								can_dock;
		Optional<S32>			header_height,
								legacy_header_height; // HACK see initFromXML()

		// Images for top-right controls
		Optional<LLUIImage*>	close_image,
								restore_image,
								minimize_image,
								tear_off_image,
								dock_image,
								undock_image,
								help_image;
		Optional<LLUIImage*>	close_pressed_image,
								restore_pressed_image,
								minimize_pressed_image,
								tear_off_pressed_image,
								dock_pressed_image,
								undock_pressed_image,
								help_pressed_image;
		
		Optional<CommitCallbackParam> open_callback,
									  close_callback;
		
		Params();
	};
	
	// use this to avoid creating your own default LLFloater::Param instance
	static const Params& getDefaultParams();

	// Load translations for tooltips for standard buttons
	static void initClass();

	LLFloater(const LLSD& key, const Params& params = getDefaultParams());
{'fraction_non_alphanumeric': 0.10988027302226698, 'fraction_numerical': 0.004028197381671702, 'mean_word_length': 3.910989010989011, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5072888', 'n_tokens_mistral': 3362, 'n_tokens_neox': 2736, 'n_words': 827}