1
/***************************************************************************
2
 *   Copyright (c) 2008  Nikolaj Hald Nielsen <nhnFreespirit@gmail.com>    *
3
 *                                                                         *
4
 *   This program is free software; you can redistribute it and/or modify  *
5
 *   it under the terms of the GNU General Public License as published by  *
6
 *   the Free Software Foundation; either version 2 of the License, or     *
7
 *   (at your option) any later version.                                   *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
18
 ***************************************************************************/
19
 
20
#ifndef POPUPDROPPERFACTORY_H
21
#define POPUPDROPPERFACTORY_H
22
23
#include "amarok_export.h"
24
#include "context/popupdropper/libpud/PopupDropper.h"
25
26
/**
27
A central place for creating a Pud that matches system colors
28
29
	@author Nikolaj Hald Nielsen <nhnFreespirit@gmail.com>
30
*/
31
class PopupDropperFactory;
32
33
namespace The {
34
    AMAROK_EXPORT PopupDropperFactory* popupDropperFactory();
35
}
36
37
class AMAROK_EXPORT PopupDropperFactory : public QObject
38
{
39
    Q_OBJECT
40
41
    friend PopupDropperFactory* The::popupDropperFactory();
42
43
    public:
44
        /**
45
         * Create a new PopupDropper with correct system colors. This function creates it on top of the context viev
46
         * @return The newly created PopupDropper
47
         */
48
        PopupDropper * createPopupDropper();
49
        
50
        /**
51
         * OVerloaded function for creating a new PopupDropper witha custom parent
52
         * @param parent The widget to act as the parent
53
         * @return The newly created PopupDropper
54
         */
55
        PopupDropper * createPopupDropper( QWidget * parent );
56
57
        PopupDropperItem* createItem( PopupDropperAction * action );
58
59
        /**
60
         * Adjusts the submenu item given to be like those created in createItem
61
         * @param item The item to be adjusted
62
         */
63
        void adjustSubmenuItem( PopupDropperItem * item );
64
65
    private:
66
        PopupDropperFactory( QObject* parent );
67
        ~PopupDropperFactory();
68
 };
69
70
71
#endif