Warning, file /office/calligra/libs/text/KoInlineObject.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  * Copyright (C) 2006-2009 Thomas Zander <zander@kde.org>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #include "KoInlineObject.h"
0021 #include "KoInlineObject_p.h"
0022 #include "KoInlineTextObjectManager.h"
0023 #include "KoTextInlineRdf.h"
0024 
0025 #include "TextDebug.h"
0026 
0027 QDebug KoInlineObjectPrivate::printDebug(QDebug dbg) const
0028 {
0029     dbg.nospace() << "KoInlineObject ManagerId: " << id;
0030     return dbg.space();
0031 }
0032 
0033 
0034 KoInlineObjectPrivate::~KoInlineObjectPrivate()
0035 {
0036     delete rdf;
0037 }
0038 
0039 KoInlineObject::KoInlineObject(bool propertyChangeListener)
0040         : d_ptr(new KoInlineObjectPrivate)
0041 {
0042     Q_D(KoInlineObject);
0043     d->propertyChangeListener = propertyChangeListener;
0044 }
0045 
0046 KoInlineObject::KoInlineObject(KoInlineObjectPrivate &priv, bool propertyChangeListener)
0047     : d_ptr(&priv)
0048 {
0049     Q_D(KoInlineObject);
0050     d->propertyChangeListener = propertyChangeListener;
0051 }
0052 
0053 KoInlineObject::~KoInlineObject()
0054 {
0055     if (d_ptr->manager) {
0056         d_ptr->manager->removeInlineObject(this);
0057     }
0058     delete d_ptr;
0059     d_ptr = 0;
0060 }
0061 
0062 void KoInlineObject::setManager(KoInlineTextObjectManager *manager)
0063 {
0064     Q_D(KoInlineObject);
0065     d->manager = manager;
0066 }
0067 
0068 KoInlineTextObjectManager *KoInlineObject::manager() const
0069 {
0070     Q_D(const KoInlineObject);
0071     return d->manager;
0072 }
0073 
0074 void KoInlineObject::propertyChanged(Property key, const QVariant &value)
0075 {
0076     Q_UNUSED(key);
0077     Q_UNUSED(value);
0078 }
0079 
0080 int KoInlineObject::id() const
0081 {
0082     Q_D(const KoInlineObject);
0083     return d->id;
0084 }
0085 
0086 void KoInlineObject::setId(int id)
0087 {
0088     Q_D(KoInlineObject);
0089     d->id = id;
0090 }
0091 
0092 bool KoInlineObject::propertyChangeListener() const
0093 {
0094     Q_D(const KoInlineObject);
0095     return d->propertyChangeListener;
0096 }
0097 
0098 QDebug operator<<(QDebug dbg, const KoInlineObject *o)
0099 {
0100     return o ? o->d_func()->printDebug(dbg) : dbg << "KoInlineObject 0";
0101 ;
0102 }
0103 
0104 void KoInlineObject::setInlineRdf(KoTextInlineRdf* rdf)
0105 {
0106     Q_D(KoInlineObject);
0107     d->rdf = rdf;
0108 }
0109 
0110 KoTextInlineRdf* KoInlineObject::inlineRdf() const
0111 {
0112     Q_D(const KoInlineObject);
0113     return d->rdf;
0114 }
0115