KIMAP2

rfccodecs.h
Go to the documentation of this file.
1/**********************************************************************
2 *
3 * rfccodecs - handler for various rfc/mime encodings
4 * Copyright (C) 2000 s.carstens@gmx.de
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 *********************************************************************/
22/**
23 * @file
24 * This file is part of the IMAP support library and defines the
25 * RfcCodecs class.
26 *
27 * @brief
28 * Provides handlers for various RFC/MIME encodings.
29 *
30 * @author Sven Carstens
31 */
32
33#ifndef KIMAP2_RFCCODECS_H
34#define KIMAP2_RFCCODECS_H
35
36#include <QtCore/QString>
37
38#include "kimap2_export.h"
39
40class QTextCodec;
41
42namespace KIMAP2
43{
44
45/**
46 Converts an Unicode IMAP mailbox to a QByteArray which can be used in
47 IMAP communication.
48 @param src is the QByteArray containing the IMAP mailbox.
49 @since 4.3
50*/
51KIMAP2_EXPORT QByteArray encodeImapFolderName(const QByteArray &src);
52
53/**
54 Converts an UTF-7 encoded IMAP mailbox to a QByteArray
55 @param inSrc is the QByteArray containing the Unicode path.
56 @since 4.3
57*/
58KIMAP2_EXPORT QByteArray decodeImapFolderName(const QByteArray &inSrc);
59/**
60 Converts an Unicode IMAP mailbox to a QString which can be used in
61 IMAP communication.
62 @param src is the QString containing the IMAP mailbox.
63*/
64KIMAP2_EXPORT QString encodeImapFolderName(const QString &src);
65
66/**
67 Converts an UTF-7 encoded IMAP mailbox to a Unicode QString.
68 @param inSrc is the QString containing the Unicode path.
69*/
70KIMAP2_EXPORT QString decodeImapFolderName(const QString &inSrc);
71
72/**
73 Replaces " with \" and \ with \\ " and \ characters.
74 @param src is the QString to quote.
75*/
76KIMAP2_EXPORT QString quoteIMAP(const QString &src);
77
78/**
79 Replaces " with \" and \ with \\ " and \ characters.
80 @param src is the QString to quote.
81 @since 4.3
82*/
83KIMAP2_EXPORT QByteArray quoteIMAP(const QByteArray &src);
84
85/**
86 Fetches a Codec by @p name.
87 @param name is the QString version of the Codec name.
88 @return Text Codec object
89*/
90KIMAP2_EXPORT QTextCodec *codecForName(const QString &name);
91
92/**
93 Decodes a RFC2047 string @p str.
94 @param str is the QString to decode.
95 @param charset is the character set to use when decoding.
96 @param language is the language found in the charset.
97*/
98KIMAP2_EXPORT const QString decodeRFC2047String(const QString &str,
99 QString &charset,
100 QString &language);
101/**
102 Decodes a RFC2047 string @p str.
103 @param str is the QString to decode.
104 @param charset is the character set to use when decoding.
105*/
106KIMAP2_EXPORT const QString decodeRFC2047String(const QString &str,
107 QString &charset);
108
109/**
110 Decodes a RFC2047 string @p str.
111 @param str is the QString to decode.
112*/
113KIMAP2_EXPORT const QString decodeRFC2047String(const QString &str);
114
115/**
116 Encodes a RFC2047 string @p str.
117 @param str is the QString to encode.
118*/
119KIMAP2_EXPORT const QString encodeRFC2047String(const QString &str);
120
121/**
122 Encodes a RFC2047 string @p str.
123 @param str is the QString to encode.
124*/
125KIMAP2_EXPORT const QByteArray encodeRFC2047String(const QByteArray &str);
126
127/**
128 Encodes a RFC2231 string @p str.
129 @param str is the QString to encode.
130*/
131KIMAP2_EXPORT const QString encodeRFC2231String(const QString &str);
132
133/**
134 Decodes a RFC2231 string @p str.
135 @param str is the QString to decode.
136*/
137KIMAP2_EXPORT const QString decodeRFC2231String(const QString &str);
138}
139
140#endif
KCODECS_EXPORT QByteArray encodeRFC2047String(QStringView src, const QByteArray &charset)
KCODECS_EXPORT QString decodeRFC2047String(QByteArrayView src, QByteArray *usedCS, const QByteArray &defaultCS=QByteArray(), CharsetOption option=NoOption)
KIMAP2_EXPORT const QString encodeRFC2231String(const QString &str)
Encodes a RFC2231 string str.
KIMAP2_EXPORT QByteArray encodeImapFolderName(const QByteArray &src)
Converts an Unicode IMAP mailbox to a QByteArray which can be used in IMAP communication.
KIMAP2_EXPORT QByteArray decodeImapFolderName(const QByteArray &inSrc)
Converts an UTF-7 encoded IMAP mailbox to a QByteArray.
Definition rfccodecs.cpp:70
KIMAP2_EXPORT const QString decodeRFC2231String(const QString &str)
Decodes a RFC2231 string str.
KIMAP2_EXPORT QString quoteIMAP(const QString &src)
Replaces " with \" and \ with \\ " and \ characters.
KIMAP2_EXPORT QTextCodec * codecForName(const QString &name)
Fetches a Codec by name.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.