19#define __STDBOOL_H__ 1
26#include <TextControl.h>
72 lwc_string *realm,
const char *fetchurl,
73 nserror (*cb)(
const char *username,
75 void *pw),
void *cbpw);
89 : BAlert(
"Login",
text,
"Cancel",
"Ok", NULL,
90 B_WIDTH_AS_USUAL, B_WARNING_ALERT)
98 SetFeel(B_MODAL_SUBSET_WINDOW_FEEL);
109 ResizeBy(0, 2 *
TC_H);
110 MoveTo(AlertPosition(Frame().Width() + 1,
111 Frame().Height() + 1));
114 BTextView *tv = TextView();
118 fUserControl =
new BTextControl(r,
"user",
"Username",
"",
119 new BMessage(), B_FOLLOW_BOTTOM | B_FOLLOW_RIGHT);
123 r.OffsetBySelf(0,
TC_H);
125 fPassControl =
new BTextControl(r,
"pass",
"Password",
"",
126 new BMessage(), B_FOLLOW_BOTTOM | B_FOLLOW_RIGHT);
131 SetShortcut(0, B_ESCAPE);
141 switch (message->what) {
145 if (message->FindInt32(
"which", &which) < B_OK)
150 BMessage *m =
new BMessage(*message);
152 m->AddPointer(
"URL",
fUrl);
153 m->AddString(
"Host",
fHost.String());
154 m->AddString(
"Realm",
fRealm.String());
155 m->AddPointer(
"callback", (
void *)
fCallback);
161 m->AddString(
"Auth", auth.String());
171 BAlert::MessageReceived(message);
176 const char *username,
const char *password,
177 nserror (*cb)(
const char *username,
178 const char *password,
196 const char *realm,
nserror (*cb)(
197 const char *username,
198 const char *password,
202 BString r(
"Secure Area");
205 BString
text(
"Please login\n");
206 text <<
"Realm: " << r <<
"\n";
207 text <<
"Host: " << host <<
"\n";
211 r.String(),
text.String());
Browser window creation and manipulation interface.
void MessageReceived(BMessage *message)
BTextControl * fPassControl
LoginAlert(nserror(*callback)(const char *username, const char *password, void *pw), void *callbaclpw, nsurl *url, const char *host, const char *realm, const char *text)
BString fRealm
Authentication realm.
BTextControl * fUserControl
BString fHost
Host for user display.
nsurl * fUrl
URL being fetched.
nserror(* fCallback)(const char *username, const char *password, void *pw)
Declaration of content enumerations.
nserror
Enumeration of error codes.
void nsbeos_pipe_message(BMessage *message, BView *_this, struct gui_window *gui)
Interface to platform-specific clipboard operations.
static void create_login_window(nsurl *host, lwc_string *realm, const char *fetchurl, nserror(*cb)(const char *username, const char *password, void *pw), void *cbpw)
nserror gui_401login_open(nsurl *url, const char *realm, const char *username, const char *password, nserror(*cb)(const char *username, const char *password, void *pw), void *cbpw)
Localised message support (interface).
NetSurf URL handling (interface).
lwc_string * nsurl_get_component(const nsurl *url, nsurl_component part)
Get part of a URL as a lwc_string, from a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
Interface to utility string handling.
Interface to URL parsing and joining operations.
Interface to a number of general purpose functionality.
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.