File indexing completed on 2024-05-12 05:17:16

0001 /**********************************************************************
0002  *
0003  *   rfccodecs  - handler for various rfc/mime encodings
0004  *   SPDX-FileCopyrightText: 2000 s .carstens@gmx.de
0005  *
0006  *   SPDX-License-Identifier: LGPL-2.0-or-later
0007  *
0008  *********************************************************************/
0009 /**
0010  * @file
0011  * This file is part of the IMAP support library and defines the
0012  * RfcCodecs class.
0013  *
0014  * @brief
0015  * Provides handlers for various RFC/MIME encodings.
0016  *
0017  * @author Sven Carstens
0018  */
0019 
0020 #pragma once
0021 
0022 #include <QString>
0023 
0024 #include "kimap_export.h"
0025 
0026 namespace KIMAP
0027 {
0028 /**
0029   Converts an Unicode IMAP mailbox to a QByteArray which can be used in
0030   IMAP communication.
0031   @param src is the QByteArray containing the IMAP mailbox.
0032   @since 4.3
0033 */
0034 [[nodiscard]] KIMAP_EXPORT QByteArray encodeImapFolderName(const QByteArray &src);
0035 
0036 /**
0037   Converts an UTF-7 encoded IMAP mailbox to a QByteArray
0038   @param inSrc is the QByteArray containing the Unicode path.
0039   @since 4.3
0040 */
0041 [[nodiscard]] KIMAP_EXPORT QByteArray decodeImapFolderName(const QByteArray &inSrc);
0042 /**
0043   Converts an Unicode IMAP mailbox to a QString which can be used in
0044   IMAP communication.
0045   @param src is the QString containing the IMAP mailbox.
0046 */
0047 [[nodiscard]] KIMAP_EXPORT QString encodeImapFolderName(const QString &src);
0048 
0049 /**
0050   Converts an UTF-7 encoded IMAP mailbox to a Unicode QString.
0051   @param inSrc is the QString containing the Unicode path.
0052 */
0053 [[nodiscard]] KIMAP_EXPORT QString decodeImapFolderName(const QString &inSrc);
0054 
0055 /**
0056   Replaces " with \" and \ with \\ " and \ characters.
0057   @param src is the QString to quote.
0058 */
0059 [[nodiscard]] KIMAP_EXPORT QString quoteIMAP(const QString &src);
0060 
0061 /**
0062   Replaces " with \" and \ with \\ " and \ characters.
0063   @param src is the QString to quote.
0064   @since 4.3
0065 */
0066 [[nodiscard]] KIMAP_EXPORT QByteArray quoteIMAP(const QByteArray &src);
0067 }