Update ooo320-m1
[ooovba.git] / jvmfwk / plugins / sunmajor / pluginlib / vendorlist.cxx
blob7e25beed268b773d31a7c2504e56d9e672c7eb47
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: 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"
35 #include "gnujre.hxx"
36 #include "sunjre.hxx"
37 #include "otherjre.hxx"
38 #include "osl/thread.h"
39 #include <stdio.h>
41 using namespace com::sun::star::uno;
42 using namespace rtl;
44 namespace jfw_plugin
47 /* Note: The vendor strings must be UTF-8. For example, if
48 the string contains an a umlaut then it must be expressed
49 by "\xXX\xXX"
51 BEGIN_VENDOR_MAP()
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)
60 END_VENDOR_MAP()
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]))
84 return true;
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());
90 #endif
91 return false;