qtmobility/src/contacts/filters/qcontactdetailrangefilter.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
--- a/qtmobility/src/contacts/filters/qcontactdetailrangefilter.cpp	Fri Jun 11 14:26:25 2010 +0300
+++ b/qtmobility/src/contacts/filters/qcontactdetailrangefilter.cpp	Wed Jun 23 19:08:38 2010 +0300
@@ -52,7 +52,8 @@
   a detail value range criterion.
   \ingroup contacts-filters
  
-  It may be used to select contacts which contain a detail of a particular definition with a particular value
+  It may be used to select contacts which contain a detail of a particular definition with a particular value that lies in
+  a range (either open or closed).
  */
 
 Q_IMPLEMENT_CONTACTFILTER_PRIVATE(QContactDetailRangeFilter);
@@ -65,10 +66,10 @@
 /*!
  * \enum QContactDetailRangeFilter::RangeFlag
  * Enumerates the semantics of the boundary conditions of the detail range filter
- * \value IncludeLower
- * \value IncludeUpper
- * \value ExcludeLower
- * \value ExcludeUpper
+ * \value IncludeLower The filter will match if the field value is equal to or greater than the minimum value
+ * \value IncludeUpper The filter will match if the field value is equal to or less than the maximum value
+ * \value ExcludeLower The filter will match if the field value is greater than the minimum value (but not equal)
+ * \value ExcludeUpper The filter will match if the field value is less than the maximum value (but not equal)
  */
 
 /*!
@@ -80,7 +81,12 @@
 }
 
 /*!
- * Sets the value range criterion of the filter to within \a min and \a max, with boundary conditions specified in the given \a flags
+ * Sets the value range criterion of the filter to within \a min and \a max, with boundary conditions specified in the given \a flags.
+ * If \a min or \a max is a null variant, that condition will not be checked.  For example, to check for
+ * fields with a value greater than 7, you would specify:
+ * \code
+ * filter.setRange(7, QVariant(), QContactDetailRangeFilter::ExcludeLower);
+ * \endcode
  * \sa minValue(), maxValue()
  */
 void QContactDetailRangeFilter::setRange(const QVariant& min, const QVariant& max, RangeFlags flags)
@@ -93,11 +99,23 @@
 
 /*!
  * Sets the match flags of the filter criterion to \a flags
+ *
+ * Not all flags are supported by a range filter.  The supported flags include:
+ *
+ * \list
+ * \o QContactFilter::MatchExactly
+ * \o QContactFilter::MatchFixedString
+ * \o QContactFilter::MatchCaseSensitive
+ * \endlist
+ *
+ * Unsupported flags will be ignored.
+ *
  * \sa matchFlags()
  */
 void QContactDetailRangeFilter::setMatchFlags(QContactFilter::MatchFlags flags)
 {
     Q_D(QContactDetailRangeFilter);
+    flags &= (QContactFilter::MatchExactly | QContactFilter::MatchFixedString | QContactFilter::MatchCaseSensitive);
     d->m_flags = flags;
 }
 
@@ -114,7 +132,7 @@
 }
 
 /*!
- * Returns the match flags of the criterion, which define semantics such as case sensitivity, prefix matching, exact matching, etc.
+ * Returns the match flags of the criterion, which define semantics such as case sensitivity, and exact matching.
  * \sa setMatchFlags()
  */
 QContactFilter::MatchFlags QContactDetailRangeFilter::matchFlags() const
@@ -144,7 +162,9 @@
 }
 
 /*!
- * Returns the lower bound of the value range criterion
+ * Returns the lower bound of the value range criterion.
+ * If this value is null, there is no lower bound.
+ * If it is valid, the \l rangeFlags() determines whether this value is included in the valid values.
  * \sa setRange()
  */
 QVariant QContactDetailRangeFilter::minValue() const
@@ -155,6 +175,8 @@
 
 /*!
  * Returns the upper bound of the value range criterion
+ * If this value is null, there is no upper bound.
+ * If it is valid, the \l rangeFlags() determines whether this value is included in the valid values.
  * \sa setRange()
  */
 QVariant QContactDetailRangeFilter::maxValue() const