• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

group.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008, 2009 Nokia Corporation.
00003  *
00004  * Contact: Marius Vollmer <marius.vollmer@nokia.com>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public License
00008  * version 2.1 as published by the Free Software Foundation.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00018  * 02110-1301 USA
00019  *
00020  */
00021 
00022 #ifndef GROUP_H
00023 #define GROUP_H
00024 
00025 #include <QObject>
00026 #include <QSet>
00027 #include <QStringList>
00028 
00029 namespace ContextProvider {
00030 
00031 class Property;
00032 class Service;
00033 
00034 class GroupPrivate;
00035 
00036 class Group : public QObject
00037 {
00038     Q_OBJECT
00039 
00040 public:
00041     explicit Group(QObject* parent = 0);
00042     ~Group();
00043 
00044     void add(const Property &prop);
00045 
00046     bool isSubscribedTo() const;
00047     QSet<const Property *> getProperties();
00048 
00049     inline Group &operator<<(const Property &prop)
00050     { add(prop); return *this; }
00051 
00052     inline Group &operator<<(const Property *prop)
00053     { add(*prop); return *this; }
00054 
00055 Q_SIGNALS:
00059     void firstSubscriberAppeared();
00060 
00064     void lastSubscriberDisappeared();
00065 
00066 private Q_SLOTS:
00067     void onFirstSubscriberAppeared();
00068     void onLastSubscriberDisappeared();
00069 
00070 private:
00071     GroupPrivate *priv;
00072 };
00073 
00074 } // end namespace
00075 
00076 #endif

Generated on Sun Jun 1 2014 17:31:05 for libcontextprovider by  doxygen 1.7.1