Changeset View
Changeset View
Standalone View
Standalone View
src/KPropertySet.h
Show All 24 Lines | |||||
25 | #include <QObject> | 25 | #include <QObject> | ||
26 | #include <QHash> | 26 | #include <QHash> | ||
27 | #include <QDebug> | 27 | #include <QDebug> | ||
28 | 28 | | |||
29 | #include "KProperty.h" | 29 | #include "KProperty.h" | ||
30 | 30 | | |||
31 | //! An interface for functor selecting properties. | 31 | //! An interface for functor selecting properties. | ||
32 | /*! Used in Iterator. */ | 32 | /*! Used in Iterator. */ | ||
33 | class KPROPERTY_EXPORT KPropertySelector | 33 | class KPROPERTYCORE_EXPORT KPropertySelector | ||
34 | { | 34 | { | ||
35 | public: | 35 | public: | ||
36 | KPropertySelector(); | 36 | KPropertySelector(); | ||
37 | virtual ~KPropertySelector(); | 37 | virtual ~KPropertySelector(); | ||
38 | 38 | | |||
39 | //! An operator implementing the functor. | 39 | //! An operator implementing the functor. | ||
40 | virtual bool operator()(const KProperty& prop) const = 0; | 40 | virtual bool operator()(const KProperty& prop) const = 0; | ||
41 | 41 | | |||
42 | //! Creates a deep copy of the selector. | 42 | //! Creates a deep copy of the selector. | ||
43 | //! Required for proper usage of the selector. | 43 | //! Required for proper usage of the selector. | ||
44 | virtual KPropertySelector* clone() const = 0; | 44 | virtual KPropertySelector* clone() const = 0; | ||
45 | }; | 45 | }; | ||
46 | 46 | | |||
47 | //! A class to iterate over a Set. | 47 | //! A class to iterate over a Set. | ||
48 | /*! It behaves like a QList::ConstIterator. | 48 | /*! It behaves like a QList::ConstIterator. | ||
49 | Usage: | 49 | Usage: | ||
50 | @code for (Set::Iterator it(set); it.current(); ++it) { .... } | 50 | @code for (Set::Iterator it(set); it.current(); ++it) { .... } | ||
51 | @endcode | 51 | @endcode | ||
52 | Usage with selector: | 52 | Usage with selector: | ||
53 | @code for (Set::Iterator it(set, MySelector()); it.current(); ++it) { .... } | 53 | @code for (Set::Iterator it(set, MySelector()); it.current(); ++it) { .... } | ||
54 | @endcode */ | 54 | @endcode */ | ||
55 | class KPROPERTY_EXPORT KPropertySetIterator | 55 | class KPROPERTYCORE_EXPORT KPropertySetIterator | ||
56 | { | 56 | { | ||
57 | public: | 57 | public: | ||
58 | //! Creates iterator for @a set set of properties. | 58 | //! Creates iterator for @a set set of properties. | ||
59 | /*! The properties are sorted by insertion order by default. | 59 | /*! The properties are sorted by insertion order by default. | ||
60 | Use setOrder(Iterator::Alphabetical) to have alphabetical order. */ | 60 | Use setOrder(Iterator::Alphabetical) to have alphabetical order. */ | ||
61 | explicit KPropertySetIterator(const KPropertySet &set); | 61 | explicit KPropertySetIterator(const KPropertySet &set); | ||
62 | 62 | | |||
63 | //! Creates iterator for @a set set of properties. | 63 | //! Creates iterator for @a set set of properties. | ||
Show All 39 Lines | |||||
103 | }; | 103 | }; | ||
104 | 104 | | |||
105 | /*! \brief Set of properties | 105 | /*! \brief Set of properties | ||
106 | 106 | | |||
107 | \author Cedric Pasteur <cedric.pasteur@free.fr> | 107 | \author Cedric Pasteur <cedric.pasteur@free.fr> | ||
108 | \author Alexander Dymo <cloudtemple@mskat.net> | 108 | \author Alexander Dymo <cloudtemple@mskat.net> | ||
109 | \author Jarosław Staniek <staniek@kde.org> | 109 | \author Jarosław Staniek <staniek@kde.org> | ||
110 | */ | 110 | */ | ||
111 | class KPROPERTY_EXPORT KPropertySet : public QObject | 111 | class KPROPERTYCORE_EXPORT KPropertySet : public QObject | ||
112 | { | 112 | { | ||
113 | Q_OBJECT | 113 | Q_OBJECT | ||
114 | 114 | | |||
115 | public: | 115 | public: | ||
116 | //! Constructs a new Set object. | 116 | //! Constructs a new Set object. | ||
117 | //! @see typeName() | 117 | //! @see typeName() | ||
118 | explicit KPropertySet(QObject *parent = 0, const QString &typeName = QString()); | 118 | explicit KPropertySet(QObject *parent = 0, const QString &typeName = QString()); | ||
119 | 119 | | |||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Line(s) | 302 | protected: | |||
305 | Private * const d; | 305 | Private * const d; | ||
306 | 306 | | |||
307 | friend class KPropertySetIterator; | 307 | friend class KPropertySetIterator; | ||
308 | friend class KProperty; | 308 | friend class KProperty; | ||
309 | friend class KPropertyBuffer; | 309 | friend class KPropertyBuffer; | ||
310 | }; | 310 | }; | ||
311 | 311 | | |||
312 | //! qDebug() stream operator. Writes this set to the debug output in a nicely formatted way. | 312 | //! qDebug() stream operator. Writes this set to the debug output in a nicely formatted way. | ||
313 | KPROPERTY_EXPORT QDebug operator<<(QDebug dbg, const KPropertySet &set); | 313 | KPROPERTYCORE_EXPORT QDebug operator<<(QDebug dbg, const KPropertySet &set); | ||
314 | 314 | | |||
315 | /*! A property buffer | 315 | /*! A property buffer | ||
316 | \author Cedric Pasteur <cedric.pasteur@free.fr> | 316 | \author Cedric Pasteur <cedric.pasteur@free.fr> | ||
317 | \author Alexander Dymo <cloudtemple@mskat.net> | 317 | \author Alexander Dymo <cloudtemple@mskat.net> | ||
318 | \author Adam Treat <treat@kde.org> | 318 | \author Adam Treat <treat@kde.org> | ||
319 | @todo Find a better name to show it's a set that doesn't own property | 319 | @todo Find a better name to show it's a set that doesn't own property | ||
320 | */ | 320 | */ | ||
321 | class KPROPERTY_EXPORT KPropertyBuffer : public KPropertySet | 321 | class KPROPERTYCORE_EXPORT KPropertyBuffer : public KPropertySet | ||
322 | { | 322 | { | ||
323 | Q_OBJECT | 323 | Q_OBJECT | ||
324 | 324 | | |||
325 | public: | 325 | public: | ||
326 | KPropertyBuffer(); | 326 | KPropertyBuffer(); | ||
327 | explicit KPropertyBuffer(const KPropertySet &set); | 327 | explicit KPropertyBuffer(const KPropertySet &set); | ||
328 | 328 | | |||
329 | /*! Intersects with other Set.*/ | 329 | /*! Intersects with other Set.*/ | ||
Show All 11 Lines |