ELinks 0.18.0
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
inpfield.h File Reference
#include "bfu/common.h"
#include "util/memlist.h"
#include "util/lists.h"
#include "util/align.h"
Include dependency graph for inpfield.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  widget_info_field
 
struct  widget_data_info_field
 
struct  input_line
 

Macros

#define add_dlg_field(dlg, label, min, max, handler, len, field, history)    add_dlg_field_do(dlg, WIDGET_FIELD, label, min, max, handler, len, field, history, INPFIELD_NONE)
 
#define add_dlg_field_float(dlg, label, min, max, handler, len, field, history)    add_dlg_field_do(dlg, WIDGET_FIELD, label, min, max, handler, len, field, history, INPFIELD_FLOAT)
 
#define add_dlg_field_float2(dlg, label, min, max, handler, len, field, history)    add_dlg_field_do(dlg, WIDGET_FIELD, label, min, max, handler, len, field, history, INPFIELD_FLOAT2)
 
#define add_dlg_field_pass(dlg, label, min, max, handler, len, field)    add_dlg_field_do(dlg, WIDGET_FIELD_PASS, label, min, max, handler, len, field, NULL, INPFIELD_NONE)
 
#define add_dlg_field_float_pass(dlg, label, min, max, handler, len, field)    add_dlg_field_do(dlg, WIDGET_FIELD_PASS, label, min, max, handler, len, field, NULL, INPFIELD_FLOAT)
 
#define INPUT_LINE_BUFFER_SIZE   256
 
#define INPUT_LINE_WIDGETS   1
 
#define widget_has_history(widget_data)
 
#define widget_is_textfield(widget_data)
 

Typedefs

typedef enum input_line_code(* input_line_handler_T) (struct input_line *line, int action_id)
 

Enumerations

enum  inpfield_flags { INPFIELD_NONE = 0 , INPFIELD_FLOAT = 1 , INPFIELD_FLOAT2 = 2 }
 
enum  input_line_code { INPUT_LINE_CANCEL , INPUT_LINE_PROCEED , INPUT_LINE_REWIND }
 

Functions

void add_dlg_field_do (struct dialog *dlg, enum widget_type type, char *label, int min, int max, widget_handler_T *handler, int data_len, void *data, struct input_history *history, enum inpfield_flags flags)
 
widget_handler_status_T check_number (struct dialog_data *, struct widget_data *)
 
widget_handler_status_T check_nonempty (struct dialog_data *, struct widget_data *)
 
void dlg_format_field (struct dialog_data *, struct widget_data *, int, int *, int, int *, format_align_T, int format_only)
 
void input_field (struct terminal *, struct memory_list *, int, char *, char *, char *, char *, void *, struct input_history *, int, const char *, int, int, widget_handler_T *check, void(*)(void *, char *), void(*)(void *))
 
void input_dialog (struct terminal *term, struct memory_list *ml, char *title, char *text, void *data, struct input_history *history, int l, const char *def, int min, int max, widget_handler_T *check, void(*fn)(void *, char *), void(*cancelfn)(void *))
 
void password_dialog (struct terminal *term, struct memory_list *ml, char *title, char *text, void *data, struct input_history *history, int l, const char *def, int min, int max, widget_handler_T *check, void(*fn)(void *, char *), void(*cancelfn)(void *))
 
void input_field_line (struct session *ses, char *prompt, void *data, struct input_history *history, input_line_handler_T handler)
 

Variables

const struct widget_ops field_ops
 
const struct widget_ops field_pass_ops
 

Macro Definition Documentation

◆ add_dlg_field

#define add_dlg_field (   dlg,
  label,
  min,
  max,
  handler,
  len,
  field,
  history 
)     add_dlg_field_do(dlg, WIDGET_FIELD, label, min, max, handler, len, field, history, INPFIELD_NONE)

◆ add_dlg_field_float

