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

kjsembed

  • 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
42KJSEMBED_EXPORT void RedirectIOToConsole();
43
44#endif
45
46#include <QtCore/QTextStream>
47namespace KJSEmbed {
48KJSEMBED_EXPORT QTextStream *conin();
49KJSEMBED_EXPORT QTextStream *conout();
50KJSEMBED_EXPORT QTextStream *conerr();
51}
52
53#include <kjs/ustring.h>
54#include <kjs/identifier.h>
55#include <kjs/value.h>
56
57namespace 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
72namespace 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
94KJSEMBED_EXPORT QTextStream &kdDebug( int area=0 );
95KJSEMBED_EXPORT QTextStream &kdWarning( int area=0 );
96
97#ifndef NO_I18N
98KJSEMBED_EXPORT QString i18n( const char *string );
99#else
100#define i18n(x) QString(x)
101#endif // NO_I18N
102
103inline KJSEMBED_EXPORT QString i18n( const QString& string, const QString& comment )
104{
105 return i18n(string.toUtf8().data(), comment.toUtf8().data());
106}
107template <typename A1>
108inline QString i18n (const char *text, const A1 &a1)
109{
110 return i18n(text).arg(a1);
111}
112template <typename A1, typename A2>
113inline QString i18n (const char *text, const A1 &a1, const A2 &a2)
114{
115 return i18n(text).arg(a1).arg(a2);
116}
117template <typename A1, typename A2, typename A3>
118inline 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}
122template <typename A1, typename A2, typename A3, typename A4>
123inline 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_EXPORT
#define KJSEMBED_EXPORT
Definition: kjseglobal.h:32
DomDocumentNS::comment
QDomComment comment
Definition: dom.cpp:406
DomDocumentNS::data
QString data
Definition: dom.cpp:436
KJSEmbed
Definition: application.h:33
KJSEmbed::toQString
QString toQString(const KJS::UString &u)
Definition: kjseglobal.h:58
KJSEmbed::conout
KJSEMBED_EXPORT QTextStream * conout()
Definition: kjseglobal.cpp:130
KJSEmbed::conin
KJSEMBED_EXPORT QTextStream * conin()
Definition: kjseglobal.cpp:118
KJSEmbed::conerr
KJSEMBED_EXPORT QTextStream * conerr()
Definition: kjseglobal.cpp:143
KJSEmbed::toUString
KJS::UString toUString(const QString &qs)
Definition: kjseglobal.h:66
KJS
Implement QString-KJS::UString conversion methods.
Definition: kjs_object_model.h:29
KJS::jsString
KJS::JSCell * jsString(const QString &s)
Definition: kjseglobal.h:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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