LLAlertDialog Class Reference

#include <llalertdialog.h>

Inheritance diagram for LLAlertDialog:

Inheritance graph
[legend]
Collaboration diagram for LLAlertDialog:

Collaboration graph
[legend]
List of all members.

Public Types

typedef void(*) alert_callback_t (S32 option, void *user_data)
typedef void(*) alert_text_callback_t (S32 option, const LLString &text, void *user_data)
typedef bool(*) display_callback_t (S32 modal)
typedef std::map< LLString,
LLPointer< LLAlertDialogTemplate > > 
template_map_t
 IGNORE_USE_DEFAULT = 1
 IGNORE_USE_SAVED = 2
 IGNORE_SHOW_AGAIN = 3
enum  { IGNORE_USE_DEFAULT = 1, IGNORE_USE_SAVED = 2, IGNORE_SHOW_AGAIN = 3 }

Public Member Functions

virtual BOOL handleKeyHere (KEY key, MASK mask, BOOL called_from_parent)
virtual void draw ()
virtual void setVisible (BOOL visible)
bool setCheckBox (const LLString &, const LLString &)
void setOptionEnabled (S32 option, BOOL enable)
void setUnique (BOOL val=TRUE)
void setEditTextCallback (alert_text_callback_t callback, void *user_data)
void setEditTextArgs (const LLString::format_map_t &edit_args)
void setDrawAsterixes (BOOL enable)
bool show ()
 LLAlertDialog (const LLAlertDialogTemplate *xml_template, const LLString::format_map_t &args, alert_callback_t callback=NULL, void *user_data=NULL)

Static Public Member Functions

static void onButtonPressed (void *userdata)
static LLAlertDialogcreateXml (const LLString &xml_desc, alert_callback_t callback=NULL, void *user_data=NULL)
static LLAlertDialogcreateXml (const LLString &xml_desc, const LLString::format_map_t &args, alert_callback_t callback=NULL, void *user_data=NULL)
static LLAlertDialogshowXml (const LLString &xml_desc, alert_callback_t callback=NULL, void *user_data=NULL)
static LLAlertDialogshowXml (const LLString &xml_desc, const LLString::format_map_t &args, alert_callback_t callback=NULL, void *user_data=NULL)
static LLAlertDialogshowCritical (const LLString &msg, alert_callback_t callback=NULL, void *user_data=NULL)
static bool parseAlerts (const LLString &xml_filename, LLControlGroup *settings=NULL, BOOL settings_only=FALSE)
static const LLStringgetTemplateMessage (const LLString &xml_desc)
static void setDisplayCallback (display_callback_t callback)
static void format (LLString &msg, const LLString::format_map_t &args)

Static Public Attributes

static template_map_t sAlertTemplates
static template_map_t sIgnorableTemplates
static LLControlGroupsSettings = NULL
static std::map< LLString,
LLAlertDialog * > 
sUniqueActiveMap
static display_callback_t sDisplayCallback
static LLString sStringSkipNextTime
static LLString sStringAlwaysChoose

Protected Member Functions

void createDialog (const std::vector< LLString > *options, S32 default_option, const LLString &msg, const LLString::format_map_t &args, const LLString &edit_text)
virtual ~LLAlertDialog ()
BOOL hasTitleBar () const

Protected Attributes

alert_callback_t mCallback
voidmUserData
S32 mNumOptions
S32 mDefaultOption
BOOL mOptionChosen
LLCheckBoxCtrlmCheck
BOOL mUnique
S32 mIgnorable
LLString mLabel
LLString mIgnoreLabel
ButtonDatamButtonData
LLFrameTimer mDefaultBtnTimer
LLLineEditormLineEditor
alert_text_callback_t mTextCallback

Classes

struct  ButtonData

Detailed Description

Definition at line 45 of file llalertdialog.h.


Member Typedef Documentation

typedef void(*) LLAlertDialog::alert_callback_t(S32 option, void *user_data)

Definition at line 48 of file llalertdialog.h.

typedef void(*) LLAlertDialog::alert_text_callback_t(S32 option, const LLString &text, void *user_data)

Definition at line 49 of file llalertdialog.h.

typedef bool(*) LLAlertDialog::display_callback_t(S32 modal)

