1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: vendorlist.cxx,v $
10 * $Revision: 1.10.28.1 $
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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_jvmfwk.hxx"
34 #include "vendorlist.hxx"
37 #include "otherjre.hxx"
38 #include "osl/thread.h"
41 using namespace com::sun::star::uno
;
47 /* Note: The vendor strings must be UTF-8. For example, if
48 the string contains an a umlaut then it must be expressed
52 VENDOR_MAP_ENTRY("Sun Microsystems Inc.", SunInfo
)
53 VENDOR_MAP_ENTRY("IBM Corporation", OtherInfo
)
54 VENDOR_MAP_ENTRY("Blackdown Java-Linux Team", OtherInfo
)
55 VENDOR_MAP_ENTRY("Apple Inc.", OtherInfo
)
56 VENDOR_MAP_ENTRY("Apple Computer, Inc.", OtherInfo
)
57 VENDOR_MAP_ENTRY("BEA Systems, Inc.", OtherInfo
)
58 VENDOR_MAP_ENTRY("Free Software Foundation, Inc.", GnuInfo
)
59 VENDOR_MAP_ENTRY("The FreeBSD Foundation", OtherInfo
)
63 Sequence
<OUString
> getVendorNames()
65 const size_t count
= sizeof(gVendorMap
) / sizeof (VendorSupportMapEntry
) - 1;
66 OUString arNames
[count
];
67 for ( size_t pos
= 0; pos
< count
; ++pos
)
69 OString
sVendor(gVendorMap
[pos
].sVendorName
);
70 arNames
[pos
] = OStringToOUString(sVendor
, RTL_TEXTENCODING_UTF8
);
72 return Sequence
<OUString
>(arNames
, count
);
75 bool isVendorSupported(const rtl::OUString
& sVendor
)
77 Sequence
<OUString
> seqNames
= getVendorNames();
78 const OUString
* arNames
= seqNames
.getConstArray();
79 sal_Int32 count
= seqNames
.getLength();
81 for (int i
= 0; i
< count
; i
++)
83 if (sVendor
.equals(arNames
[i
]))
86 #if OSL_DEBUG_LEVEL >= 2
87 OString sVendorName
= OUStringToOString(sVendor
, osl_getThreadTextEncoding());
88 fprintf(stderr
, "[Java frameworksunjavaplugin.so]sunjavaplugin does not support vendor: %s.\n",
89 sVendorName
.getStr());