]> git.sesse.net Git - vlc/blob - modules/gui/kde/interface.h
17569995582e1bbcee9125bb16013e71902ea2c6
[vlc] / modules / gui / kde / interface.h
1 /***************************************************************************
2                           interface.h  -  description
3                              -------------------
4     begin                : Sun Mar 25 2001
5     copyright            : (C) 2001 by andres
6     email                : dae@chez.com
7  ***************************************************************************/
8
9 #ifndef _KDE_INTERFACE_H_
10 #define _KDE_INTERFACE_H_
11
12 #include "common.h"
13
14 #include <kaction.h>
15 #include <kmainwindow.h>
16 #include <kapplication.h>
17 #include <kurl.h>
18 #include <qdragobject.h>
19 #include <qstring.h>
20 #include <qwidget.h>
21 #include "messages.h"
22 class KThread;
23
24 class KDiskDialog;
25 class KNetDialog;
26 class KRecentFilesAction;
27 class KTitleMenu;
28 class KToggleAction;
29 class KVLCSlider;
30
31 /**Main Window for the KDE vlc interface
32   *@author andres
33   */
34
35 class KInterface : public KMainWindow
36 {
37     Q_OBJECT
38     public:
39         KInterface(intf_thread_t *p_intf, QWidget *parent=0,
40                    const char *name=0);
41         ~KInterface();
42
43     public slots:
44         /** open a file and load it into the document*/
45         void slotFileOpen();
46         /** opens a file from the recent files menu */
47         void slotFileOpenRecent(const KURL& url);
48         /** closes all open windows by calling close() on each
49          * memberList item until the list is empty, then quits the
50          * application.  If queryClose() returns false because the
51          * user canceled the saveModified() dialog, the closing
52          * breaks.
53          */
54         void slotFileQuit();
55         void slotShowPreferences();
56
57         /** toggles the toolbar
58          */
59         void slotViewToolBar();
60         /** toggles the statusbar
61          */
62         void slotViewStatusBar();
63         /** changes the statusbar contents for the standard label
64          * permanently, used to indicate current actions.
65          * @param text the text that is displayed in the statusbar
66          */
67         void slotStatusMsg( const QString &text );
68         void slotShowMessages();
69         void slotShowInfo();
70         void slotSetLanguage( bool, es_descriptor_t * );
71
72     protected:
73         /** initializes the KActions of the application */
74         void initActions();
75         /** sets up the statusbar for the main window by initialzing a statuslabel.
76          */
77         void initStatusBar();
78
79         virtual void dragEnterEvent( QDragEnterEvent *event );
80         virtual void dropEvent( QDropEvent *event );
81
82     private slots:
83         /** we use this to manage the communication with the vlc core */
84         void slotManage();
85
86         /** this slot is called when we drag the position seek bar */
87         void slotSliderMoved( int );
88
89         /** called every time the slider changes values */
90         void slotSliderChanged( int position );
91
92         void slotUpdateLanguages();
93         
94         void slotOpenDisk();
95         void slotOpenStream();
96
97         void slotBackward();
98         void slotStop();
99         void slotPlay();
100         void slotPause();
101         void slotSlow();
102         void slotFast();
103         void slotPrev();
104         void slotNext();
105
106   private:
107         void languageMenus( KActionMenu *, es_descriptor_t *, int );
108
109         intf_thread_t    *p_intf;
110         KMessagesWindow *p_messagesWindow;
111
112         /** to call p_intf->pf_manage every now and then */
113         QTimer            *fTimer;
114
115         /** slider which works well with user movement */
116         KVLCSlider    *fSlider;
117
118         /** open dvd/vcd */
119         KDiskDialog    *fDiskDialog;
120
121         /** open net stream */
122         KNetDialog        *fNetDialog;
123
124         KTitleMenu        *fTitleMenu;
125
126         // KAction pointers to enable/disable actions
127         KAction             *fileOpen;
128         KAction             *diskOpen;
129         KAction             *streamOpen;
130         KRecentFilesAction  *fileOpenRecent;
131         KAction             *fileQuit;
132         KToggleAction       *viewToolBar;
133         KToggleAction       *viewStatusBar;
134         KAction             *backward;
135         KAction             *stop;
136         KAction             *play;
137         KAction             *pause;
138         KAction             *slow;
139         KAction             *fast;
140         KAction             *prev;
141         KAction             *next;
142         KAction             *messages;
143         KAction             *preferences;
144         KAction             *info;
145         KActionMenu         *languages;
146         KActionMenu         *subtitles;
147         KActionCollection   *languageCollection;
148         KActionCollection   *subtitleCollection;
149         KActionMenu         *program;
150         KActionMenu         *title;
151         KActionMenu         *chapter;
152 };
153
154 /*****************************************************************************
155  * intf_sys_t: description and status of KDE interface
156  *****************************************************************************/
157 struct intf_sys_t
158 {
159     KApplication *p_app;
160     KInterface   *p_window;
161     KAboutData   *p_about;
162     int b_playing;
163
164     input_thread_t *p_input;
165     msg_subscription_t *p_msg;
166 };
167
168 #endif /* _KDE_INTERFACE_H_ */