File indexing completed on 2024-05-05 11:56:20

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2012 Martin Kuettler <martin.kuettler@gmail.com>
0004 */
0005 
0006 #ifndef PLACEHOLDERENTRY_H
0007 #define PLACEHOLDERENTRY_H
0008 
0009 #include "worksheetentry.h"
0010 
0011 class PlaceHolderEntry : public WorksheetEntry
0012 {
0013   public:
0014     PlaceHolderEntry(Worksheet* worksheet, QSizeF s);
0015     ~PlaceHolderEntry() override = default;
0016 
0017     enum {Type = UserType + 6};
0018     int type() const override;
0019 
0020     bool isEmpty() override;
0021     bool acceptRichText() override;
0022     void setContent(const QString&) override;
0023     void setContent(const QDomElement&, const KZip&) override;
0024     void setContentFromJupyter(const QJsonObject & cell) override;
0025     QDomElement toXml(QDomDocument&, KZip*) override;
0026     QJsonValue toJupyterJson() override;
0027     QString toPlain(const QString&, const QString&, const QString&) override;
0028     void layOutForWidth(qreal entry_zone_x, qreal w, bool force = false) override;
0029 
0030   public Q_SLOTS:
0031     bool evaluate(WorksheetEntry::EvaluationOption evalOp = FocusNext) override;
0032     void updateEntry() override;
0033 
0034     void changeSize(QSizeF s);
0035 
0036   protected:
0037     bool wantToEvaluate() override;
0038 };
0039 
0040 #endif //PLACEHOLDERENTRY_H