Solid
predicate.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SOLID_PREDICATE_H
00021 #define SOLID_PREDICATE_H
00022
00023 #include <QtCore/QVariant>
00024 #include <QtCore/QSet>
00025
00026 #include <solid/solid_export.h>
00027
00028 #include <solid/deviceinterface.h>
00029
00030 namespace Solid
00031 {
00032 class Device;
00033
00044 class SOLID_EXPORT Predicate
00045 {
00046 public:
00053 enum ComparisonOperator { Equals, Mask };
00054
00058 Predicate();
00059
00065 Predicate(const Predicate &other);
00066
00076 Predicate(const DeviceInterface::Type &ifaceType,
00077 const QString &property, const QVariant &value,
00078 ComparisonOperator compOperator = Equals);
00079
00089 Predicate(const QString &ifaceName,
00090 const QString &property, const QVariant &value,
00091 ComparisonOperator compOperator = Equals);
00092
00098 explicit Predicate(const DeviceInterface::Type &ifaceType);
00099
00105 explicit Predicate(const QString &ifaceName);
00106
00110 ~Predicate();
00111
00112
00119 Predicate &operator=(const Predicate &other);
00120
00121
00128 Predicate operator &(const Predicate &other);
00129
00136 Predicate &operator &=(const Predicate &other);
00137
00144 Predicate operator|(const Predicate &other);
00145
00152 Predicate &operator|=(const Predicate &other);
00153
00161 bool isValid() const;
00162
00169 bool matches(const Device &device) const;
00170
00176 QSet<DeviceInterface::Type> usedTypes() const;
00177
00183 QString toString() const;
00184
00192 static Predicate fromString(const QString &predicate);
00193
00194 private:
00195 class Private;
00196 Private * const d;
00197 };
00198 }
00199
00200 #endif