1 /*
2    SPDX-FileCopyrightText: 2013-2021 Laurent Montel <montel@kde.org>
3 
4    SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #pragma once
7 
8 #include "noteshared_export.h"
9 #include <Akonadi/Attribute>
10 
11 #include <QColor>
12 #include <QFont>
13 #include <QPoint>
14 #include <QSize>
15 
16 namespace NoteShared
17 {
18 class NOTESHARED_EXPORT NoteDisplayAttribute : public Akonadi::Attribute
19 {
20 public:
21     NoteDisplayAttribute();
22     ~NoteDisplayAttribute() override;
23 
24     Q_REQUIRED_RESULT QByteArray type() const override;
25 
26     NoteDisplayAttribute *clone() const override;
27 
28     Q_REQUIRED_RESULT QByteArray serialized() const override;
29 
30     void deserialize(const QByteArray &data) override;
31 
32     void setBackgroundColor(const QColor &color);
33     Q_REQUIRED_RESULT QColor backgroundColor() const;
34     Q_REQUIRED_RESULT QColor foregroundColor() const;
35     void setForegroundColor(const QColor &color);
36 
37     Q_REQUIRED_RESULT QSize size() const;
38     void setSize(const QSize &size);
39 
40     Q_REQUIRED_RESULT bool rememberDesktop() const;
41     void setRememberDesktop(bool b);
42     void setTabSize(int value);
43     Q_REQUIRED_RESULT int tabSize() const;
44 
45     void setFont(const QFont &f);
46     Q_REQUIRED_RESULT QFont font() const;
47     void setTitleFont(const QFont &f);
48     Q_REQUIRED_RESULT QFont titleFont() const;
49 
50     void setDesktop(int v);
51     Q_REQUIRED_RESULT int desktop() const;
52     void setIsHidden(bool b);
53     Q_REQUIRED_RESULT bool isHidden() const;
54     void setPosition(const QPoint &pos);
55     Q_REQUIRED_RESULT QPoint position() const;
56     void setShowInTaskbar(bool b);
57     Q_REQUIRED_RESULT bool showInTaskbar() const;
58     void setKeepAbove(bool b);
59     Q_REQUIRED_RESULT bool keepAbove() const;
60     void setKeepBelow(bool b);
61     Q_REQUIRED_RESULT bool keepBelow() const;
62 
63     Q_REQUIRED_RESULT bool autoIndent() const;
64     void setAutoIndent(bool b);
65     Q_REQUIRED_RESULT bool operator==(const NoteDisplayAttribute &other) const;
66 
67 private:
68     QFont mFont;
69     QFont mTitleFont;
70     QColor mBackgroundColor;
71     QColor mForegroundgroundColor;
72     QSize mSize;
73     QPoint mPosition;
74     int mTabSize;
75     int mDesktop;
76     bool mRememberDesktop;
77     bool mAutoIndent;
78     bool mHide;
79     bool mShowInTaskbar;
80     bool mKeepAbove;
81     // it's an error but we can't remove it!
82     bool mKeepBelove;
83     bool mKeepBelow;
84 };
85 }
86