Update ooo320-m1
[ooovba.git] / forms / source / inc / urltransformer.hxx
blobb52be9dd7b5dde4b388c7eb4714aeb07ef16092f
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: urltransformer.hxx,v $
10 * $Revision: 1.4 $
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 //........................................................................
41 namespace frm
43 //........................................................................
45 //====================================================================
46 //= UrlTransformer
47 //====================================================================
48 class UrlTransformer
50 private:
51 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
52 m_xORB;
53 mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer >
54 m_xTransformer;
55 mutable bool m_bTriedToCreateTransformer;
57 public:
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
72 void
73 parseSmartWithAsciiProtocol( ::com::sun::star::util::URL& _rURL, const sal_Char* _pAsciiURL ) const;
75 private:
76 /** ensures that we have an URLTransformer instance in <member>m_xTransformer</member>
78 @return
79 <TRUE/> if and only if m_xTransformer is not <NULL/>
81 bool implEnsureTransformer() const;
84 //........................................................................
85 } // namespace frm
86 //........................................................................
88 #endif // FORMS_SOURCE_INC_URLTRANSFORMER_HXX