#define add_dlg_field_float (   dlg,
  label,
  min,
  max,
  handler,
  len,
  field,
  history 
)     add_dlg_field_do(dlg, WIDGET_FIELD, label, min, max, handler, len, field, history, INPFIELD_FLOAT)

◆ add_dlg_field_float2

#define add_dlg_field_float2 (   dlg,
  label,
  min,
  max,
  handler,
  len,
  field,
  history 
)     add_dlg_field_do(dlg, WIDGET_FIELD, label, min, max, handler, len, field, history, INPFIELD_FLOAT2)

◆ add_dlg_field_float_pass

#define add_dlg_field_float_pass (   dlg,
  label,
  min,
  max,
  handler,
  len,
  field 
)     add_dlg_field_do(dlg, WIDGET_FIELD_PASS, label, min, max, handler, len, field, NULL, INPFIELD_FLOAT)

◆ add_dlg_field_pass

#define add_dlg_field_pass (   dlg,
  label,
  min,
  max,
  handler,
  len,
  field 
)     add_dlg_field_do(dlg, WIDGET_FIELD_PASS, label, min, max, handler, len, field, NULL, INPFIELD_NONE)

◆ INPUT_LINE_BUFFER_SIZE

#define INPUT_LINE_BUFFER_SIZE   256

◆ INPUT_LINE_WIDGETS

#define INPUT_LINE_WIDGETS   1

◆ widget_has_history

#define widget_has_history (   widget_data)
Value:
&& (widget_data)->widget->info.field.history)
@ WIDGET_FIELD
A single-line input field.
Definition common.h:32
Definition widget.h:56
Definition widget.h:36
enum widget_type type
Definition widget.h:53

◆ widget_is_textfield

#define widget_is_textfield (   widget_data)
Value:
|| (widget_data)->widget->type == WIDGET_FIELD_PASS)
@ WIDGET_FIELD_PASS
A single-line input field for a password.
Definition common.h:37

Typedef Documentation

◆ input_line_handler_T

typedef enum input_line_code(* input_line_handler_T) (struct input_line *line, int action_id)

Enumeration Type Documentation

◆ inpfield_flags

Enumerator
INPFIELD_NONE 
INPFIELD_FLOAT 
INPFIELD_FLOAT2 

◆ input_line_code

Enumerator
INPUT_LINE_CANCEL 
INPUT_LINE_PROCEED 
INPUT_LINE_REWIND 

Function Documentation

◆ add_dlg_field_do()

void add_dlg_field_do ( struct dialog *  dlg,
enum widget_type  type,
char *  label,
int  min,
int  max,
widget_handler_T *  handler,
int  data_len,
void *  data,
struct input_history *  history,
enum inpfield_flags  flags 
)

◆ check_nonempty()

widget_handler_status_T check_nonempty ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)

◆ check_number()

widget_handler_status_T check_number ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data 
)

◆ dlg_format_field()

void dlg_format_field ( struct dialog_data *  dlg_data,
struct widget_data *  widget_data,
int  x,
int *  y,
int  w,
int *  rw,
format_align_T  align,
int  format_only 
)

◆ input_dialog()

void input_dialog ( struct terminal *  term,
struct memory_list *  ml,
char *  title,
char *  text,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)

◆ input_field()

void input_field ( struct terminal *  term,
struct memory_list *  ml,
int  intl,
char *  title,
char *  text,
char *  okbutton,
char *  cancelbutton,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)

◆ input_field_line()

void input_field_line ( struct session *  ses,
char *  prompt,
void *  data,
struct input_history *  history,
input_line_handler_T  handler 
)

◆ password_dialog()

void password_dialog ( struct terminal *  term,
struct memory_list *  ml,
char *  title,
char *  text,
void *  data,
struct input_history *  history,
int  l,
const char *  def,
int  min,
int  max,
widget_handler_T *  check,
void(*)(void *, char *)  fn,
void(*)(void *)  cancelfn 
)

Variable Documentation

◆ field_ops

const struct widget_ops field_ops
extern

◆ field_pass_ops

const struct widget_ops field_pass_ops
extern