• 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
application.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2005, 2006 Ian Reinhart Geiser <geiseri@kde.org>
3  Copyright (C) 2005, 2006 Matt Broadstone <mbroadst@gmail.com>
4  Copyright (C) 2005, 2006 Richard J. Moore <rich@kde.org>
5  Copyright (C) 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 #include "application.h"
23 
24 #include <QtCore/QDebug>
25 #include <QtGui/QApplication>
26 #include <QtCore/QStringList>
27 using namespace KJSEmbed;
28 
29 namespace CoreApplicationNS
30 {
31 START_STATIC_OBJECT_METHOD( callExit )
32  int exitCode = KJSEmbed::extractInt( exec, args, 0 );
33  QCoreApplication::exit(exitCode);
34 END_STATIC_OBJECT_METHOD
35 }
36 
37 START_STATIC_METHOD_LUT( CoreApplicationBinding )
38  {"exit", 0, KJS::DontDelete|KJS::ReadOnly, &CoreApplicationNS::callExit}
39 END_METHOD_LUT
40 
41 NO_ENUMS( CoreApplicationBinding )
42 NO_METHODS( CoreApplicationBinding )
43 
44 KJSO_START_BINDING_CTOR( CoreApplicationBinding, QCoreApplication, QObjectBinding )
45  setOwnership(CPPOwned);
46 KJSO_END_BINDING_CTOR
47 KJSO_QOBJECT_BIND( CoreApplicationBinding, QCoreApplication )
48 
49 KJSO_START_CTOR( CoreApplicationBinding, QCoreApplication, 0)
50  return new KJSEmbed::CoreApplicationBinding( exec, QCoreApplication::instance () );
51 KJSO_END_CTOR
52 
53 namespace ApplicationNS
54 {
55 START_STATIC_OBJECT_METHOD( callBeep )
56  QApplication::beep();
57 END_STATIC_OBJECT_METHOD
58 }
59 
60 START_STATIC_METHOD_LUT( ApplicationBinding )
61  {"beep", 0, KJS::DontDelete|KJS::ReadOnly, &ApplicationNS::callBeep}
62 END_METHOD_LUT
63 
64 NO_ENUMS( ApplicationBinding )
65 NO_METHODS( ApplicationBinding )
66 
67 KJSO_START_BINDING_CTOR( ApplicationBinding, QApplication, CoreApplicationBinding )
68  setOwnership(CPPOwned);
69 KJSO_END_BINDING_CTOR
70 KJSO_QOBJECT_BIND( ApplicationBinding, QApplication )
71 
72 KJSO_START_CTOR( ApplicationBinding, QApplication, 0)
73  return new KJSEmbed::ApplicationBinding( exec, ::qobject_cast<QApplication*>(QCoreApplication::instance() ) );
74 KJSO_END_CTOR
75 
76 //kate: indent-spaces on; indent-width 4; replace-tabs on; indent-mode cstyle;
KJSEmbed::QObjectBinding
Definition: qobject_binding.h:79
setOwnership
END_METHOD_LUT setOwnership(CPPOwned)
KJSO_QOBJECT_BIND
#define KJSO_QOBJECT_BIND(NAME, TYPE)
Definition: binding_support.h:205
application.h
KJSO_START_CTOR
KJSO_START_CTOR(UiLoaderBinding, QUiLoader, 1)
Definition: quiloader_binding.cpp:40
START_STATIC_METHOD_LUT
START_STATIC_METHOD_LUT(CoreApplicationBinding)
Definition: application.cpp:37
KJSEmbed::extractInt
int KJSEMBED_EXPORT extractInt(KJS::ExecState *exec, const KJS::List &args, int idx, int defaultValue=0)
Extracts an integer from an argument list.
Definition: binding_support.cpp:72
NO_ENUMS
#define NO_ENUMS(TYPE)
Definition: binding_support.h:147
KJSO_START_BINDING_CTOR
#define KJSO_START_BINDING_CTOR(NAME, TYPE, BASENAME)
Definition: binding_support.h:104
END_METHOD_LUT
#define END_METHOD_LUT
Definition: binding_support.h:135
NO_METHODS
#define NO_METHODS(TYPE)
Definition: binding_support.h:150
END_STATIC_OBJECT_METHOD
#define END_STATIC_OBJECT_METHOD
Definition: object_binding.h:75
KJSO_END_BINDING_CTOR
#define KJSO_END_BINDING_CTOR
Definition: binding_support.h:110
CoreApplicationNS::exitCode
int exitCode
Definition: application.cpp:32
KJSO_END_CTOR
#define KJSO_END_CTOR
Definition: binding_support.h:178
START_STATIC_OBJECT_METHOD
#define START_STATIC_OBJECT_METHOD(METHODNAME)
Definition: object_binding.h:67
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