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 Q_DECL_HIDDEN GlobalPart::Private
12 {
13 public:
14  Private()
15  {
16  }
17 
19  QWidget *parentWidgetForGui = nullptr;
20  bool guiEnabled = true;
21  bool fallbackCharsetEnabled = false;
22  bool allow8Bit = false;
23  bool MDNRequested = false;
24  bool requestDeleveryConfirmation = false;
25 };
26 
27 GlobalPart::GlobalPart(QObject *parent)
28  : MessagePart(parent)
29  , d(new Private)
30 {
31 }
32 
33 GlobalPart::~GlobalPart()
34 {
35  delete d;
36 }
37 
38 bool GlobalPart::isGuiEnabled() const
39 {
40  return d->guiEnabled;
41 }
42 
43 void GlobalPart::setGuiEnabled(bool enabled)
44 {
45  d->guiEnabled = enabled;
46 }
47 
48 QWidget *GlobalPart::parentWidgetForGui() const
49 {
50  return d->parentWidgetForGui;
51 }
52 
53 void GlobalPart::setParentWidgetForGui(QWidget *widget)
54 {
55  d->parentWidgetForGui = widget;
56 }
57 
58 bool GlobalPart::isFallbackCharsetEnabled() const
59 {
60  return d->fallbackCharsetEnabled;
61 }
62 
63 void GlobalPart::setFallbackCharsetEnabled(bool enabled)
64 {
65  d->fallbackCharsetEnabled = enabled;
66 }
67 
68 QVector<QByteArray> GlobalPart::charsets(bool forceFallback) const
69 {
70  QVector<QByteArray> ret = d->charsets;
71  if (d->fallbackCharsetEnabled || forceFallback) {
72  ret << "us-ascii";
73  ret << "utf-8";
74  }
75  return ret;
76 }
77 
78 void GlobalPart::setCharsets(const QVector<QByteArray> &charsets)
79 {
80  d->charsets = charsets;
81 }
82 
83 bool GlobalPart::is8BitAllowed() const
84 {
85  return d->allow8Bit;
86 }
87 
88 void GlobalPart::set8BitAllowed(bool allowed)
89 {
90  d->allow8Bit = allowed;
91 }
92 
93 bool GlobalPart::MDNRequested() const
94 {
95  return d->MDNRequested;
96 }
97 
98 void GlobalPart::setMDNRequested(bool requestMDN)
99 {
100  d->MDNRequested = requestMDN;
101 }
102 
103 bool GlobalPart::requestDeleveryConfirmation() const
104 {
105  return d->requestDeleveryConfirmation;
106 }
107 
108 void GlobalPart::setRequestDeleveryConfirmation(bool value)
109 {
110  d->requestDeleveryConfirmation = value;
111 }
The GlobalPart class.
Definition: globalpart.h:19
KCharsets * charsets()
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 30 2020 23:22:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.