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: urltransformer.hxx,v $
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 FORMS_SOURCE_INC_URLTRANSFORMER_HXX
32 #define FORMS_SOURCE_INC_URLTRANSFORMER_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/util/XURLTransformer.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/util/URL.hpp>
38 /** === end UNO includes === **/
40 //........................................................................
43 //........................................................................
45 //====================================================================
47 //====================================================================
51 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>
53 mutable ::com::sun::star::uno::Reference
< ::com::sun::star::util::XURLTransformer
>
55 mutable bool m_bTriedToCreateTransformer
;
58 UrlTransformer( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
60 /** returns an URL object for the given URL string
62 ::com::sun::star::util::URL
63 getStrictURL( const ::rtl::OUString
& _rURL
) const;
65 /** returns an URL object for the given URL ASCII string
67 ::com::sun::star::util::URL
68 getStrictURLFromAscii( const sal_Char
* _pAsciiURL
) const;
70 /** parses a given URL smartly, with a protocol given by ASCII string
73 parseSmartWithAsciiProtocol( ::com::sun::star::util::URL
& _rURL
, const sal_Char
* _pAsciiURL
) const;
76 /** ensures that we have an URLTransformer instance in <member>m_xTransformer</member>
79 <TRUE/> if and only if m_xTransformer is not <NULL/>
81 bool implEnsureTransformer() const;
84 //........................................................................
86 //........................................................................
88 #endif // FORMS_SOURCE_INC_URLTRANSFORMER_HXX