dialogs_provider.hpp 2.85 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

zorglub's avatar
zorglub committed
30
#include "dialogs/interaction.hpp"
zorglub's avatar
zorglub committed
31

zorglub's avatar
zorglub committed
32
#include <assert.h>
zorglub's avatar
zorglub committed
33
34
#include <vlc/vlc.h>
#include <vlc/intf.h>
zorglub's avatar
zorglub committed
35
36

class QEvent;
zorglub's avatar
zorglub committed
37
38
class QSignalMapper;
class QVLCMenu;
zorglub's avatar
zorglub committed
39
40
41
42
43

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

public slots:
    void playlistDialog();
zorglub's avatar
zorglub committed
76
    void bookmarksDialog();
77
    void MediaInfoDialog();
zorglub's avatar
zorglub committed
78
    void prefsDialog();
zorglub's avatar
zorglub committed
79
    void extendedDialog();
zorglub's avatar
zorglub committed
80
    void messagesDialog();
zorglub's avatar
zorglub committed
81
82
    void simplePLAppendDialog();
    void simpleMLAppendDialog();
zorglub's avatar
zorglub committed
83
84
    void simpleOpenDialog();
    void openDialog();
zorglub's avatar
zorglub committed
85
86
    void PLAppendDialog();
    void MLAppendDialog();
zorglub's avatar
zorglub committed
87
88
    void openDialog( int );
    void popupMenu( int );
zorglub's avatar
zorglub committed
89
    void doInteraction( intf_dialog_args_t * );
zorglub's avatar
zorglub committed
90
    void menuAction( QObject *);
91
    void menuUpdateAction( QObject *);
zorglub's avatar
zorglub committed
92
    void SDMenuAction( QString );
zorglub's avatar
zorglub committed
93
    void streamingDialog();
zorglub's avatar
zorglub committed
94
95
96
    void openPlaylist();
    void openDirectory();
    void openMLDirectory();
zorglub's avatar
zorglub committed
97
    void quit();
zorglub's avatar
zorglub committed
98
    void switchToSkins();
zorglub's avatar
zorglub committed
99
100
101
};

#endif