dialogs_provider.hpp 2.66 KB
Newer Older
zorglub's avatar
zorglub committed
1
2
3
/*****************************************************************************
 * dialogs_provider.hpp : Dialogs provider
 ****************************************************************************
4
5
 * Copyright (C) 2006 the VideoLAN team
 * $Id$
zorglub's avatar
zorglub committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *
 * Authors: Clément Stenac <zorglub@videolan.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/

#ifndef _DIALOGS_PROVIDER_H_
#define _DIALOGS_PROVIDER_H_

#include <QObject>
zorglub's avatar
zorglub committed
27
28
#include <QTimer>
#include <QApplication>
zorglub's avatar
zorglub committed
29
#include <vlc/vlc.h>
zorglub's avatar
zorglub committed
30
31
#include <vlc/intf.h>
#include "dialogs/interaction.hpp"
zorglub's avatar
zorglub committed
32
#include <assert.h>
zorglub's avatar
zorglub committed
33
34

class QEvent;
zorglub's avatar
zorglub committed
35
36
class QSignalMapper;
class QVLCMenu;
zorglub's avatar
zorglub committed
37
38
39
40
41

class DialogsProvider : public QObject
{
    Q_OBJECT;
public:
zorglub's avatar
zorglub committed
42
    static DialogsProvider *getInstance()
zorglub's avatar
zorglub committed
43
44
45
46
    {
        assert( instance );
        return instance;
    }
zorglub's avatar
zorglub committed
47
48
    static DialogsProvider *getInstance( intf_thread_t *p_intf )
    {
zorglub's avatar
zorglub committed
49
50
        if( !instance )
            instance = new DialogsProvider( p_intf );
zorglub's avatar
zorglub committed
51
52
53
        return instance;
    }
    virtual ~DialogsProvider();
zorglub's avatar
zorglub committed
54
55
    QTimer *idle_timer;
    QTimer *fixed_timer;
zorglub's avatar
zorglub committed
56
protected:
zorglub's avatar
zorglub committed
57
58
    friend class QVLCMenu;
    QSignalMapper *menusMapper;
59
    QSignalMapper *menusUpdateMapper;
zorglub's avatar
zorglub committed
60
61
    void customEvent( QEvent *);
private:
zorglub's avatar
zorglub committed
62
    DialogsProvider( intf_thread_t *);
zorglub's avatar
zorglub committed
63
64
    intf_thread_t *p_intf;
    static DialogsProvider *instance;
zorglub's avatar
zorglub committed
65
    QStringList showSimpleOpen();
zorglub's avatar
zorglub committed
66
67
68

public slots:
    void playlistDialog();
zorglub's avatar
zorglub committed
69
    void bookmarksDialog();
zorglub's avatar
zorglub committed
70
    void streaminfoDialog();
zorglub's avatar
zorglub committed
71
72
    void prefsDialog();
    void messagesDialog();
zorglub's avatar
zorglub committed
73
74
    void simplePLAppendDialog();
    void simpleMLAppendDialog();
zorglub's avatar
zorglub committed
75
76
    void simpleOpenDialog();
    void openDialog();
zorglub's avatar
zorglub committed
77
78
    void PLAppendDialog();
    void MLAppendDialog();
zorglub's avatar
zorglub committed
79
80
    void openDialog( int );
    void popupMenu( int );
zorglub's avatar
zorglub committed
81
    void doInteraction( intf_dialog_args_t * );
zorglub's avatar
zorglub committed
82
    void menuAction( QObject *);
83
    void menuUpdateAction( QObject *);
zorglub's avatar
zorglub committed
84
    void streamingDialog();
zorglub's avatar
zorglub committed
85
86
87
    void openPlaylist();
    void openDirectory();
    void openMLDirectory();
zorglub's avatar
zorglub committed
88
    void quit();
zorglub's avatar
zorglub committed
89
90
91
92
};


#endif