KIdentityManagementWidgets::SignatureConfigurator Class

class KIdentityManagementWidgets::SignatureConfigurator
Header: #include <KIdentityManagementWidgets/SignatureConfigurator>
CMake: find_package(KPim6IdentityManagementWidgets REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::IdentityManagementWidgets)
Inherits: QWidget

Public Types

enum ViewMode { ShowCode, ShowHtml }

Public Functions

SignatureConfigurator(QWidget *parent = nullptr)
virtual ~SignatureConfigurator() override
QString commandPath() const
QString filePath() const
bool isSignatureEnabled() const
void setCommandURL(const QString &url)
void setFileURL(const QString &url)
void setImageLocation(const KIdentityManagementCore::Identity &identity)
void setImageLocation(const QString &path)
void setInlineText(const QString &text)
void setSignature(const KIdentityManagementCore::Signature &sig)
void setSignatureEnabled(bool enable)
void setSignatureType(KIdentityManagementCore::Signature::Type type)
KIdentityManagementCore::Signature signature() const
KIdentityManagementCore::Signature::Type signatureType() const

Detailed Description

This widget gives an interface so users can edit their signature. You can set a signature via setSignature(), let the user edit the signature and when done, read the signature back.

Member Type Documentation

enum SignatureConfigurator::ViewMode

Enum for the different viewmodes.

ConstantValueDescription
KIdentityManagementWidgets::SignatureConfigurator::ShowCode0Show the signature source code
KIdentityManagementWidgets::SignatureConfigurator::ShowHtml1Show the rendered HTML signature

Member Function Documentation

[explicit] SignatureConfigurator::SignatureConfigurator(QWidget *parent = nullptr)

Constructs a signature configurator with the given parent.

[override virtual noexcept] SignatureConfigurator::~SignatureConfigurator()

destructor

QString SignatureConfigurator::commandPath() const

Returns the url of the command which the users wants to use as signature.

QString SignatureConfigurator::filePath() const

Returns the file url which the user wants to use as a signature.

bool SignatureConfigurator::isSignatureEnabled() const

Returns true if the user wants a signature.

void SignatureConfigurator::setCommandURL(const QString &url)

Sets url as the command to execute.

void SignatureConfigurator::setFileURL(const QString &url)

Set url for the file url part of the widget.

void SignatureConfigurator::setImageLocation(const KIdentityManagementCore::Identity &identity)

Sets the image location to the image location of a given identity, which is emailidentities/<identity-id>/.

identity The identity whose unique ID will be used to determine the image location.

void SignatureConfigurator::setImageLocation(const QString &path)

Sets the directory where the images used in the HTML signature will be stored. Needs to be called before calling setSignature(), as each signature should use a different location. The directory needs to exist, it will not be created. path the image location to set @sa Signature::setImageLocation

void SignatureConfigurator::setInlineText(const QString &text)

Make text the text for the signature.

void SignatureConfigurator::setSignature(const KIdentityManagementCore::Signature &sig)

Convenience method. Sets the widgets according to sig sig the signature to configure *

See also signature().

void SignatureConfigurator::setSignatureEnabled(bool enable)

Use this to activate the signature: enable is true to enable it.

See also isSignatureEnabled().

void SignatureConfigurator::setSignatureType(KIdentityManagementCore::Signature::Type type)

Set the signature type to type.

See also signatureType().

KIdentityManagementCore::Signature SignatureConfigurator::signature() const

Convenience method. Returns a Signature object representing the state of the widgets. *

See also setSignature().

KIdentityManagementCore::Signature::Type SignatureConfigurator::signatureType() const

This returns the type of the signature, so that can be Disabled, Inline, fromFile, etc.

See also setSignatureType().