File indexing completed on 2025-01-05 04:25:25

0001 /****************************************************************************************
0002  * Copyright (c) 2011 Emmanuel Wagner <manu.wagner@sfr.fr>                              *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef COVERGRID_APPLET_H
0018 #define COVERGRID_APPLET_H
0019 
0020 #include "context/Applet.h"
0021 #include "ui_CoverGridSettings.h"
0022 #include "core/meta/forward_declarations.h"
0023 
0024 class KConfigDialog;
0025 class QGraphicsProxyWidget;
0026 class QGraphicsGridLayout;
0027 
0028 namespace Plasma
0029 {
0030     class ScrollWidget;
0031 }
0032 
0033 class CoverGridApplet : public Context::Applet
0034 {
0035     Q_OBJECT
0036 
0037     public:
0038         CoverGridApplet( QObject* parent, const QVariantList& args );
0039         ~CoverGridApplet();
0040 
0041         void init();
0042         bool hasHeightForWidth() const;
0043 
0044     public Q_SLOTS:
0045         void slotAlbumQueryResult( Meta::AlbumList albums);
0046         void saveSettings();
0047 
0048     protected :
0049         void createConfigurationInterface(KConfigDialog *parent);
0050 
0051     private:
0052         void prepareLayout();
0053 
0054         QGraphicsProxyWidget * m_proxywidget;
0055         Plasma::ScrollWidget    *m_scroll;
0056         QGraphicsGridLayout * m_layout;
0057         Meta::AlbumList m_album_list;
0058         Ui::CoverGridSettings ui_Settings;
0059         int m_coversize;
0060 };
0061 
0062 AMAROK_EXPORT_APPLET( covergrid, CoverGridApplet )
0063 
0064 #endif /* COVERGRID_APPLET_H */