kmail

util.h

00001 /*******************************************************************************
00002 **
00003 ** Filename   : util
00004 ** Created on : 03 April, 2005
00005 ** Copyright  : (c) 2005 Till Adam
00006 ** Email      : <adam@kde.org>
00007 **
00008 *******************************************************************************/
00009 
00010 /*******************************************************************************
00011 **
00012 **   This program is free software; you can redistribute it and/or modify
00013 **   it under the terms of the GNU General Public License as published by
00014 **   the Free Software Foundation; either version 2 of the License, or
00015 **   (at your option) any later version.
00016 **
00017 **   It is distributed in the hope that it will be useful, but
00018 **   WITHOUT ANY WARRANTY; without even the implied warranty of
00019 **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 **   General Public License for more details.
00021 **
00022 **   You should have received a copy of the GNU General Public License
00023 **   along with this program; if not, write to the Free Software
00024 **   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00025 **
00026 **   In addition, as a special exception, the copyright holders give
00027 **   permission to link the code of this program with any edition of
00028 **   the Qt library by Trolltech AS, Norway (or with modified versions
00029 **   of Qt that use the same license as Qt), and distribute linked
00030 **   combinations including the two.  You must obey the GNU General
00031 **   Public License in all respects for all of the code used other than
00032 **   Qt.  If you modify this file, you may extend this exception to
00033 **   your version of the file, but you are not obligated to do so.  If
00034 **   you do not wish to do so, delete this exception statement from
00035 **   your version.
00036 **
00037 *******************************************************************************/
00038 #ifndef KMAILUTIL_H
00039 #define KMAILUTIL_H
00040 
00041 #include <stdlib.h>
00042 #include <qobject.h>
00043 #include <qcstring.h>
00044 
00045 namespace KMail
00046 {
00051 namespace Util {
00060     size_t crlf2lf( char* str, const size_t strLen );
00061 
00062     
00068     QCString lf2crlf( const QCString & src );
00069 
00077     class LaterDeleter
00078     {
00079       public:
00080       LaterDeleter( QObject *o)
00081         :m_object( o ), m_disabled( false )
00082       {
00083       }
00084       virtual ~LaterDeleter()
00085       {
00086         if ( !m_disabled ) {
00087           m_object->deleteLater();
00088         }
00089       }
00090       void setDisabled( bool v )
00091       {
00092         m_disabled = v;
00093       }
00094       protected:
00095       QObject *m_object;
00096       bool m_disabled;
00097     };
00098 }
00099 }
00100 
00101 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys