1 /*****************************************************************************
2 * vlc_dialog.h: user interaction dialogs
3 *****************************************************************************
4 * Copyright (C) 2009 RĂ©mi Denis-Courmont
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
27 * User interaction dialog APIs
31 * A fatal error dialog.
32 * No response expected from the user.
34 typedef struct dialog_fatal_t
41 VLC_EXPORT( void, dialog_VFatal, (vlc_object_t *, bool, const char *, const char *, va_list) );
43 static inline LIBVLC_FORMAT(3, 4)
44 void dialog_Fatal (vlc_object_t *obj, const char *title, const char *fmt, ...)
49 dialog_VFatal(obj, false, title, fmt, ap);
52 #define dialog_Fatal(o, t, ...) \
53 dialog_Fatal(VLC_OBJECT(o), t, __VA_ARGS__)
55 static inline LIBVLC_FORMAT(3, 4)
56 void dialog_FatalWait (vlc_object_t *obj, const char *title,
57 const char *fmt, ...){
61 dialog_VFatal(obj, true, title, fmt, ap);
64 #define dialog_FatalWait(o, t, ...) \
65 dialog_FatalWait(VLC_OBJECT(o), t, __VA_ARGS__)
70 typedef struct dialog_login_t
78 VLC_EXPORT( void, dialog_Login, (vlc_object_t *, char **, char **, const char *, const char *, ...) ) LIBVLC_FORMAT (5, 6);
79 #define dialog_Login(o, u, p, t, ...) \
80 dialog_Login(VLC_OBJECT(o), u, p, t, __VA_ARGS__)
85 typedef struct dialog_question_t
95 VLC_EXPORT( int, dialog_Question, (vlc_object_t *, const char *, const char *, const char *, const char *, const char *) );
96 #define dialog_Question(o, t, m, y, n, c) \
97 dialog_Question(VLC_OBJECT(o), t, m, y, n, c)
99 typedef struct dialog_progress_bar_t
100 { /* Request-time parameters */
104 /* Permanent parameters */
106 void (*pf_update) (void *, const char *, float);
107 bool (*pf_check) (void *);
108 void (*pf_destroy) (void *);
110 } dialog_progress_bar_t;
112 VLC_EXPORT( dialog_progress_bar_t *, dialog_ProgressCreate, (vlc_object_t *, const char *, const char *, const char *) );
113 #define dialog_ProgressCreate(o, t, m, c) \
114 dialog_ProgressCreate(VLC_OBJECT(o), t, m, c)
115 VLC_EXPORT( void, dialog_ProgressDestroy, (dialog_progress_bar_t *) );
116 VLC_EXPORT( void, dialog_ProgressSet, (dialog_progress_bar_t *, const char *, float) );
117 VLC_EXPORT( bool, dialog_ProgressCancelled, (dialog_progress_bar_t *) );
119 VLC_EXPORT( int, dialog_Register, (vlc_object_t *) );
120 VLC_EXPORT( int, dialog_Unregister, (vlc_object_t *) );
121 #define dialog_Register(o) dialog_Register(VLC_OBJECT(o))
122 #define dialog_Unregister(o) dialog_Unregister(VLC_OBJECT(o))