qtmobileextensions/src/settingsmanager/xqcentralrepositorysearchcriteria.cpp
branchRCL_3
changeset 10 cd2778e5acfe
parent 9 5d007b20cfd0
child 11 19a54be74e5e
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     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 Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:
       
    19 *
       
    20 */
       
    21 
       
    22 #include "xqcentralrepositorysearchcriteria.h"
       
    23 
       
    24 /*!
       
    25     \class XQCentralRepositorySearchCriteria
       
    26 
       
    27     \brief The XQCentralRepositorySearchCriteria defines search criteria
       
    28     used in XQCentralRepositoryUtils::findKeys().
       
    29 */
       
    30 
       
    31 
       
    32 /*!
       
    33     Constructs an XQCentralRepositorySearchCriteria object.
       
    34     \param repositoryUid Central repository where the key is searched
       
    35     \param partialKey Partial Central repository key
       
    36     \param bitMask Bit mask for partialKey
       
    37 */
       
    38 XQCentralRepositorySearchCriteria::XQCentralRepositorySearchCriteria(long int repositoryUid,
       
    39     unsigned long int partialKey, unsigned long int bitMask)
       
    40     : m_repositoryUid(repositoryUid), m_partialKey(partialKey), m_bitMask(bitMask),
       
    41     m_negativeCriteria(false)
       
    42 {
       
    43 }
       
    44 
       
    45 /*!
       
    46     Destructs an XQCentralRepositorySearchCriteria object.
       
    47 */
       
    48 XQCentralRepositorySearchCriteria::~XQCentralRepositorySearchCriteria()
       
    49 {
       
    50 }
       
    51 
       
    52 /*!
       
    53     Sets the value criteria. If this function is not called or value is NULL object
       
    54     every key in the repository is returned in XQCentralRepositoryUtils::findKeys().
       
    55     \param value Value to be searched. The type is determined with
       
    56     QVariant.type() and it must be either QVariant::Int, QVariant::Double,
       
    57     QVariant::String or QVariant::ByteArray.
       
    58     \param negativeCriteria If true the keys of which values don't match will be returned in
       
    59     XQCentralRepositoryUtils::findKeys()
       
    60 */
       
    61 void XQCentralRepositorySearchCriteria::setValueCriteria(const QVariant& value, bool negativeCriteria)
       
    62 {
       
    63     m_value = value;
       
    64     m_negativeCriteria = negativeCriteria;
       
    65 }
       
    66 
       
    67 /*!
       
    68     \return Repository UID
       
    69 */
       
    70 long int XQCentralRepositorySearchCriteria::repositoryUid() const
       
    71 {
       
    72     return m_repositoryUid;
       
    73 }
       
    74 
       
    75 /*!
       
    76     \return Partial key
       
    77 */
       
    78 unsigned long int XQCentralRepositorySearchCriteria::partialKey() const
       
    79 {
       
    80     return m_partialKey;
       
    81 }
       
    82 
       
    83 /*!
       
    84     \return Bit mask for the partial key
       
    85 */
       
    86 unsigned long int XQCentralRepositorySearchCriteria::bitMask() const
       
    87 {
       
    88     return m_bitMask;
       
    89 }
       
    90 
       
    91 /*!
       
    92     \return Value criteria
       
    93 */
       
    94 const QVariant& XQCentralRepositorySearchCriteria::value() const
       
    95 {
       
    96     return m_value;
       
    97 }
       
    98 
       
    99 /*!
       
   100     \return True if value criteria is negative
       
   101 */
       
   102 bool XQCentralRepositorySearchCriteria::negativeCriteria() const
       
   103 {
       
   104     return m_negativeCriteria;
       
   105 }