F:/KPlato/koffice/libs/kofficecore/KoID.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002  * Copyright (C) 2006 Thomas Zander <zander@kde.org>
00003  * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
00004  * Copyright (c) 2006 Boudewijn Rempt <boud@valdyas.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef _KO_ID_H_
00023 #define _KO_ID_H_
00024 
00025 #include <QString>
00026 #include <QMetaType>
00027 
00032 class KoID {
00033 public:
00034     KoID() : m_id(), m_name() {}
00035 
00036     KoID(const QString & id, const QString & name = QString())
00037         : m_id(id),
00038           m_name(name) {};
00039 
00040     QString id() const { return m_id; };
00041     QString name() const { return m_name; };
00042 
00043     friend inline bool operator==(const KoID &, const KoID &);
00044     friend inline bool operator!=(const KoID &, const KoID &);
00045     friend inline bool operator<(const KoID &, const KoID &);
00046     friend inline bool operator>(const KoID &, const KoID &);
00047 
00048 private:
00049 
00050     QString m_id;
00051     QString m_name;
00052 
00053 };
00054 
00055 Q_DECLARE_METATYPE( KoID )
00056 
00057 inline bool operator==(const KoID &v1, const KoID &v2)
00058 {
00059      return v1.m_id == v2.m_id;
00060 }
00061 
00062 inline bool operator!=(const KoID &v1, const KoID &v2)
00063 {
00064     return v1.m_id != v2.m_id;
00065 }
00066 
00067 
00068 inline bool operator<(const KoID &v1, const KoID &v2)
00069 {
00070     return v1.m_id < v2.m_id;
00071 }
00072 
00073 
00074 inline bool operator>(const KoID &v1, const KoID &v2)
00075 {
00076     return v1.m_id < v2.m_id;
00077 }
00078 
00079 
00080 #endif

Généré le Wed Nov 22 23:41:03 2006 pour KPlato par  doxygen 1.5.1-p1