Data Structures | Defines | Typedefs | Functions | Variables

vlc_dialog.h File Reference

User interaction dialog APIs. More...

Include dependency graph for vlc_dialog.h:

Go to the source code of this file.

Data Structures

struct  dialog_fatal_t
 A fatal error dialog. More...
struct  dialog_question_t
 A question dialog. More...
struct  dialog_progress_bar_t

Defines

#define dialog_Fatal(o, t,...)   dialog_Fatal(VLC_OBJECT(o), t, __VA_ARGS__)
#define dialog_FatalWait(o, t,...)   dialog_FatalWait(VLC_OBJECT(o), t, __VA_ARGS__)
#define dialog_Login(o, u, p, t,...)   dialog_Login(VLC_OBJECT(o), u, p, t, __VA_ARGS__)
#define dialog_Question(o, t, m, y, n, c)   dialog_Question(VLC_OBJECT(o), t, m, y, n, c)
#define dialog_ProgressCreate(o, t, m, c)   dialog_ProgressCreate(VLC_OBJECT(o), t, m, c)
#define dialog_Register(o)   dialog_Register(VLC_OBJECT(o))
#define dialog_Unregister(o)   dialog_Unregister(VLC_OBJECT(o))

Typedefs

typedef struct dialog_fatal_t dialog_fatal_t
 A fatal error dialog.
typedef struct dialog_question_t dialog_question_t
 A question dialog.
typedef struct
dialog_progress_bar_t 
dialog_progress_bar_t

Functions

VLC_API void dialog_VFatal (vlc_object_t *, bool, const char *, const char *, va_list)
 Sends an error message through the user interface (if any).
static VLC_FORMAT (3, 4) void dialog_Fatal(vlc_object_t *obj
 va_start (ap, fmt)
 dialog_VFatal (obj, false, title, fmt, ap)
 va_end (ap)
VLC_API void dialog_Login (vlc_object_t *, char **, char **, const char *, const char *,...) VLC_FORMAT(5
VLC_API int dialog_Question (vlc_object_t *, const char *, const char *, const char *, const char *, const char *)
 Asks a total (Yes/No/Cancel) question through the user interface.
VLC_API dialog_progress_bar_tdialog_ProgressCreate (vlc_object_t *, const char *, const char *, const char *) VLC_USED
 Creates a progress bar dialog.
VLC_API void dialog_ProgressDestroy (dialog_progress_bar_t *)
VLC_API void dialog_ProgressSet (dialog_progress_bar_t *, const char *, float)
VLC_API bool dialog_ProgressCancelled (dialog_progress_bar_t *)
VLC_API int dialog_Register (vlc_object_t *)
 Registers an object as the dialog provider.
VLC_API int dialog_Unregister (vlc_object_t *)
 Unregisters the dialog provider.

Variables

static const char * title
static const char const char * fmt
static const char const char
va_list 
ap

Detailed Description

User interaction dialog APIs.


Define Documentation

#define dialog_Fatal (   o,
  t,
  ... 
)    dialog_Fatal(VLC_OBJECT(o), t, __VA_ARGS__)
#define dialog_FatalWait (   o,
  t,
  ... 
)    dialog_FatalWait(VLC_OBJECT(o), t, __VA_ARGS__)
#define dialog_Login (   o,
  u,
  p,
  t,
  ... 
)    dialog_Login(VLC_OBJECT(o), u, p, t, __VA_ARGS__)
#define dialog_ProgressCreate (   o,
  t,
  m,
  c 
)    dialog_ProgressCreate(VLC_OBJECT(o), t, m, c)
#define dialog_Question (   o,
  t,
  m,
  y,
  n,
  c 
)    dialog_Question(VLC_OBJECT(o), t, m, y, n, c)
#define dialog_Register (   o  )     dialog_Register(VLC_OBJECT(o))
#define dialog_Unregister (   o  )     dialog_Unregister(VLC_OBJECT(o))

Typedef Documentation

A fatal error dialog.

No response expected from the user.

A question dialog.


Function Documentation

VLC_API void dialog_Login ( vlc_object_t ,
char **  ,
char **  ,
const char *  ,
const char *  ,
  ... 
)
VLC_API bool dialog_ProgressCancelled ( dialog_progress_bar_t  ) 
VLC_API dialog_progress_bar_t* dialog_ProgressCreate ( vlc_object_t ,
const char *  ,
const char *  ,
const char *   
)
VLC_API void dialog_ProgressDestroy ( dialog_progress_bar_t  ) 
VLC_API void dialog_ProgressSet ( dialog_progress_bar_t ,
const char *  ,
float   
)
VLC_API int dialog_Question ( vlc_object_t obj,
const char *  title,
const char *  text,
const char *  yes,
const char *  no,
const char *  cancel 
)

Asks a total (Yes/No/Cancel) question through the user interface.

Parameters:
obj VLC object emitting the question
title dialog box title
text dialog box text
yes first choice/button text
no second choice/button text
cancel third answer/button text, or NULL if no third option
Returns:
0 if the user could not answer the question (e.g. there is no UI), 1, 2 resp. 3 if the user pressed the first, second resp. third button.

References dialog_question_t::answer, dialog_GetProvider(), OBJECT_FLAGS_NOINTERACT, var_SetAddress, and vlc_object_release.

VLC_API int dialog_Register ( vlc_object_t obj  ) 

Registers an object as the dialog provider.

It is assumed that the appropriate variable callbacks are already registered.

References libvlc_priv(), libvlc_priv_t::p_dialog_provider, provider_lock, vlc_mutex_lock(), and vlc_mutex_unlock().

VLC_API int dialog_Unregister ( vlc_object_t obj  ) 

Unregisters the dialog provider.

Note that unless you have unregistered the callbacks already, the provider might still be in use by other threads. Also, you need to cancel all pending dialogs yourself.

References libvlc_priv(), libvlc_priv_t::p_dialog_provider, provider_lock, vlc_mutex_lock(), and vlc_mutex_unlock().

dialog_VFatal ( obj  ,
false  ,
title  ,
fmt  ,
ap   
)
VLC_API void dialog_VFatal ( vlc_object_t obj,
bool  modal,
const char *  title,
const char *  fmt,
va_list  ap 
)

Sends an error message through the user interface (if any).

Parameters:
obj the VLC object emitting the error
modal whether to wait for user to acknowledge the error before returning control to the caller
title title of the error dialog
fmt format string for the error message
ap parameters list for the formatted error message

References dialog_GetProvider(), msg_Err, msg_GenericVa, OBJECT_FLAGS_NOINTERACT, text, var_SetAddress, vasprintf(), VLC_MSG_ERR, and vlc_object_release.

va_end ( ap   ) 
va_start ( ap  ,
fmt   
)
static VLC_FORMAT ( ,
 
) [inline, static]

Variable Documentation

const char const char va_list ap
static const char const char * fmt
static const char * title
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines