TextPresents/libWsTextEdit/textpresents.h

82 lines
1.9 KiB
C++

#pragma once
#include "libwstextedit_global.h"
#include <QList>
#include <QFont>
namespace wstext_present {
/**
* ×Ö·û¸ñʽ¶¨Òå.
*/
class LIBWSTEXTEDIT_EXPORT CharFormat {
private:
qulonglong unique_id;
uint32_t point_size;
QString fontfamily_store;
bool bold_store;
bool italic_flag;
bool kerning_flag;
bool overline_flag;
bool underline_flag;
double float_Height;
QFont::Weight weight_store;
public:
CharFormat(qulonglong format_id);
CharFormat(const CharFormat& other);
qulonglong formatID() const;
uint32_t pointSize() const;
QString fontFamily() const;
bool bold() const;
bool italic() const;
bool kerning() const;
bool overline() const;
bool underline() const;
double floatHeight() const;
QFont::Weight weight() const;
void setPointSize(uint32_t val);
void setFontFamily(const QString &name);
void setBold(bool ste);
void setItalic(bool ste);
void setKerning(bool ste);
void setOverline(bool ste);
void setUnderline(bool ste);
void setFloatHeight(double val);
void setWeight(QFont::Weight val);
bool operator==(const CharFormat &other);
CharFormat &operator=(const CharFormat &other);
};
class LIBWSTEXTEDIT_EXPORT DocFormat {
private:
std::shared_ptr<CharFormat> char_format;
double line_height = 20;
double indent_char_count = 2;
QMargins margins_store = QMargins(5, 5, 5, 5);
bool visible_of_additional = false;
public:
DocFormat();
DocFormat(const DocFormat &other);
double lineHeight() const;
QMargins margins() const;
double indentChars() const;
bool additionalVisible() const;
std::shared_ptr<CharFormat> defaultCharFormat() const;
void setLineHeight(double val);
void setMargins(const QMargins &val);
void setIndentChars(double n);
void setAdditionalVisible(bool ste);
void setDefaultCharFormat(std::shared_ptr<CharFormat> format);
DocFormat& operator=(const DocFormat &other);
};
}