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

kjsembed

  • sources
  • kde-4.12
  • kdelibs
  • kjsembed
  • kjsembed
kjseglobal.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2004,2005,2006 Ian Reinhart Geiser <geiseri@kde.org>
3  Copyright (C) 2004,2005,2006 Matt Broadstone <mbroadst@gmail.com>
4  Copyright (C) 2004,2005,2006 Richard J. Moore <rich@kde.org>
5  Copyright (C) 2004,2005,2006 Erik L. Bunce <kde@bunce.us>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef KJSEGLOBAL_H
24 #define KJSEGLOBAL_H
25 
26 #include <kdemacros.h>
27 
28 #if defined(Q_OS_WIN)
29 # if (defined(KJSEMBED_DLL) && defined(KJSEMBED_MAKE_DLL)) || defined(MAKE_KJSEMBED_LIB)
30 # define KJSEMBED_EXPORT KDE_EXPORT
31 # else
32 # define KJSEMBED_EXPORT KDE_IMPORT
33 # endif
34 #else
35 # define KJSEMBED_EXPORT KDE_EXPORT
36 #endif
37 
38 #if !defined(Q_OS_WIN)
39 #include <stdlib.h>
40 #include <ctype.h>
41 
42 KJSEMBED_EXPORT void RedirectIOToConsole();
43 
44 #endif
45 
46 #include <QtCore/QTextStream>
47 namespace KJSEmbed {
48 KJSEMBED_EXPORT QTextStream *conin();
49 KJSEMBED_EXPORT QTextStream *conout();
50 KJSEMBED_EXPORT QTextStream *conerr();
51 }
52 
53 #include <kjs/ustring.h>
54 #include <kjs/identifier.h>
55 #include <kjs/value.h>
56 
57 namespace KJSEmbed {
58  inline QString toQString(const KJS::UString& u)
59  {
60  return QString((QChar*)u.data(), u.size());
61  }
62  inline QString toQString(const KJS::Identifier& i)
63  {
64  return QString((QChar*)i.data(), i.size());
65  }
66  inline KJS::UString toUString(const QString& qs)
67  {
68  return KJS::UString((KJS::UChar*)qs.data(), qs.size());
69  }
70 }
71 
72 namespace KJS {
73  inline KJS::JSCell* jsString(const QString& s)
74  {
75  return jsString(KJSEmbed::toUString(s));
76  }
77 }
78 
79 #ifndef QT_ONLY
80 
81 /*
82  * These are the normal definitions used when KDE is available.
83  */
84 
85 #include <kdebug.h>
86 #include <klocale.h>
87 
88 #else // QT_ONLY
89 
90 /*
91  * These are the custom definitions used when we only have Qt.
92  */
93 
94 KJSEMBED_EXPORT QTextStream &kdDebug( int area=0 );
95 KJSEMBED_EXPORT QTextStream &kdWarning( int area=0 );
96 
97 #ifndef NO_I18N
98 KJSEMBED_EXPORT QString i18n( const char *string );
99 #else
100 #define i18n(x) QString(x)
101 #endif // NO_I18N
102 
103 inline KJSEMBED_EXPORT QString i18n( const QString& string, const QString& comment )
104 {
105  return i18n(string.toUtf8().data(), comment.toUtf8().data());
106 }
107 template <typename A1>
108 inline QString i18n (const char *text, const A1 &a1)
109 {
110  return i18n(text).arg(a1);
111 }
112 template <typename A1, typename A2>
113 inline QString i18n (const char *text, const A1 &a1, const A2 &a2)
114 {
115  return i18n(text).arg(a1).arg(a2);
116 }
117 template <typename A1, typename A2, typename A3>
118 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
119 {
120  return i18n(text).arg(a1).arg(a2).arg(a3);
121 }
122 template <typename A1, typename A2, typename A3, typename A4>
123 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
124 {
125  return i18n(text).arg(a1).arg(a2).arg(a3).arg(a4);
126 }
127 
128 #endif // QT_ONLY
129 
130 #endif // KJSEGLOBAL_H
131 
132 //kate: indent-spaces on; indent-width 4; replace-tabs on; indent-mode cstyle;
KJSEmbed::conin
KJSEMBED_EXPORT QTextStream * conin()
Definition: kjseglobal.cpp:118
DomDocumentNS::data
QString data
Definition: dom.cpp:436
KJSEmbed::conout
KJSEMBED_EXPORT QTextStream * conout()
Definition: kjseglobal.cpp:130
DomDocumentNS::comment
QDomComment comment
Definition: dom.cpp:406
DomDocumentNS::text
QDomText text
Definition: dom.cpp:443
KJS::jsString
KJS::JSCell * jsString(const QString &s)
Definition: kjseglobal.h:73
KJSEmbed::toUString
KJS::UString toUString(const QString &qs)
Definition: kjseglobal.h:66
KJSEMBED_EXPORT
#define KJSEMBED_EXPORT
Definition: kjseglobal.h:32
KJSEmbed::conerr
KJSEMBED_EXPORT QTextStream * conerr()
Definition: kjseglobal.cpp:143
KJSEmbed::toQString
QString toQString(const KJS::UString &u)
Definition: kjseglobal.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjsembed

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal