]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/openurl.hpp
Qt: add a new "Open URL" dialog
[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 _OPEN_URL_H
25 #define _OPEN_URL_H_
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32 #include "util/qvlcframe.hpp"
33
34 class ClickLineEdit;
35
36 class OpenUrlDialog : public QVLCDialog
37 {
38     Q_OBJECT
39
40 private:
41     OpenUrlDialog( QWidget *, intf_thread_t *, bool bClipboard = true );
42     QString lastUrl;
43     bool bClipboard, bShouldEnqueue;
44     ClickLineEdit *edit;
45
46     static OpenUrlDialog *instance;
47
48 private slots:
49     void enqueue();
50     void play();
51
52 public:
53     virtual ~OpenUrlDialog() {}
54
55     static OpenUrlDialog* getInstance( QWidget *parent,
56                                        intf_thread_t *p_intf,
57                                        bool bClipboard = true );
58
59     QString url() const;
60     bool shouldEnqueue() const;
61     void showEvent( QShowEvent *ev );
62
63 public slots:
64     virtual void close() { play(); };
65 };
66
67 #endif