The last part of typo fixes (I really hope)
[kdepim.git] / kmail / util.h
blob889626dfed1cb29de231f88f5430f35de6ed80db
1 /*******************************************************************************
2 **
3 ** Filename : util
4 ** Created on : 03 April, 2005
5 ** Copyright : (c) 2005 Till Adam
6 ** Email : <adam@kde.org>
7 **
8 *******************************************************************************/
10 /*******************************************************************************
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License as published by
14 ** the Free Software Foundation; either version 2 of the License, or
15 ** (at your option) any later version.
17 ** It is distributed in the hope that it will be useful, but
18 ** WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ** General Public License for more details.
22 ** You should have received a copy of the GNU General Public License
23 ** along with this program; if not, write to the Free Software
24 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 ** In addition, as a special exception, the copyright holders give
27 ** permission to link the code of this program with any edition of
28 ** the Qt library by Trolltech AS, Norway (or with modified versions
29 ** of Qt that use the same license as Qt), and distribute linked
30 ** combinations including the two. You must obey the GNU General
31 ** Public License in all respects for all of the code used other than
32 ** Qt. If you modify this file, you may extend this exception to
33 ** your version of the file, but you are not obligated to do so. If
34 ** you do not wish to do so, delete this exception statement from
35 ** your version.
37 *******************************************************************************/
38 #ifndef KMAILUTIL_H
39 #define KMAILUTIL_H
41 #include <stdlib.h>
42 #include <QWidget>
43 #include <kio/netaccess.h>
44 #include <kmessagebox.h>
45 #include <klocale.h>
46 #include <akonadi/item.h>
47 #include <kmime/kmime_message.h>
48 #include <Akonadi/AgentInstance>
49 #include <Akonadi/Collection>
50 class KUrl;
52 class OrgKdeAkonadiImapSettingsInterface;
54 namespace Akonadi {
55 class EntityMimeTypeFilterModel;
58 #define IMAP_RESOURCE_IDENTIFIER "akonadi_imap_resource"
59 #define POP3_RESOURCE_IDENTIFIER "akonadi_pop3_resource"
60 namespace KMail
62 /**
63 * The Util namespace contains a collection of helper functions use in
64 * various places.
66 namespace Util {
68 /** Test if all required settings are set.
69 Reports problems to user via dialogs and returns false.
70 Returns true if everything is Ok. */
71 bool checkTransport( QWidget *w );
73 /**
74 * Convert all sequences of "\r\n" (carriage return followed by a line
75 * feed) to a single "\n" (line feed). The conversion happens in place.
76 * Returns the length of the resulting string.
77 * @param str The string to convert.
78 * @param strLen The length of the string to convert.
79 * @return The new length of the converted string.
81 size_t crlf2lf( char* str, const size_t strLen );
83 /**
84 * Returns any mailing list post addresses set on the
85 * parent collection (the mail folder) of the item.
87 KMime::Types::Mailbox::List mailingListsFromMessage( const Akonadi::Item& item );
89 /**
90 * Whether or not the mail item has the keep-reply-in-folder
91 * attribute set.
93 Akonadi::Item::Id putRepliesInSameFolder( const Akonadi::Item& item );
95 void launchAccountWizard( QWidget * );
97 /**
98 * Handles a clicked URL, but only in case the viewer didn't handle it.
99 * Currently only support mailto.
101 void handleClickedURL( const KUrl &url, uint identity );
106 #endif