Update ooo320-m1
[ooovba.git] / jvmfwk / source / framework.hxx
blob81eae0786b33861e391a22c90a0ef13b65a02238
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: framework.hxx,v $
10 * $Revision: 1.9 $
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 ************************************************************************/
30 #if !defined INCLUDED_JVMFWK_LOCAL_FRAMEWORK_HXX
31 #define INCLUDED_JVMFWK_LOCAL_FRAMEWORK_HXX
32 #include "rtl/ustring.hxx"
33 #include "rtl/byteseq.hxx"
34 #include "jvmfwk/framework.h"
35 #include "jvmfwk/vendorplugin.h"
37 /** typedefs for functions from vendorplugin.h
39 typedef javaPluginError (*jfw_plugin_getAllJavaInfos_ptr)(
40 rtl_uString * sVendor,
41 rtl_uString * sMinVersion,
42 rtl_uString * sMaxVersion,
43 rtl_uString * * arExcludeList,
44 sal_Int32 nLenList,
45 JavaInfo*** parJavaInfo,
46 sal_Int32 *nLenInfoList);
48 typedef javaPluginError (*jfw_plugin_getJavaInfoByPath_ptr)(
49 rtl_uString * sPath,
50 rtl_uString * sVendor,
51 rtl_uString * sMinVersion,
52 rtl_uString * sMaxVersion,
53 rtl_uString * * arExcludeList,
54 sal_Int32 nLenList,
55 JavaInfo** ppInfo);
57 /** starts a Java Virtual Machine.
58 <p>
59 The function shall ensure, that the VM does not abort the process
60 during instantiation.
61 </p>
63 typedef javaPluginError (*jfw_plugin_startJavaVirtualMachine_ptr)(
64 const JavaInfo *info,
65 const JavaVMOption* options,
66 sal_Int32 cOptions,
67 JavaVM ** ppVM,
68 JNIEnv ** ppEnv);
71 namespace jfw
74 class CJavaInfo
76 static JavaInfo * copyJavaInfo(const JavaInfo * pInfo);
78 enum _transfer_ownership {TRANSFER};
79 /*Attaching the pointer to this class. The argument pInfo must not
80 be freed afterwards.
82 CJavaInfo(::JavaInfo * info, _transfer_ownership);
84 public:
85 ::JavaInfo * pInfo;
89 CJavaInfo();
90 CJavaInfo(const CJavaInfo &);
91 ~CJavaInfo();
92 CJavaInfo& operator =(const ::JavaInfo* info);
93 CJavaInfo & operator = (const CJavaInfo& info);
95 /* The returned class takes ownership of the argument info. info
96 must not been freed afterwards.
98 static CJavaInfo createWrapper(::JavaInfo* info);
99 /*Attaching the pointer to this class. The argument pInfo must not
100 be freed afterwards.
102 void attach(::JavaInfo* pInfo);
103 ::JavaInfo * detach();
104 const ::JavaInfo* operator ->() const;
105 // ::JavaInfo** operator & ();
106 operator ::JavaInfo* ();
107 operator ::JavaInfo const * () const;
108 ::JavaInfo* cloneJavaInfo() const;
110 rtl::OUString getVendor() const;
111 rtl::OUString getLocation() const;
112 sal_uInt64 getFeatures() const;
115 class FrameworkException
117 public:
119 FrameworkException(javaFrameworkError err, const rtl::OString& msg):
120 errorCode(err), message(msg)
123 javaFrameworkError errorCode;
124 rtl::OString message;
127 #endif