make MemoryQueryMaker use new matcher classes instead of old private ones
[amarok.git] / src / MainWindow.h
bloba1ddffca337a7448cdc76030e897e2fb202ba97c
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"
21 #include <khbox.h> //baseclass for DynamicBox
22 #include <kxmlguiwindow.h>
23 #include <kxmlguiclient.h> //baseclass (for XMLGUI)
25 class KMenu;
26 class MediaBrowser;
27 class QMenuBar;
28 class QTimer;
29 class SearchWidget;
30 class SideBar;
31 class QSplitter;
33 /**
34 * @class MainWindow
35 * @short The MainWindow widget class.
37 * This is the main window widget (the Playlist not Player).
39 class AMAROK_EXPORT MainWindow : public KXmlGuiWindow
41 Q_OBJECT
43 public:
44 MainWindow();
45 ~MainWindow();
47 void init();
49 //allows us to switch browsers from within other browsers etc
50 void showBrowser( const QString& name );
51 void addBrowser( const QString &name, QWidget *widget, const QString &text, const QString &icon );
53 //takes into account minimized, multiple desktops, etc.
54 bool isReallyShown() const;
56 virtual bool eventFilter( QObject*, QEvent* );
58 //instance is declared in KXMLGUI
59 static MainWindow *self() { return s_instance; }
61 void activate();
63 SideBar *sideBar() const { return m_browsers; }
65 public slots:
66 void showHide();
67 void mbAvailabilityChanged( bool isAvailable );
69 private slots:
70 void slotShrinkBrowsers( int index ) const;
71 void savePlaylist() const;
72 void slotBurnPlaylist() const;
73 void slotShowCoverManager() const;
74 void slotPlayMedia();
75 void slotAddLocation( bool directPlay = false );
76 void slotAddStream();
77 void playLastfmPersonal();
78 void addLastfmPersonal();
79 void playLastfmNeighbor();
80 void addLastfmNeighbor();
81 void playLastfmCustom();
82 void addLastfmCustom();
83 void playLastfmGlobaltag();
84 void addLastfmGlobaltag();
85 void playAudioCD();
86 void showQueueManager();
87 void showScriptSelector();
88 void showStatistics();
89 void toolsMenuAboutToShow();
90 void slotToggleFocus();
91 void slotToggleToolbar();
92 // void slotEditFilter();
93 void slotSetFilter( const QString &filter );
95 protected:
96 virtual void closeEvent( QCloseEvent* );
97 virtual void showEvent( QShowEvent* );
98 virtual QSize sizeHint() const;
100 private:
101 enum MenuId { ID_SHOW_TOOLBAR = 2000, ID_SHOW_PLAYERWINDOW };
103 QMenuBar *m_menubar;
104 KMenu *m_toolsMenu;
105 KMenu *m_settingsMenu;
106 SideBar *m_browsers;
107 QStringList m_browserNames;
108 KMenu *m_searchMenu;
110 SearchWidget *m_searchWidget;
111 QWidget *m_controlBar;
112 QTimer *m_timer; //search filter timer
113 QStringList m_lastfmTags;
114 MediaBrowser *m_currMediaBrowser;
115 QSplitter *m_splitter;
117 void createActions();
118 void createMenus();
119 int m_lastBrowser;
120 int m_searchField;
121 static MainWindow *s_instance;
125 #endif //AMAROK_PLAYLISTWINDOW_H