]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/openurl.hpp
qt4: attempt to work around a design flaw in the toolbar editor
[vlc] / modules / gui / qt4 / dialogs / openurl.hpp
1 /*****************************************************************************
2  * openurl.hpp: Open a MRL or clipboard content
3  ****************************************************************************
4  * Copyright © 2009 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Philippe André <jpeg@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  ******************************************************************************/
23
24 #ifndef QVLC_OPEN_URL_H_
25 #define QVLC_OPEN_URL_H_ 1
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32 #include "util/qvlcframe.hpp"
33 #include "util/singleton.hpp"
34
35 class ClickLineEdit;
36
37 class OpenUrlDialog : public QVLCDialog
38 {
39     Q_OBJECT
40
41 private:
42     QString lastUrl;
43     bool bClipboard, bShouldEnqueue;
44     ClickLineEdit *edit;
45
46 private slots:
47     void enqueue();
48     void play();
49
50 public:
51     OpenUrlDialog( intf_thread_t *, bool bClipboard = true );
52     virtual ~OpenUrlDialog() {}
53
54     QString url() const;
55     bool shouldEnqueue() const;
56     void showEvent( QShowEvent *ev );
57
58 public slots:
59     virtual void close() { play(); };
60
61 };
62
63 #endif