playlistsplitter.h 2.44 KB
Newer Older
1 2
/***************************************************************************
    begin                : Fri Sep 13 2002
3
    copyright            : (C) 2002 - 2004 by Scott Wheeler
4
    email                : wheeler@kde.org
5 6 7 8 9 10 11 12 13 14 15 16 17 18
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PLAYLISTSPLITTER_H
#define PLAYLISTSPLITTER_H

19 20 21
#include <kfiledialog.h>

#include <qwidgetstack.h>
22 23

#include "playlistbox.h"
24

25
class KActionMenu;
26
class KDirWatch;
27
class PlaylistItem;
28
class SearchWidget;
29
class HistoryPlaylist;
30 31
class PlaylistInterface;
class TagEditor;
32

33 34
/**
 * This is the main layout class of JuK.  It should contain a PlaylistBox and
35
 * a QWidgetStack of the Playlists.
36
 *
37
 * This class serves as a "mediator" (see "Design Patterns") between the JuK
38 39
 * class and the playlist classes.  Thus all access to the playlist classes from
 * non-Playlist related classes should be through the public API of this class.
40
 */
41

42
class PlaylistSplitter : public QSplitter
43 44
{
    Q_OBJECT
45

46
public:
47
    PlaylistSplitter(QWidget *parent, const char *name = 0);
48
    virtual ~PlaylistSplitter();
49

50
    PlaylistInterface *playlist() const { return m_playlistBox; }
51

52
private:
53

54 55 56 57
    /**
     * This returns a pointer to the first item in the playlist on the top
     * of the QWidgetStack of playlists.
     */
58
    Playlist *visiblePlaylist() const { return m_playlistBox->currentPlaylist(); }
59

60
    void setupActions();
61 62
    void setupLayout();
    void readConfig();
63
    void saveConfig();
64

65
private slots:
Scott Wheeler's avatar
Scott Wheeler committed
66 67 68 69 70

    /**
     * Updates the visible search results based on the result of the search
     * associated with the currently visible playlist.
     */
71
    void slotShowSearchResults();
72
    void slotPlaylistSelectionChanged();
73

74
private:
75
    PlaylistBox *m_playlistBox;
76
    SearchWidget *m_searchWidget;
77 78
    QWidgetStack *m_playlistStack;
    TagEditor *m_editor;
79 80 81
};

#endif