Messagelib

globalpart.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "globalpart.h"
8 
9 using namespace MessageComposer;
10 
11 class GlobalPart::GlobalPartPrivate
12 {
13 public:
14  GlobalPartPrivate() = default;
15 
17  QWidget *parentWidgetForGui = nullptr;
18  bool guiEnabled = true;
19  bool fallbackCharsetEnabled = false;
20  bool allow8Bit = false;
21  bool MDNRequested = false;
22  bool requestDeleveryConfirmation = false;
23 };
24 
25 GlobalPart::GlobalPart(QObject *parent)
26  : MessagePart(parent)
27  , d(new GlobalPartPrivate)
28 {
29 }
30 
31 GlobalPart::~GlobalPart() = default;
32 
33 bool GlobalPart::isGuiEnabled() const
34 {
35  return d->guiEnabled;
36 }
37 
38 void GlobalPart::setGuiEnabled(bool enabled)
39 {
40  d->guiEnabled = enabled;
41 }
42 
43 QWidget *GlobalPart::parentWidgetForGui() const
44 {
45  return d->parentWidgetForGui;
46 }
47 
48 void GlobalPart::setParentWidgetForGui(QWidget *widget)
49 {
50  d->parentWidgetForGui = widget;
51 }
52 
53 bool GlobalPart::isFallbackCharsetEnabled() const
54 {
55  return d->fallbackCharsetEnabled;
56 }
57 
58 void GlobalPart::setFallbackCharsetEnabled(bool enabled)
59 {
60  d->fallbackCharsetEnabled = enabled;
61 }
62 
63 QVector<QByteArray> GlobalPart::charsets(bool forceFallback) const
64 {
65  QVector<QByteArray> ret = d->charsets;
66  if (d->fallbackCharsetEnabled || forceFallback) {
67  ret << "us-ascii";
68  ret << "utf-8";
69  }
70  return ret;
71 }
72 
73 void GlobalPart::setCharsets(const QVector<QByteArray> &charsets)
74 {
75  d->charsets = charsets;
76 }
77 
78 bool GlobalPart::is8BitAllowed() const
79 {
80  return d->allow8Bit;
81 }
82 
83 void GlobalPart::set8BitAllowed(bool allowed)
84 {
85  d->allow8Bit = allowed;
86 }
87 
88 bool GlobalPart::MDNRequested() const
89 {
90  return d->MDNRequested;
91 }
92 
93 void GlobalPart::setMDNRequested(bool requestMDN)
94 {
95  d->MDNRequested = requestMDN;
96 }
97 
98 bool GlobalPart::requestDeleveryConfirmation() const
99 {
100  return d->requestDeleveryConfirmation;
101 }
102 
103 void GlobalPart::setRequestDeleveryConfirmation(bool value)
104 {
105  d->requestDeleveryConfirmation = value;
106 }
KCharsets * charsets()
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.