Warning: That file was not part of the compilation database. It may have many parsing errors.

1/****************************************************************************
2**
3** Copyright (C) 2015 The Qt Company Ltd.
4** Copyright (C) 2015 Canonical Ltd
5** Contact: http://www.qt.io/licensing/
6**
7** This file is part of the QtContacts module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL21$
10** Commercial License Usage
11** Licensees holding valid commercial Qt licenses may use this file in
12** accordance with the commercial license agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and The Qt Company. For licensing terms
15** and conditions see http://www.qt.io/terms-conditions. For further
16** information use the contact form at http://www.qt.io/contact-us.
17**
18** GNU Lesser General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU Lesser
20** General Public License version 2.1 or version 3 as published by the Free
21** Software Foundation and appearing in the file LICENSE.LGPLv21 and
22** LICENSE.LGPLv3 included in the packaging of this file. Please review the
23** following information to ensure the GNU Lesser General Public License
24** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
25** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26**
27** As a special exception, The Qt Company gives you certain additional
28** rights. These rights are described in The Qt Company LGPL Exception
29** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30**
31** $QT_END_LICENSE$
32**
33****************************************************************************/
34
35#ifndef QCONTACTCOLLECTIONID_H
36#define QCONTACTCOLLECTIONID_H
37
38#include <QtCore/qvariant.h>
39
40#include <QtContacts/qcontactsglobal.h>
41
42QT_BEGIN_NAMESPACE_CONTACTS
43
44class QContactManagerEngine;
45
46class Q_CONTACTS_EXPORT QContactCollectionId
47{
48public:
49 inline QContactCollectionId() {}
50 inline QContactCollectionId(const QString &_managerUri, const QByteArray &_localId)
51 : m_managerUri(_localId.isEmpty() ? QString() : _managerUri),
52 m_localId(m_managerUri.isEmpty() ? QByteArray() : _localId)
53 {}
54 // compiler-generated dtor and copy/move ctors/assignment operators are fine!
55
56 inline bool operator==(const QContactCollectionId &other) const
57 { return localId() == other.localId() && managerUri() == other.managerUri(); }
58 inline bool operator!=(const QContactCollectionId &other) const
59 { return !operator==(other); }
60
61 inline bool isNull() const { return m_localId.isEmpty(); }
62
63 inline QString managerUri() const { return m_managerUri; }
64 inline QByteArray localId() const { return m_localId; }
65
66 QString toString() const;
67 static QContactCollectionId fromString(const QString &idString);
68
69 QByteArray toByteArray() const;
70 static QContactCollectionId fromByteArray(const QByteArray &idData);
71
72private:
73 QString m_managerUri;
74 QByteArray m_localId;
75};
76
77inline bool operator<(const QContactCollectionId &id1, const QContactCollectionId &id2)
78{ return id1.managerUri() != id2.managerUri() ? id1.managerUri() < id2.managerUri() : id1.localId() < id2.localId(); }
79
80inline uint qHash(const QContactCollectionId &id)
81{ return qHash(key: id.localId()); }
82
83#ifndef QT_NO_DATASTREAM
84Q_CONTACTS_EXPORT QDataStream &operator<<(QDataStream &out, const QContactCollectionId &id);
85Q_CONTACTS_EXPORT QDataStream &operator>>(QDataStream &in, QContactCollectionId &id);
86#endif
87
88#ifndef QT_NO_DEBUG_STREAM
89Q_CONTACTS_EXPORT QDebug operator<<(QDebug dbg, const QContactCollectionId &id);
90#endif
91
92QT_END_NAMESPACE_CONTACTS
93
94QT_BEGIN_NAMESPACE
95Q_DECLARE_TYPEINFO(QTCONTACTS_PREPEND_NAMESPACE(QContactCollectionId), Q_MOVABLE_TYPE);
96QT_END_NAMESPACE
97
98Q_DECLARE_METATYPE(QTCONTACTS_PREPEND_NAMESPACE(QContactCollectionId))
99#endif // QCONTACTCOLLECTIONID_H
100

Warning: That file was not part of the compilation database. It may have many parsing errors.

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtpim/src/contacts/qcontactcollectionid.h