]> git.sesse.net Git - vlc/blob - modules/gui/kde/interface.h
forgot to add the actual code in my last commit
[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 #include "messages.h"
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
48          * actual file and window*/
49         void slotFileClose();
50         /** closes all open windows by calling close() on each
51          * memberList item until the list is empty, then quits the
52          * application.  If queryClose() returns false because the
53          * user canceled the saveModified() dialog, the closing
54          * breaks.
55          */
56         void slotFileQuit();
57         void slotShowPreferences();
58
59         /** toggles the toolbar
60          */
61         void slotViewToolBar();
62         /** toggles the statusbar
63          */
64         void slotViewStatusBar();
65         /** changes the statusbar contents for the standard label
66          * permanently, used to indicate current actions.
67          * @param text the text that is displayed in the statusbar
68          */
69         void slotStatusMsg( const QString &text );
70         void slotShowMessages();
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 position );
88
89         /** called every time the slider changes values */
90         void slotSliderChanged( int position );
91
92         void slotOpenDisk();
93         void slotOpenStream();
94
95         void slotBackward();
96         void slotStop();
97         void slotPlay();
98         void slotPause();
99         void slotSlow();
100         void slotFast();
101         void slotPrev();
102         void slotNext();
103
104   private:
105
106         intf_thread_t    *p_intf;
107         KMessagesWindow *p_messagesWindow;
108
109         /** to call p_intf->pf_manage every now and then */
110         QTimer            *fTimer;
111
112         /** slider which works well with user movement */
113         KVLCSlider    *fSlider;
114
115         /** open dvd/vcd */
116         KDiskDialog    *fDiskDialog;
117
118         /** open net stream */
119         KNetDialog        *fNetDialog;
120
121         KTitleMenu        *fTitleMenu;
122
123         // KAction pointers to enable/disable actions
124         KAction             *fileOpen;
125         KAction             *diskOpen;
126         KAction             *streamOpen;
127         KRecentFilesAction  *fileOpenRecent;
128         KAction             *fileClose;
129         KAction             *fileQuit;
130         KToggleAction       *viewToolBar;
131         KToggleAction       *viewStatusBar;
132         KAction             *backward;
133         KAction             *stop;
134         KAction             *play;
135         KAction             *pause;
136         KAction             *slow;
137         KAction             *fast;
138         KAction             *prev;
139         KAction             *next;
140         KAction             *messages;
141         KAction             *preferences;
142 };
143
144 /*****************************************************************************
145  * intf_sys_t: description and status of KDE interface
146  *****************************************************************************/
147 struct intf_sys_t
148 {
149     KApplication *p_app;
150     KInterface   *p_window;
151     KAboutData   *p_about;
152
153     input_thread_t *p_input;
154     msg_subscription_t *p_msg;
155 };
156
157 #endif /* _KDE_INTERFACE_H_ */