LibreOffice Module svl (master) 1
urihelper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SVL_URIHELPER_HXX
21#define INCLUDED_SVL_URIHELPER_HXX
22
23#include <com/sun/star/uno/Reference.hxx>
24#include <rtl/textenc.h>
25#include <svl/svldllapi.h>
26#include <tools/link.hxx>
27#include <tools/urlobj.hxx>
28
29namespace com::sun::star {
30 namespace uno { class XComponentContext; }
31 namespace uri { class XUriReference; }
32}
33
34class CharClass;
35
36namespace URIHelper {
37
51SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
52 OUString const & rTheRelURIRef,
53 Link<OUString *, bool> const & rMaybeFileHdl = Link<OUString *, bool>(),
54 bool bCheckFileExists = true,
55 bool bIgnoreFragment = false,
58 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
59 FSysStyle eStyle = FSysStyle::Detect);
60
61SVL_DLLPUBLIC void SetMaybeFileHdl(Link<OUString *, bool> const & rTheMaybeFileHdl);
62
64
85SVL_DLLPUBLIC css::uno::Reference< css::uri::XUriReference >
87 css::uno::Reference< css::uno::XComponentContext > const & context,
88 OUString const & baseUriReference,
89 OUString const & uriReference);
90
113SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative( OUString const & baseUriReference,
114 OUString const & uriReference);
115
116SVL_DLLPUBLIC OUString FindFirstURLInText(OUString const & rText,
117 sal_Int32 & rBegin,
118 sal_Int32 & rEnd,
119 CharClass const & rCharClass,
121 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
122
123SVL_DLLPUBLIC OUString FindFirstDOIInText(OUString const & rText,
124 sal_Int32 & rBegin,
125 sal_Int32 & rEnd,
126 CharClass const & rCharClass);
127
153SVL_DLLPUBLIC OUString removePassword(OUString const & rURI,
154 INetURLObject::EncodeMechanism eEncodeMechanism,
156 rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
157
172SVL_DLLPUBLIC OUString resolveIdnaHost(OUString const & url);
173
174}
175
176#endif // INCLUDED_SVL_URIHELPER_HXX
177
178/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SVL_DLLPUBLIC OUString FindFirstURLInText(OUString const &rText, sal_Int32 &rBegin, sal_Int32 &rEnd, CharClass const &rCharClass, INetURLObject::EncodeMechanism eMechanism=INetURLObject::EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
Definition: urihelper.cxx:448
SVL_DLLPUBLIC OUString FindFirstDOIInText(OUString const &rText, sal_Int32 &rBegin, sal_Int32 &rEnd, CharClass const &rCharClass)
Definition: urihelper.cxx:748
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
Definition: urihelper.cxx:116
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
@ATT Calling this function with defaulted arguments rMaybeFileHdl = Link() and bCheckFileExists = tru...
Definition: urihelper.cxx:56
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
Remove any password component from both absolute and relative URLs.
Definition: urihelper.cxx:807
SVL_DLLPUBLIC css::uno::Reference< css::uri::XUriReference > normalizedMakeRelative(css::uno::Reference< css::uno::XComponentContext > const &context, OUString const &baseUriReference, OUString const &uriReference)
Converts a URI reference to a relative one, ignoring certain differences (for example,...
Definition: urihelper.cxx:253
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
A variant of normalizedMakeRelative with a simplified interface.
Definition: urihelper.cxx:268
SVL_DLLPUBLIC void SetMaybeFileHdl(Link< OUString *, bool > const &rTheMaybeFileHdl)
Definition: urihelper.cxx:111
SVL_DLLPUBLIC OUString resolveIdnaHost(OUString const &url)
Resolve a URL's host component domain name in IDNA syntax to plain DNS syntax.
Definition: urihelper.cxx:818
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28
FSysStyle