merge the formfield patch from ooo-build
[ooovba.git] / desktop / source / deployment / inc / dp_identifier.hxx
blobf7af05c222838772f8ff80b3b201f7e80f3701f3
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: dp_identifier.hxx,v $
10 * $Revision: 1.3 $
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 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_IDENTIFIER_HXX
32 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_IDENTIFIER_HXX
34 #include "sal/config.h"
36 #include "boost/optional.hpp"
37 #include "com/sun/star/uno/Reference.hxx"
39 #include "dp_misc_api.hxx"
41 namespace com { namespace sun { namespace star { namespace deployment {
42 class XPackage;
43 } } } }
44 namespace rtl { class OUString; }
46 namespace dp_misc {
48 /**
49 Generates an identifier from an optional identifier.
51 @param optional
52 an optional identifier
54 @param fileName
55 a file name
57 @return
58 the given optional identifier if present, otherwise a legacy identifier based
59 on the given file name
61 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString generateIdentifier(
62 ::boost::optional< ::rtl::OUString > const & optional,
63 ::rtl::OUString const & fileName);
65 /**
66 Gets the identifier of a package.
68 @param package
69 a non-null package
71 @return
72 the explicit identifier of the given package if present, otherwise the
73 implicit legacy identifier of the given package
75 @throws com::sun::star::uno::RuntimeException
77 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString getIdentifier(
78 ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage >
79 const & package);
81 /**
82 Generates a legacy identifier based on a file name.
84 @param fileName
85 a file name
87 @return
88 a legacy identifier based on the given file name
90 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString generateLegacyIdentifier(
91 ::rtl::OUString const & fileName);
95 #endif