1 /***************************************************************************
2 begin : Fre Nov 15 2002
3 copyright : (C) Mark Kretschmann <markey@web.de>
4 : (C) Max Howell <max.howell@methylblue.com>
5 ***************************************************************************/
7 /***************************************************************************
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. *
14 ***************************************************************************/
16 #ifndef AMAROK_PLAYLISTWINDOW_H
17 #define AMAROK_PLAYLISTWINDOW_H
19 #include "amarok_export.h"
20 #include "dynamicmode.h"
22 #include <QtGui/QWidget> //baseclass
24 #include <khbox.h> //baseclass for DynamicBox
25 #include <kxmlguiwindow.h>
26 #include <kxmlguiclient.h> //baseclass (for XMLGUI)
38 * @short The MainWindow widget class.
40 * This is the main window widget (the Playlist not Player).
42 class AMAROK_EXPORT MainWindow
: public KXmlGuiWindow
53 void createGUI(); //should be private but App::slowConfigToolbars requires it
56 //allows us to switch browsers from within other browsers etc
57 void showBrowser( const QString
& name
);
58 void addBrowser( const QString
&name
, QWidget
*widget
, const QString
&text
, const QString
&icon
);
60 //takes into account minimized, multiple desktops, etc.
61 bool isReallyShown() const;
63 virtual bool eventFilter( QObject
*, QEvent
* );
65 //instance is declared in KXMLGUI
66 static MainWindow
*self() { return s_instance
; }
70 SideBar
*sideBar() const { return m_browsers
; }
74 void mbAvailabilityChanged( bool isAvailable
);
77 void slotShrinkBrowsers( int index
) const;
78 void savePlaylist() const;
79 void slotBurnPlaylist() const;
80 void slotShowCoverManager() const;
82 void slotAddLocation( bool directPlay
= false );
84 void playLastfmPersonal();
85 void addLastfmPersonal();
86 void playLastfmNeighbor();
87 void addLastfmNeighbor();
88 void playLastfmCustom();
89 void addLastfmCustom();
90 void playLastfmGlobaltag();
91 void addLastfmGlobaltag();
93 void showQueueManager();
94 void showScriptSelector();
95 void showStatistics();
96 void toolsMenuAboutToShow();
97 void slotToggleFocus();
98 void slotToggleToolbar();
99 // void slotEditFilter();
100 void slotSetFilter( const QString
&filter
);
103 virtual void closeEvent( QCloseEvent
* );
104 virtual void showEvent( QShowEvent
* );
105 virtual QSize
sizeHint() const;
108 enum MenuId
{ ID_SHOW_TOOLBAR
= 2000, ID_SHOW_PLAYERWINDOW
};
112 KMenu
*m_settingsMenu
;
114 QStringList m_browserNames
;
117 SearchWidget
*m_searchWidget
;
118 QWidget
*m_controlBar
;
119 QTimer
*m_timer
; //search filter timer
120 QStringList m_lastfmTags
;
121 MediaBrowser
*m_currMediaBrowser
;
122 QSplitter
*m_splitter
;
124 void createActions();
128 static MainWindow
*s_instance
;
131 class DynamicTitle
: public QWidget
136 DynamicTitle(QWidget
* parent
);
137 void setTitle(const QString
& newTitle
);
139 virtual void paintEvent(QPaintEvent
* e
);
142 static const int s_curveWidth
= 5;
143 static const int s_imageSize
= 16;
148 class DynamicBar
: public KHBox
153 DynamicBar(QWidget
* parent
);
157 void slotNewDynamicMode(const DynamicMode
* mode
);
158 void changeTitle(const QString
& title
);
161 DynamicTitle
* m_titleWidget
;
165 #endif //AMAROK_PLAYLISTWINDOW_H