update dev300-m58
[ooovba.git] / sj2 / source / jscpp / sjapplet.cxx
blob0f8173bd569ad47329f9d0df83f9120ea0e05f3d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sjapplet.cxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "sal/config.h"
33 #include "sjapplet.hxx"
35 #include "osl/diagnose.h"
36 #include "rtl/string.hxx"
37 #include "rtl/ustring.hxx"
39 #include "sjapplet_impl.hxx"
41 using namespace ::rtl;
42 using namespace ::com::sun::star::uno;
44 SjApplet2::SjApplet2()
45 : _pImpl(new SjApplet2_Impl())
49 SjApplet2::~SjApplet2()
51 delete _pImpl;
54 //=========================================================================
55 void SjApplet2::Init(
56 com::sun::star::uno::Reference<
57 com::sun::star::uno::XComponentContext > const & context,
58 Window * pParentWin, const INetURLObject & rDocBase,
59 const SvCommandList & rCmdList)
61 try {
62 if(_pImpl)
63 _pImpl->init(pParentWin, context, rDocBase, rCmdList);
65 catch(RuntimeException & runtimeException) {
66 #if OSL_DEBUG_LEVEL > 1
67 OString message = OUStringToOString(runtimeException.Message, RTL_TEXTENCODING_ASCII_US);
68 OSL_TRACE("sjapplet.cxx: SjApplet2::Init - exception occurred: %s\n", message.getStr());
69 #else
70 (void) runtimeException; // avoid warning
71 #endif
73 delete _pImpl;
74 _pImpl = 0;
78 //=========================================================================
79 void SjApplet2::setSizePixel( const Size & rSize )
81 if(_pImpl)
82 _pImpl->setSize(rSize);
85 void SjApplet2::appletRestart()
87 if(_pImpl)
88 _pImpl->restart();
91 void SjApplet2::appletReload()
93 if(_pImpl)
94 _pImpl->reload();
97 void SjApplet2::appletStart()
99 if(_pImpl)
100 _pImpl->start();
103 void SjApplet2::appletStop()
105 if(_pImpl)
106 _pImpl->stop();
109 void SjApplet2::appletClose()
111 if(_pImpl)
112 _pImpl->close();
115 // Fuer SO3, Wrapper fuer Applet liefern
116 SjJScriptAppletObject * SjApplet2::GetJScriptApplet()
118 OSL_TRACE("SjApplet2::GetJScriptApplet\n");
120 return NULL;
123 // Settings are detected by the JavaVM service
124 // This function is not necessary anymore
125 void SjApplet2::settingsChanged(void)