File indexing completed on 2024-12-15 04:51:47

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include "noteshared_export.h"
0009 #include <Akonadi/Attribute>
0010 
0011 #include <QColor>
0012 #include <QFont>
0013 #include <QPoint>
0014 #include <QSize>
0015 
0016 namespace NoteShared
0017 {
0018 class NOTESHARED_EXPORT NoteDisplayAttribute : public Akonadi::Attribute
0019 {
0020 public:
0021     NoteDisplayAttribute();
0022     ~NoteDisplayAttribute() override;
0023 
0024     [[nodiscard]] QByteArray type() const override;
0025 
0026     NoteDisplayAttribute *clone() const override;
0027 
0028     [[nodiscard]] QByteArray serialized() const override;
0029 
0030     void deserialize(const QByteArray &data) override;
0031 
0032     void setBackgroundColor(const QColor &color);
0033     [[nodiscard]] QColor backgroundColor() const;
0034     [[nodiscard]] QColor foregroundColor() const;
0035     void setForegroundColor(const QColor &color);
0036 
0037     [[nodiscard]] QSize size() const;
0038     void setSize(const QSize &size);
0039 
0040     [[nodiscard]] bool rememberDesktop() const;
0041     void setRememberDesktop(bool b);
0042     void setTabSize(int value);
0043     [[nodiscard]] int tabSize() const;
0044 
0045     void setFont(const QFont &f);
0046     [[nodiscard]] QFont font() const;
0047     void setTitleFont(const QFont &f);
0048     [[nodiscard]] QFont titleFont() const;
0049 
0050     void setDesktop(int v);
0051     [[nodiscard]] int desktop() const;
0052     void setIsHidden(bool b);
0053     [[nodiscard]] bool isHidden() const;
0054     void setPosition(const QPoint &pos);
0055     [[nodiscard]] QPoint position() const;
0056     void setShowInTaskbar(bool b);
0057     [[nodiscard]] bool showInTaskbar() const;
0058     void setKeepAbove(bool b);
0059     [[nodiscard]] bool keepAbove() const;
0060     void setKeepBelow(bool b);
0061     [[nodiscard]] bool keepBelow() const;
0062 
0063     [[nodiscard]] bool autoIndent() const;
0064     void setAutoIndent(bool b);
0065     [[nodiscard]] bool operator==(const NoteDisplayAttribute &other) const;
0066 
0067 private:
0068     QFont mFont;
0069     QFont mTitleFont;
0070     QColor mBackgroundColor;
0071     QColor mForegroundgroundColor;
0072     QSize mSize;
0073     QPoint mPosition;
0074     int mTabSize;
0075     int mDesktop;
0076     bool mRememberDesktop;
0077     bool mAutoIndent;
0078     bool mHide;
0079     bool mShowInTaskbar;
0080     bool mKeepAbove;
0081     // it's an error but we can't remove it!
0082     bool mKeepBelove;
0083     bool mKeepBelow;
0084 };
0085 }