Revert previous commit, was incorrect
[amarok.git] / src / servicebrowser / ServiceInfoProxy.h
blob7d7a9fb123252c140df48d7ef855c2db0646294a
1 /***************************************************************************
2 * Copyright (c) 2007 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 ***************************************************************************/
20 #ifndef SERVICEINFOPROXY_H
21 #define SERVICEINFOPROXY_H
23 #include "amarok_export.h"
24 #include "ServiceInfoObserver.h"
26 #include <QVariant>
27 #include <QSet>
30 /**
31 A proxy class for relaying information from the currently active service to the ServiceEngine so it can be displayed in a plasma applet in the context view. It is a singleton and included in the "THE" namespace for easy access
33 Nikolaj Hald Nielsen <nhnFreespirit@gmail.com>
35 class AMAROK_EXPORT ServiceInfoProxy{
36 public:
38 static /*AMAROK_EXPORT*/ ServiceInfoProxy * instance();
39 ~ServiceInfoProxy();
41 void /*AMAROK_EXPORT*/ subscribe( ServiceInfoObserver *observer );
42 void /*AMAROK_EXPORT*/ unsubscribe( ServiceInfoObserver *observer );
44 void setInfo( QVariantMap infoMap );
45 QVariantMap /*AMAROK_EXPORT*/ info();
47 private:
49 ServiceInfoProxy();
50 void notifyObservers( QVariantMap infoMap ) const;
51 QSet<ServiceInfoObserver *> m_observers;
53 static ServiceInfoProxy * m_instance;
55 QVariantMap m_storedInfo;
58 #endif