aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llalertdialog.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/llalertdialog.h
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llui/llalertdialog.h')
-rw-r--r--linden/indra/llui/llalertdialog.h59
1 files changed, 30 insertions, 29 deletions
diff --git a/linden/indra/llui/llalertdialog.h b/linden/indra/llui/llalertdialog.h
index 31f4769..4978d71 100644
--- a/linden/indra/llui/llalertdialog.h
+++ b/linden/indra/llui/llalertdialog.h
@@ -42,6 +42,7 @@ class LLCheckBoxCtrl;
42class LLAlertDialogTemplate; 42class LLAlertDialogTemplate;
43class LLLineEditor; 43class LLLineEditor;
44 44
45// https://wiki.lindenlab.com/mediawiki/index.php?title=LLAlertDialog&oldid=81388
45class LLAlertDialog : public LLModalDialog 46class LLAlertDialog : public LLModalDialog
46{ 47{
47public: 48public:
@@ -60,17 +61,13 @@ public:
60 static void setURLLoader(URLLoader* loader) 61 static void setURLLoader(URLLoader* loader)
61 { 62 {
62 sURLLoader = loader; 63 sURLLoader = loader;
63 }; 64 }
64
65protected:
66 struct ButtonData
67 {
68 LLAlertDialog* mSelf;
69 LLButton* mButton;
70 S32 mOption;
71 };
72 65
73public: 66public:
67 // User's responsibility to call show() after creating these.
68 LLAlertDialog( const LLAlertDialogTemplate* xml_template, const LLString::format_map_t& args,
69 alert_callback_t callback = NULL, void *user_data = NULL);
70
74 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ); 71 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent );
75 72
76 virtual void draw(); 73 virtual void draw();
@@ -106,14 +103,25 @@ public:
106 static const LLString& getTemplateMessage(const LLString& xml_desc); 103 static const LLString& getTemplateMessage(const LLString& xml_desc);
107 104
108 static void setDisplayCallback(display_callback_t callback) { sDisplayCallback = callback; } 105 static void setDisplayCallback(display_callback_t callback) { sDisplayCallback = callback; }
109
110 // Must call show() after creating these
111 LLAlertDialog( const LLAlertDialogTemplate* xml_template, const LLString::format_map_t& args,
112 alert_callback_t callback = NULL, void *user_data = NULL);
113 106
114 void format(LLString& msg, const LLString::format_map_t& args); 107 void format(LLString& msg, const LLString::format_map_t& args);
115 108
116protected: 109 static LLControlGroup* sSettings;
110
111 // use LLPointer so they delete themselves when sTemplates is destroyed
112 typedef std::map<LLString, LLPointer<LLAlertDialogTemplate> > template_map_t;
113 static template_map_t sAlertTemplates; // by mLabel
114 static template_map_t sIgnorableTemplates; // by mIgnoreLabel
115
116
117private:
118
119 static std::map<LLString, LLAlertDialog*> sUniqueActiveMap;
120 static display_callback_t sDisplayCallback;
121
122 static LLString sStringSkipNextTime;
123 static LLString sStringAlwaysChoose;
124
117 void createDialog(const std::vector<LLString>* options, S32 default_option, 125 void createDialog(const std::vector<LLString>* options, S32 default_option,
118 const LLString& msg, const LLString::format_map_t& args, 126 const LLString& msg, const LLString::format_map_t& args,
119 const LLString& edit_text); 127 const LLString& edit_text);
@@ -123,7 +131,13 @@ protected:
123 // Does it have a readable title label, or minimize or close buttons? 131 // Does it have a readable title label, or minimize or close buttons?
124 BOOL hasTitleBar() const; 132 BOOL hasTitleBar() const;
125 133
126protected: 134 struct ButtonData
135 {
136 LLAlertDialog* mSelf;
137 LLButton* mButton;
138 S32 mOption;
139 } * mButtonData;
140
127 alert_callback_t mCallback; 141 alert_callback_t mCallback;
128 void* mUserData; 142 void* mUserData;
129 S32 mNumOptions; 143 S32 mNumOptions;
@@ -135,7 +149,6 @@ protected:
135 S32 mIgnorable; 149 S32 mIgnorable;
136 LLString mLabel; 150 LLString mLabel;
137 LLString mIgnoreLabel; 151 LLString mIgnoreLabel;
138 ButtonData* mButtonData;
139 LLFrameTimer mDefaultBtnTimer; 152 LLFrameTimer mDefaultBtnTimer;
140 // For Dialogs that take a line as text as input: 153 // For Dialogs that take a line as text as input:
141 LLLineEditor* mLineEditor; 154 LLLineEditor* mLineEditor;
@@ -143,18 +156,6 @@ protected:
143 // For Dialogs linked to a URL 156 // For Dialogs linked to a URL
144 LLString mURL; // Some alerts will direct the resident to a URL 157 LLString mURL; // Some alerts will direct the resident to a URL
145 S32 mURLOption; 158 S32 mURLOption;
146
147public:
148 // use LLPointer so they delete themselves when sTemplates is destroyed
149 typedef std::map<LLString, LLPointer<LLAlertDialogTemplate> > template_map_t;
150 static template_map_t sAlertTemplates; // by mLabel
151 static template_map_t sIgnorableTemplates; // by mIgnoreLabel
152 static LLControlGroup* sSettings;
153 static std::map<LLString, LLAlertDialog*> sUniqueActiveMap;
154 static display_callback_t sDisplayCallback;
155
156 static LLString sStringSkipNextTime;
157 static LLString sStringAlwaysChoose;
158 159
159private: 160private:
160 static URLLoader* sURLLoader; 161 static URLLoader* sURLLoader;