chalk

kis_id.h
1/*
2 * This file is part of the KDE project
3 *
4 * Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
5 *
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.
10 *
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.
15 *
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.
19 */
20
21#ifndef _KIS_ID_H_
22#define _KIS_ID_H_
23
24#include <tqvaluelist.h>
25#include <tqstring.h>
26
57class KisID {
58
59
60public:
61
62 KisID() : m_id(TQString()), m_name(TQString()) {}
63
64 KisID(const TQString & id, const TQString & name = TQString())
65 : m_id(id),
66 m_name(name) {};
67
68 TQString id() const { return m_id; };
69 TQString name() const { return m_name; };
70
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 &);
75
76private:
77
78 TQString m_id;
79 TQString m_name;
80
81};
82
83inline bool operator==(const KisID &v1, const KisID &v2)
84{
85 return v1.m_id == v2.m_id;
86}
87
88inline bool operator!=(const KisID &v1, const KisID &v2)
89{
90 return v1.m_id != v2.m_id;
91}
92
93
94inline bool operator<(const KisID &v1, const KisID &v2)
95{
96 return v1.m_id < v2.m_id;
97}
98
99
100inline bool operator>(const KisID &v1, const KisID &v2)
101{
102 return v1.m_id < v2.m_id;
103}
104
105
106typedef TQValueList<KisID> KisIDList;
107
108#endif // _KIS_ID_H_
Chalk has a large number of extensible resources.
Definition kis_id.h:57