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