LibreOffice Module svl (master) 1
inethist.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#ifndef INCLUDED_SVL_INETHIST_HXX
20#define INCLUDED_SVL_INETHIST_HXX
21
23#include <svl/hint.hxx>
24#include <svl/svldllapi.h>
25#include <tools/urlobj.hxx>
26#include <memory>
27
30{
33 std::unique_ptr<INetURLHistory_Impl> m_pImpl;
34
37 SAL_DLLPRIVATE INetURLHistory();
38 SAL_DLLPRIVATE virtual ~INetURLHistory() override;
39
42 SAL_DLLPRIVATE static void NormalizeUrl_Impl (INetURLObject &rUrl);
43
44 void PutUrl_Impl (const INetURLObject &rUrl);
45 bool QueryUrl_Impl (INetURLObject rUrl) const;
46
49 INetURLHistory (const INetURLHistory&) = delete;
51
52public:
55 static INetURLHistory* GetOrCreate();
56
59 bool QueryProtocol (INetProtocol eProto) const
60 {
61 return ((eProto == INetProtocol::File ) ||
62 (eProto == INetProtocol::Ftp ) ||
63 (eProto == INetProtocol::Http ) ||
64 (eProto == INetProtocol::Https) );
65 }
66
69 bool QueryUrl (const INetURLObject &rUrl) const
70 {
71 if (QueryProtocol (rUrl.GetProtocol()))
72 return QueryUrl_Impl (rUrl);
73 else
74 return false;
75 }
76
77 bool QueryUrl (std::u16string_view rUrl) const;
78
81 void PutUrl (const INetURLObject &rUrl)
82 {
83 if (QueryProtocol (rUrl.GetProtocol()))
84 PutUrl_Impl (rUrl);
85 }
86};
87
88// broadcasted from PutUrl().
90{
92public:
93 explicit INetURLHistoryHint( const INetURLObject* Object ) : pObj(Object) {}
94 const INetURLObject* GetObject() const { return pObj; }
95};
96
97#endif // INCLUDED_SVL_INETHIST_HXX
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const INetURLObject * pObj
Definition: inethist.hxx:91
const INetURLObject * GetObject() const
Definition: inethist.hxx:94
INetURLHistoryHint(const INetURLObject *Object)
Definition: inethist.hxx:93
void PutUrl(const INetURLObject &rUrl)
PutUrl.
Definition: inethist.hxx:81
bool QueryProtocol(INetProtocol eProto) const
QueryProtocol.
Definition: inethist.hxx:59
INetURLHistory(const INetURLHistory &)=delete
Not implemented.
std::unique_ptr< INetURLHistory_Impl > m_pImpl
Representation.
Definition: inethist.hxx:33
bool QueryUrl(const INetURLObject &rUrl) const
QueryUrl.
Definition: inethist.hxx:69
INetProtocol GetProtocol() const
const SfxBroadcaster & operator=(const SfxBroadcaster &)=delete
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28
INetProtocol