Definition at line 50 of file llalertdialog.h.

typedef std::map<LLString, LLPointer<LLAlertDialogTemplate> > LLAlertDialog::template_map_t

Definition at line 132 of file llalertdialog.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
IGNORE_USE_DEFAULT 
IGNORE_USE_SAVED 
IGNORE_SHOW_AGAIN 

Definition at line 51 of file llalertdialog.h.


Constructor & Destructor Documentation

LLAlertDialog::LLAlertDialog ( const LLAlertDialogTemplate xml_template,
const LLString::format_map_t args,
alert_callback_t  callback = NULL,
void user_data = NULL 
)

Definition at line 134 of file llalertdialog.cpp.

References createDialog(), IGNORE_USE_DEFAULT, LLAlertDialogTemplate::mDefaultOption, LLAlertDialogTemplate::mEditLineText, LLAlertDialogTemplate::mIgnorable, LLAlertDialogTemplate::mIgnoreLabel, LLAlertDialogTemplate::mMessage, LLAlertDialogTemplate::mOptions, LLAlertDialogTemplate::mTitle, setCheckBox(), LLFloater::setTitle(), sStringAlwaysChoose, and sStringSkipNextTime.

Referenced by showCritical().

LLAlertDialog::~LLAlertDialog (  )  [protected, virtual]

Definition at line 414 of file llalertdialog.cpp.

References LLLineEditor::getText(), LLCheckBoxCtrl::getValue(), LLControlGroup::getWarning(), IGNORE_SHOW_AGAIN, IGNORE_USE_DEFAULT, IGNORE_USE_SAVED, mButtonData, mCallback, mCheck, mIgnorable, mIgnoreLabel, mLabel, mLineEditor, mOptionChosen, mTextCallback, mUnique, mUserData, LLControlGroup::setS32(), LLControlGroup::setWarning(), sSettings, and sUniqueActiveMap.


Member Function Documentation

void LLAlertDialog::createDialog ( const std::vector< LLString > *  options,
S32  default_option,
const LLString msg,
const LLString::format_map_t args,
const LLString edit_text 
) [protected]

Definition at line 249 of file llalertdialog.cpp.

References LLView::addChild(), BTN_HEIGHT, BTN_HPAD, FALSE, font_name, format(), LLRectBase< Type >::getHeight(), LLFontGL::getLineHeight(), LLView::getRect(), LLResMgr::getRes(), LLRectBase< Type >::getWidth(), LLFontGL::getWidth(), gResMgr, hasTitleBar(), HPAD, i, LINE_HEIGHT, LLBUTTON_H_PAD, llendl, llfloor(), llmax(), llwarns, MAX_ALLOWED_MSG_WIDTH, LLAlertDialog::ButtonData::mButton, mButtonData, mLineEditor, mNumOptions, LLAlertDialog::ButtonData::mOption, LLView::mRect, LLAlertDialog::ButtonData::mSelf, onButtonPressed(), LLModalDialog::reshape(), S32, LLUI::sColorsGroup, LLPanel::setBackgroundOpaque(), LLPanel::setBackgroundVisible(), LLTextBox::setColor(), LLUICtrl::setFocus(), LLRectBase< Type >::setLeftTopAndSize(), LLView::setRect(), LLFontGL::sSansSerif, STD_STRING_STR_LEN, TRUE, VPAD, and y.

Referenced by LLAlertDialog().

LLAlertDialog * LLAlertDialog::createXml ( const LLString xml_desc,
const LLString::format_map_t args,
alert_callback_t  callback = NULL,
void user_data = NULL 
) [static]

Definition at line 71 of file llalertdialog.cpp.

References llendl, llerrs, llwarns, NULL, sAlertTemplates, and showXml().

LLAlertDialog * LLAlertDialog::createXml ( const LLString xml_desc,
alert_callback_t  callback = NULL,
void user_data = NULL 
) [static]

Definition at line 63 of file llalertdialog.cpp.

Referenced by LLViewerWindow::alertXmlEditText(), and showXml().

void LLAlertDialog::draw (  )  [virtual]

Reimplemented from LLModalDialog.

Definition at line 504 of file llalertdialog.cpp.

