1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
16
#include "mattributeextensionid.h"
21
const int InvalidId = -1;
22
const int StandardId = -2;
25
MAttributeExtensionId::MAttributeExtensionId()
30
MAttributeExtensionId::MAttributeExtensionId(int id, const QString &service)
36
MAttributeExtensionId MAttributeExtensionId::standardAttributeExtensionId()
38
return MAttributeExtensionId(StandardId, QString());
41
bool MAttributeExtensionId::isValid() const
43
return m_id >= 0 && !m_service.isEmpty();
46
bool MAttributeExtensionId::operator==(const MAttributeExtensionId &other) const
48
return (m_id == other.m_id) && (m_service == other.m_service);
51
bool MAttributeExtensionId::operator!=(const MAttributeExtensionId &other) const
53
return !operator==(other);
56
QString MAttributeExtensionId::service() const
61
int MAttributeExtensionId::id() const
66
uint qHash(const MAttributeExtensionId &id)
68
return qHash(QPair<int, QString>(id.m_id, id.m_service));