File indexing completed on 2024-05-26 05:19:01

0001 /*
0002     SPDX-FileCopyrightText: 2002-2004 Marc Mutz <mutz@kde.org>
0003     SPDX-FileCopyrightText: 2007 Tom Albers <tomalbers@kde.nl>
0004     SPDX-FileCopyrightText: 2009 Thomas McGuire <mcguire@kde.org>
0005     Author: Stefan Taferner <taferner@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include <KIdentityManagementCore/Signature>
0013 
0014 namespace KPIMTextEdit
0015 {
0016 class RichTextComposer;
0017 }
0018 
0019 namespace KIdentityManagementWidgets
0020 {
0021 
0022 /** Helper methods for rich text signature editing .*/
0023 namespace SignatureRichTextEditor
0024 {
0025 /** Inserts this signature into the given text edit.
0026  * If the signature is inserted at the beginning, a couple of new
0027  * lines will be inserted before it, and the cursor is moved to
0028  * the beginning. Otherwise, the cursor position is preserved.
0029  * For undo/redo, this is treated as one operation.
0030  *
0031  * Rich text mode of the text edit will be enabled if the signature is in
0032  * inlined HTML format.
0033  *
0034  * If this signature uses images, they will be added automatically.
0035  *
0036  * @param placement defines where in the text edit the signature should be
0037  *                  inserted.
0038  * @param addedText defines which other texts should be added to the signature
0039  * @param textEdit the signature will be inserted into this text edit.
0040  *
0041  * @since 4.9
0042  */
0043 void insertIntoTextEdit(const KIdentityManagementCore::Signature &sig,
0044                         KIdentityManagementCore::Signature::Placement placement,
0045                         KIdentityManagementCore::Signature::AddedText addedText,
0046                         KPIMTextEdit::RichTextComposer *textEdit,
0047                         bool forceDisplay = false);
0048 }
0049 
0050 }