References LLModalDialog::draw(), LLControlGroup::getColor(), LLRectBase< Type >::getHeight(), LLControlGroup::getS32(), LLFrameTimer::getStarted(), LLView::getVisible(), LLRectBase< Type >::getWidth(), gl_drop_shadow(), LLFrameTimer::hasExpired(), mButtonData, mDefaultBtnTimer, mDefaultOption, LLView::mRect, S32, LLUI::sColorsGroup, LLUI::sConfigGroup, LLPanel::setDefaultBtn(), and LLFrameTimer::stop().

void LLAlertDialog::format ( LLString msg,
const LLString::format_map_t args 
) [static]

Definition at line 241 of file llalertdialog.cpp.

References LLStringBase< char >::format().

Referenced by createDialog(), LLNotifyBox::findExistingNotify(), LLNotifyBox::getTemplateMessage(), LLNotifyBox::LLNotifyBox(), and setEditTextArgs().

const LLString & LLAlertDialog::getTemplateMessage ( const LLString xml_desc  )  [static]

Definition at line 584 of file llalertdialog.cpp.

References sAlertTemplates.

Referenced by LLTaskInvFVBridge::buyItem().

BOOL LLAlertDialog::handleKeyHere ( KEY  key,
MASK  mask,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLModalDialog.

Definition at line 465 of file llalertdialog.cpp.

References FALSE, LLView::focusNextItem(), LLView::focusPrevItem(), LLModalDialog::handleKeyHere(), KEY_LEFT, KEY_RETURN, KEY_RIGHT, KEY_TAB, MASK_NONE, MASK_SHIFT, and TRUE.

BOOL LLAlertDialog::hasTitleBar (  )  const [protected]

Definition at line 458 of file llalertdialog.cpp.

References LLFloater::getTitle(), LLFloater::isCloseable(), and LLFloater::isMinimizeable().

Referenced by createDialog().

void LLAlertDialog::onButtonPressed ( void userdata  )  [static]

Definition at line 572 of file llalertdialog.cpp.

References LLAlertDialog::ButtonData::mOption, mOptionChosen, and LLAlertDialog::ButtonData::mSelf.

Referenced by createDialog().

bool LLAlertDialog::parseAlerts ( const LLString xml_filename,
LLControlGroup settings = NULL,
BOOL  settings_only = FALSE 
) [static]

Definition at line 598 of file llalertdialog.cpp.

References LLControlGroup::addWarning(), LLControlGroup::declareS32(), FALSE, LLUICtrlFactory::getLayeredXMLNode(), IGNORE_USE_DEFAULT, IGNORE_USE_SAVED, LLPointer< Type >::isNull(), llassert, llendl, llerrs, llwarns, LLAlertDialogTemplate::mDefaultOption, LLAlertDialogTemplate::mIgnorable, LLAlertDialogTemplate::mIgnoreLabel, LLAlertDialogTemplate::mIgnoreListText, LLAlertDialogTemplate::mLabel, LLAlertDialogTemplate::mTitle, NULL, S32, sAlertTemplates, sIgnorableTemplates, sSettings, sStringAlwaysChoose, sStringSkipNextTime, and TRUE.

Referenced by main().

bool LLAlertDialog::setCheckBox ( const LLString ,
const LLString  
)

Definition at line 367 of file llalertdialog.cpp.

References LLView::addChild(), BTN_HEIGHT, FALSE, font_name, LLRectBase< Type >::getHeight(), LLFontGL::getLineHeight(), LLResMgr::getRes(), LLFontGL::getWidth(), LLRectBase< Type >::getWidth(), gResMgr, HPAD, IGNORE_SHOW_AGAIN, LINE_HEIGHT, LLCheckboxCtrl, llfloor(), llmax(), mCheck, mIgnorable, LLView::mRect, LLModalDialog::reshape(), S32, LLRectBase< Type >::setOriginAndSize(), LLCheckBoxCtrl::setValue(), TRUE, and VPAD.

Referenced by LLAlertDialog().

static void LLAlertDialog::setDisplayCallback ( display_callback_t  callback  )  [inline, static]

Definition at line 95 of file llalertdialog.h.

References sDisplayCallback.

Referenced by LLViewerWindow::LLViewerWindow().

void LLAlertDialog::setDrawAsterixes ( BOOL  enable  ) 

Definition at line 559 of file llalertdialog.cpp.

References LLLineEditor::clear(), mLineEditor, and LLLineEditor::setDrawAsterixes().

Referenced by LLViewerWindow::alertXmlEditText().

void LLAlertDialog::setEditTextArgs ( const LLString::format_map_t edit_args  ) 

Definition at line 545 of file llalertdialog.cpp.

References format(), LLLineEditor::getText(), llendl, llwarns, mLineEditor, and LLLineEditor::setText().

Referenced by LLViewerWindow::alertXmlEditText().

void LLAlertDialog::setEditTextCallback ( alert_text_callback_t  callback,
void user_data 
)

Definition at line 532 of file llalertdialog.cpp.

References llendl, llwarns, mLineEditor, mTextCallback, and mUserData.

Referenced by LLViewerWindow::alertXmlEditText().

void LLAlertDialog::setOptionEnabled ( S32  option,
BOOL  enable 
)

Definition at line 524 of file llalertdialog.cpp.

References LLAlertDialog::ButtonData::mButton, mButtonData, mNumOptions, and LLView::setEnabled().

void LLAlertDialog::setUnique ( BOOL  val = TRUE  )  [inline]

Definition at line 70 of file llalertdialog.h.

References mUnique.

void LLAlertDialog::setVisible ( BOOL  visible  )  [virtual]

Reimplemented from LLModalDialog.

Definition at line 403 of file llalertdialog.cpp.

References LLModalDialog::centerOnScreen(), make_ui_sound(), and LLModalDialog::setVisible().

bool LLAlertDialog::show (  ) 

Definition at line 171 of file llalertdialog.cpp.

References LLFloaterView::adjustToFitScreen(), LLFloaterView::bringToFront(), DEFAULT_BUTTON_DELAY, FALSE, LLControlGroup::getS32(), LLControlGroup::getWarning(), gFloaterView, IGNORE_SHOW_AGAIN, IGNORE_USE_DEFAULT, IGNORE_USE_SAVED, llendl, llinfos, mDefaultBtnTimer, mDefaultOption, mIgnorable, mIgnoreLabel, mLabel, mLineEditor, LLModalDialog::mModal, mOptionChosen, mUnique, LLFloater::open(), sDisplayCallback, LLLineEditor::selectAll(), LLLineEditor::setFocus(), LLFloater::setFocus(), LLFrameTimer::setTimerExpirySec(), sSettings, LLFrameTimer::start(), LLModalDialog::startModal(), sUniqueActiveMap, and TRUE.

Referenced by LLViewerWindow::alertXmlEditText(), showCritical(), and showXml().

LLAlertDialog * LLAlertDialog::showCritical ( const LLString msg,
alert_callback_t  callback = NULL,
void user_data = NULL 
) [static]

Definition at line 114 of file llalertdialog.cpp.

References LLAlertDialog(), LLAlertDialogTemplate::mMessage, LLAlertDialogTemplate::mModal, LLAlertDialogTemplate::mOptions, LLAlertDialogTemplate::mTitle, NULL, show(), and TRUE.

Referenced by app_early_exit().

LLAlertDialog * LLAlertDialog::showXml ( const LLString xml_desc,
const LLString::format_map_t args,
alert_callback_t  callback = NULL,
void user_data = NULL 
) [static]

Definition at line 106 of file llalertdialog.cpp.

References createXml(), NULL, and show().

LLAlertDialog * LLAlertDialog::showXml ( const LLString xml_desc,
alert_callback_t  callback = NULL,
void user_data = NULL 
) [static]

Definition at line 98 of file llalertdialog.cpp.

Referenced by LLViewerWindow::alertXml(), LLPanelClassified::canClose(), LLPanel::childDisplayNotFound(), createXml(), join_group_callback(), LLNotifyBox::onClickButton(), LLFloaterWorldMap::onCopySLURL(), LLLandmarkBridge::openItem(), and process_alert_core().


Member Data Documentation

ButtonData* LLAlertDialog::mButtonData [protected]

Definition at line 124 of file llalertdialog.h.

Referenced by createDialog(), draw(), setOptionEnabled(), and ~LLAlertDialog().

alert_callback_t LLAlertDialog::mCallback [protected]

Definition at line 114 of file llalertdialog.h.

Referenced by ~LLAlertDialog().

LLCheckBoxCtrl* LLAlertDialog::mCheck [protected]

Definition at line 119 of file llalertdialog.h.

Referenced by setCheckBox(), and ~LLAlertDialog().

LLFrameTimer LLAlertDialog::mDefaultBtnTimer [protected]

Definition at line 125 of file llalertdialog.h.

Referenced by draw(), and show().

S32 LLAlertDialog::mDefaultOption [protected]

Definition at line 117 of file llalertdialog.h.

Referenced by draw(), and show().

S32 LLAlertDialog::mIgnorable [protected]

Definition at line 121 of file llalertdialog.h.

Referenced by setCheckBox(), show(), and ~LLAlertDialog().

LLString LLAlertDialog::mIgnoreLabel [protected]

Definition at line 123 of file llalertdialog.h.

Referenced by show(), and ~LLAlertDialog().

LLString LLAlertDialog::mLabel [protected]

Reimplemented from LLPanel.

Definition at line 122 of file llalertdialog.h.

Referenced by show(), and ~LLAlertDialog().

LLLineEditor* LLAlertDialog::mLineEditor [protected]

Definition at line 127 of file llalertdialog.h.

Referenced by createDialog(), setDrawAsterixes(), setEditTextArgs(), setEditTextCallback(), show(), and ~LLAlertDialog().

S32 LLAlertDialog::mNumOptions [protected]

Definition at line 116 of file llalertdialog.h.

Referenced by createDialog(), and setOptionEnabled().

BOOL LLAlertDialog::mOptionChosen [protected]

Definition at line 118 of file llalertdialog.h.

Referenced by onButtonPressed(), show(), and ~LLAlertDialog().

alert_text_callback_t LLAlertDialog::mTextCallback [protected]

Definition at line 128 of file llalertdialog.h.

Referenced by setEditTextCallback(), and ~LLAlertDialog().

BOOL LLAlertDialog::mUnique [protected]

Definition at line 120 of file llalertdialog.h.

Referenced by setUnique(), show(), and ~LLAlertDialog().

void* LLAlertDialog::mUserData [protected]

Definition at line 115 of file llalertdialog.h.

Referenced by setEditTextCallback(), and ~LLAlertDialog().

LLAlertDialog::template_map_t LLAlertDialog::sAlertTemplates [static]

Definition at line 133 of file llalertdialog.h.

Referenced by createXml(), getTemplateMessage(), LLPanelMsgs::onClickEnablePopup(), and parseAlerts().

LLAlertDialog::display_callback_t LLAlertDialog::sDisplayCallback [static]

Definition at line 137 of file llalertdialog.h.

Referenced by setDisplayCallback(), and show().

LLAlertDialog::template_map_t LLAlertDialog::sIgnorableTemplates [static]

Definition at line 134 of file llalertdialog.h.

Referenced by LLPanelMsgs::buildLists(), parseAlerts(), LLPanelMsgs::resetAllIgnored(), and LLPanelMsgs::setAllIgnored().

LLControlGroup * LLAlertDialog::sSettings = NULL [static]

Definition at line 135 of file llalertdialog.h.

Referenced by LLAlertDialogTemplate::getIgnore(), parseAlerts(), LLAlertDialogTemplate::setIgnore(), show(), and ~LLAlertDialog().

LLString LLAlertDialog::sStringAlwaysChoose [static]

Definition at line 140 of file llalertdialog.h.

Referenced by LLAlertDialog(), and parseAlerts().

LLString LLAlertDialog::sStringSkipNextTime [static]

Definition at line 139 of file llalertdialog.h.

Referenced by LLAlertDialog(), and parseAlerts().

std::map< LLString, LLAlertDialog * > LLAlertDialog::sUniqueActiveMap [static]

Definition at line 136 of file llalertdialog.h.

Referenced by show(), and ~LLAlertDialog().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:10 2010 for Second Life Viewer by  doxygen 1.4.7