Warning, file /office/calligra/libs/main/KoFindMatch.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  *
0003  * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 
0022 
0023 #include "KoFindMatch.h"
0024 
0025 #include <QVariant>
0026 
0027 class Q_DECL_HIDDEN KoFindMatch::Private : public QSharedData
0028 {
0029 public:
0030     Private() { }
0031     ~Private() { }
0032     Private(const Private &other)
0033             : QSharedData(other),
0034             container(other.container),
0035             location(other.location)
0036     { }
0037 
0038     QVariant container;
0039     QVariant location;
0040 };
0041 
0042 KoFindMatch::KoFindMatch()
0043     : d(new Private)
0044 {
0045 }
0046 
0047 KoFindMatch::KoFindMatch(const QVariant &container, const QVariant &location)
0048     : d(new Private)
0049 {
0050     d->container = container;
0051     d->location = location;
0052 }
0053 
0054 KoFindMatch::KoFindMatch(const KoFindMatch &other)
0055     : d(other.d)
0056 {
0057 }
0058 
0059 KoFindMatch::~KoFindMatch()
0060 {
0061 }
0062 
0063 KoFindMatch &KoFindMatch::operator=(const KoFindMatch &other)
0064 {
0065     d = other.d;
0066     return *this;
0067 }
0068 
0069 bool KoFindMatch::operator==(const KoFindMatch &other) const
0070 {
0071     return d->container == other.d->container && d->location == other.d->location;
0072 }
0073 
0074 bool KoFindMatch::isValid() const
0075 {
0076     return d->container.isValid() && d->location.isValid();
0077 }
0078 
0079 QVariant KoFindMatch::container() const
0080 {
0081     return d->container;
0082 }
0083 
0084 void KoFindMatch::setContainer(const QVariant &container)
0085 {
0086     d->container = container;
0087 }
0088 
0089 QVariant KoFindMatch::location() const
0090 {
0091     return d->location;
0092 }
0093 
0094 void KoFindMatch::setLocation(const QVariant &location)
0095 {
0096     d->location = location;
0097 }
0098