KPimTextEdit
richtextcomposerimages.cpp
57 KMessageBox::error(d->composer, xi18nc("@info", "Unable to load image <filename>%1</filename>.", url.path()));
61 const QString imageName = fi.baseName().isEmpty() ? QStringLiteral("image.png") : QString(fi.baseName() + ".png"_L1);
68void RichTextComposerImages::loadImage(const QImage &image, const QString &matchName, const QString &resourceName)
85 d->composer->document()->addResource(QTextDocument::ImageResource, QUrl(resourceName), QVariant(image));
107void RichTextComposerImages::addImageHelper(const QString &imageName, const QImage &image, int width, int height)
124 imageNameToAdd = imageName.left(firstDot) + QString::number(imageNumber++) + imageName.mid(firstDot);
152 QVariant resourceData = d->composer->document()->resource(QTextDocument::ImageResource, QUrl(name));
176QSharedPointer<EmbeddedImage> RichTextComposerImages::createEmbeddedImage(const QImage &img, const QString &imageName) const
185 embeddedImage->contentID = QStringLiteral("%1@KDE").arg(QRandomGenerator::global()->generate64());
216 const QString imageName = fileInfo.baseName().isEmpty() ? i18nc("Start of the filename for an image", "image") : fileInfo.baseName();
220QByteArray RichTextComposerImages::imageNamesToContentIds(const QByteArray &htmlBody, const KPIMTextEdit::ImageList &imageList)
226 result.replace(QByteArray(quote + image->imageName.toLocal8Bit() + quote), QByteArray(quote + newImageName.toLocal8Bit() + quote));
static Codec * codecForName(QByteArrayView name)
virtual bool encode(const char *&scursor, const char *const send, char *&dcursor, const char *const dend, NewlineType newline=NewlineLF) const
QString xi18nc(const char *context, const char *text, const TYPE &arg...)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QString name(StandardAction id)
QByteArray & buffer()
virtual bool open(OpenMode flags) override
QByteArray & replace(QByteArrayView before, QByteArrayView after)
QString baseName() const const
int height() const const
bool load(QIODevice *device, const char *format)
bool save(QIODevice *device, const char *format, int quality) const const
int width() const const
WriteOnly
void append(QList< T > &&value)
qsizetype count() const const
void reserve(qsizetype size)
QRandomGenerator * global()
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
QString arg(Args &&... args) const const
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
QString number(double n, char format, int precision)
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QByteArray toLocal8Bit() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
iterator begin() const const
bool isValid() const const
QTextBlock next() const const
KeepAnchor
ImageResource
void addResource(int type, const QUrl &name, const QVariant &resource)
QTextBlock begin() const const
QVariant resource(int type, const QUrl &name) const const
QTextImageFormat toImageFormat() const const
QTextCharFormat charFormat() const const
bool isValid() const const
int position() const const
qreal height() const const
bool isValid() const const
QString name() const const
void setHeight(qreal height)
void setName(const QString &name)
void setWidth(qreal width)
qreal width() const const
bool isValid() const const
QString path(ComponentFormattingOptions options) const const
QString scheme() const const
Holds information about an embedded HTML image that will be useful for mail clients.
Definition richtextcomposerimages.h:22
Holds information about an embedded HTML image that will be generally useful.
Definition richtextcomposerimages.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:55:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:55:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.