2
* This file is part of the KDE project
4
* Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
#include <qvaluelist.h>
28
* Krita has a large number of extensible resources. Think:
36
* - Composition operations
43
* Many of these resources are stored in KisGenericRegistry-based
44
* registries. If we store these resources with a descriptive string
45
* as a key use the same string in our UI, then our UI will not be
46
* localizable, because the identifications of particular resources
47
* will be stored in files, and those files need to be exchangeable.
49
* So, instead we use and ID class that couples an identification
50
* string that will be the same across all languages, an i18n-able
51
* string that will be used in comboboxes and that has a fast equality
52
* operator to make it well suited for use as key in a registry map.
54
* That last bit has not been solved yet.
62
KisID() : m_id(QString::null), m_name(QString::null) {}
64
KisID(const QString & id, const QString & name = QString::null)
68
QString id() const { return m_id; };
69
QString name() const { return m_name; };
71
friend inline bool operator==(const KisID &, const KisID &);
72
friend inline bool operator!=(const KisID &, const KisID &);
73
friend inline bool operator<(const KisID &, const KisID &);
74
friend inline bool operator>(const KisID &, const KisID &);
83
inline bool operator==(const KisID &v1, const KisID &v2)
85
return v1.m_id == v2.m_id;
88
inline bool operator!=(const KisID &v1, const KisID &v2)
90
return v1.m_id != v2.m_id;
94
inline bool operator<(const KisID &v1, const KisID &v2)
96
return v1.m_id < v2.m_id;
100
inline bool operator>(const KisID &v1, const KisID &v2)
102
return v1.m_id < v2.m_id;
106
typedef QValueList<KisID> KisIDList;