]> git.sesse.net Git - vlc/blob - modules/gui/macosx/coredialogs.h
macosx: Update progress dialog on the main thread, make check thread safe
[vlc] / modules / gui / macosx / coredialogs.h
1 /*****************************************************************************
2  * coredialogs.h: Mac OS X Core Dialogs
3  *****************************************************************************
4  * Copyright (C) 2005-2012 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Derk-Jan Hartman <hartman at videolan dot org>
8  *          Felix Paul Kühne <fkuehne at videolan dot org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24 #import <vlc_common.h>
25 #import <vlc_dialog.h>
26 #import <Cocoa/Cocoa.h>
27
28
29 /*****************************************************************************
30  * VLCErrorPanel interface
31  *****************************************************************************/
32
33 @interface VLCErrorPanel : NSObject
34 {
35     IBOutlet id o_window;
36     IBOutlet id o_cleanup_button;
37     IBOutlet id o_error_table;
38
39     NSMutableArray * o_errors;
40     NSMutableArray * o_icons;
41
42     BOOL b_nib_loaded;
43 }
44 - (IBAction)cleanupTable:(id)sender;
45
46 -(void)showPanel;
47 -(void)addError: (NSString *)o_error withMsg:(NSString *)o_msg;
48
49 @end
50
51 /*****************************************************************************
52  * VLCCoreDialogProvider interface
53  *****************************************************************************/
54 @interface VLCCoreDialogProvider : NSObject
55 {
56     VLCErrorPanel *o_error_panel;
57
58     /* authentication dialogue */
59     IBOutlet id o_auth_cancel_btn;
60     IBOutlet id o_auth_description_txt;
61     IBOutlet id o_auth_login_fld;
62     IBOutlet id o_auth_login_txt;
63     IBOutlet id o_auth_ok_btn;
64     IBOutlet id o_auth_pw_fld;
65     IBOutlet id o_auth_pw_txt;
66     IBOutlet id o_auth_title_txt;
67     IBOutlet id o_auth_win;
68
69     /* progress dialogue */
70     IBOutlet NSProgressIndicator * o_prog_bar;
71     IBOutlet id o_prog_cancel_btn;
72     IBOutlet id o_prog_description_txt;
73     IBOutlet id o_prog_title_txt;
74     IBOutlet id o_prog_win;
75     BOOL b_progress_cancelled;
76 }
77 + (VLCCoreDialogProvider *)sharedInstance;
78
79 @property (atomic,readwrite) BOOL progressCancelled;
80
81 -(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type;
82
83 -(void)showFatalDialog: (NSValue *)o_value;
84 -(void)showFatalWaitDialog: (NSValue *)o_value;
85 -(void)showQuestionDialog: (NSValue *)o_value;
86
87 -(void)showLoginDialog: (NSValue *)o_value;
88 -(IBAction)loginDialogAction:(id)sender;
89
90 -(void)showProgressDialogOnMainThread: (NSValue *)o_value;
91 -(void)showProgressDialog: (NSValue *)o_value;
92 -(IBAction)progDialogAction:(id)sender;
93 -(void)updateProgressPanelWithText: (NSString *)string andNumber: (double)d_number;
94 -(void)destroyProgressPanel;
95
96 -(id)errorPanel;
97
98 @end