• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

kjsembed

kjseglobal.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2004,2005,2006 Ian Reinhart Geiser <geiseri@kde.org>
00003     Copyright (C) 2004,2005,2006 Matt Broadstone <mbroadst@gmail.com>
00004     Copyright (C) 2004,2005,2006 Richard J. Moore <rich@kde.org>
00005     Copyright (C) 2004,2005,2006 Erik L. Bunce <kde@bunce.us>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef KJSEGLOBAL_H
00024 #define KJSEGLOBAL_H
00025 
00026 #include <kdemacros.h>
00027 
00028 #if defined(Q_OS_WIN)
00029 # if (defined(KJSEMBED_DLL) && defined(KJSEMBED_MAKE_DLL)) || defined(MAKE_KJSEMBED_LIB)
00030 #  define KJSEMBED_EXPORT KDE_EXPORT
00031 # else
00032 #  define KJSEMBED_EXPORT KDE_IMPORT
00033 # endif
00034 #else
00035 # define KJSEMBED_EXPORT KDE_EXPORT
00036 #endif
00037 
00038 #if !defined(Q_OS_WIN)
00039 #include <stdlib.h>
00040 #include <ctype.h>
00041 
00042 KJSEMBED_EXPORT void RedirectIOToConsole();
00043 
00044 #ifdef HAVE_ITOA
00045 char *itoa(int num, char *str, int radix = 10);
00046 #endif
00047 #endif
00048 
00049 #include <QtCore/QTextStream>
00050 namespace KJSEmbed {
00051 KJSEMBED_EXPORT QTextStream *conin();
00052 KJSEMBED_EXPORT QTextStream *conout();
00053 KJSEMBED_EXPORT QTextStream *conerr();
00054 }
00055 
00056 #include <kjs/ustring.h>
00057 #include <kjs/identifier.h>
00058 #include <kjs/value.h>
00059 
00060 namespace KJSEmbed {
00061     inline QString toQString(const KJS::UString& u)
00062     {
00063         return QString((QChar*)u.data(), u.size());
00064     }
00065     inline QString toQString(const KJS::Identifier& i)
00066     {
00067         return QString((QChar*)i.data(), i.size());
00068     }
00069     inline KJS::UString toUString(const QString& qs)
00070     {
00071         return KJS::UString((KJS::UChar*)qs.data(), qs.size());
00072     }
00073 }
00074 
00075 namespace KJS {
00076     inline KJS::JSCell* jsString(const QString& s)
00077     {
00078         return jsString(KJSEmbed::toUString(s)); 
00079     }
00080 }
00081 
00082 #ifndef QT_ONLY
00083 
00084 /*
00085  * These are the normal definitions used when KDE is available.
00086  */
00087 
00088 #include <kdebug.h>
00089 #include <klocale.h>
00090 
00091 #else // QT_ONLY
00092 
00093 /*
00094  * These are the custom definitions used when we only have Qt.
00095  */
00096 
00097 KJSEMBED_EXPORT QTextStream &kdDebug( int area=0 );
00098 KJSEMBED_EXPORT QTextStream &kdWarning( int area=0 );
00099 
00100 #ifndef NO_I18N
00101 KJSEMBED_EXPORT QString i18n( const char *string );
00102 #else
00103 #define i18n(x) QString(x)
00104 #endif // NO_I18N
00105 
00106 inline KJSEMBED_EXPORT QString i18n( const QString& string, const QString& comment ) 
00107 { 
00108     return i18n(string.toUtf8().data(), comment.toUtf8().data());
00109 }
00110 template <typename A1>
00111 inline QString i18n (const char *text, const A1 &a1)
00112 {
00113     return i18n(text).arg(a1);
00114 }
00115 template <typename A1, typename A2>
00116 inline QString i18n (const char *text, const A1 &a1, const A2 &a2)
00117 {
00118     return i18n(text).arg(a1).arg(a2);
00119 }
00120 template <typename A1, typename A2, typename A3>
00121 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
00122 {
00123     return i18n(text).arg(a1).arg(a2).arg(a3);
00124 }
00125 template <typename A1, typename A2, typename A3, typename A4>
00126 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
00127 {
00128     return i18n(text).arg(a1).arg(a2).arg(a3).arg(a4);
00129 }
00130 
00131 #endif // QT_ONLY
00132 
00133 #endif // KJSEGLOBAL_H
00134 
00135 //kate: indent-spaces on; indent-width 4; replace-tabs on; indent-mode cstyle;

kjsembed

Skip menu "kjsembed"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal