Revert previous commit, was incorrect
[amarok.git] / src / MainWindow.h
blob0cad36eda477d3c6371147ae67f0f6a5652e5198
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 /***************************************************************************
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 ***************************************************************************/
16 #ifndef AMAROK_PLAYLISTWINDOW_H
17 #define AMAROK_PLAYLISTWINDOW_H
19 #include "amarok_export.h"
20 #include "widgets/MainToolbar.h"
22 #include <khbox.h> //baseclass for DynamicBox
23 #include <kxmlguiwindow.h>
24 #include <kxmlguiclient.h> //baseclass (for XMLGUI)
26 class KMenu;
27 class MediaBrowser;
28 class QMenuBar;
29 class QTimer;
30 class SearchWidget;
31 class SideBar;
32 class QSplitter;
34 /**
35 * @class MainWindow
36 * @short The MainWindow widget class.
38 * This is the main window widget (the Playlist not Player).
40 class AMAROK_EXPORT MainWindow : public KXmlGuiWindow
42 Q_OBJECT
44 public:
45 MainWindow();
46 ~MainWindow();
48 void init();
50 //allows us to switch browsers from within other browsers etc
51 void showBrowser( const QString& name );
52 void addBrowser( const QString &name, QWidget *widget, const QString &text, const QString &icon );
54 //takes into account minimized, multiple desktops, etc.
55 bool isReallyShown() const;
57 virtual bool eventFilter( QObject*, QEvent* );
59 //instance is declared in KXMLGUI
60 static MainWindow *self() { return s_instance; }
62 void activate();
64 SideBar *sideBar() const { return m_browsers; }
65 void deleteBrowsers();
67 public slots:
68 void showHide();
70 private slots:
71 void slotShrinkBrowsers( int index ) const;
72 void savePlaylist() const;
73 void slotBurnPlaylist() const;
74 void slotShowCoverManager() const;
75 void slotPlayMedia();
76 void slotAddLocation( bool directPlay = false );
77 void slotAddStream();
78 void playLastfmPersonal();
79 void addLastfmPersonal();
80 void playLastfmNeighbor();
81 void addLastfmNeighbor();
82 void playLastfmCustom();
83 void addLastfmCustom();
84 void playLastfmGlobaltag();
85 void addLastfmGlobaltag();
86 void playAudioCD();
87 void showQueueManager();
88 void showScriptSelector();
89 void showStatistics();
90 void toolsMenuAboutToShow();
91 void slotToggleFocus();
92 void slotToggleToolbar();
93 // void slotEditFilter();
94 void slotSetFilter( const QString &filter );
96 protected:
97 virtual void closeEvent( QCloseEvent* );
98 virtual void showEvent( QShowEvent* );
99 virtual QSize sizeHint() const;
101 private:
102 enum MenuId { ID_SHOW_TOOLBAR = 2000, ID_SHOW_PLAYERWINDOW };
104 QMenuBar *m_menubar;
105 KMenu *m_toolsMenu;
106 KMenu *m_settingsMenu;
107 SideBar *m_browsers;
108 QStringList m_browserNames;
109 KMenu *m_searchMenu;
111 SearchWidget *m_searchWidget;
112 MainToolbar *m_controlBar;
113 QTimer *m_timer; //search filter timer
114 QStringList m_lastfmTags;
115 MediaBrowser *m_currMediaBrowser;
116 QSplitter *m_splitter;
118 void createActions();
119 void createMenus();
120 int m_lastBrowser;
121 int m_searchField;
122 static MainWindow *s_instance;
126 #endif //AMAROK_PLAYLISTWINDOW_H