nss: upgrade to release 3.73
[LibreOffice.git] / include / svl / inethist.hxx
blob21f7b6e2f940c256b26f655c41d7d659b8a5ea7b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVL_INETHIST_HXX
20 #define INCLUDED_SVL_INETHIST_HXX
22 #include <svl/SfxBroadcaster.hxx>
23 #include <svl/hint.hxx>
24 #include <svl/svldllapi.h>
25 #include <tools/urlobj.hxx>
26 #include <memory>
28 class INetURLHistory_Impl;
29 class SVL_DLLPUBLIC INetURLHistory final : public SfxBroadcaster
31 /** Representation.
33 std::unique_ptr<INetURLHistory_Impl> m_pImpl;
35 /** Construction/Destruction.
37 SAL_DLLPRIVATE INetURLHistory();
38 SAL_DLLPRIVATE virtual ~INetURLHistory() override;
40 /** Implementation.
42 SAL_DLLPRIVATE static void NormalizeUrl_Impl (INetURLObject &rUrl);
44 void PutUrl_Impl (const INetURLObject &rUrl);
45 bool QueryUrl_Impl (const INetURLObject &rUrl);
47 /** Not implemented.
49 INetURLHistory (const INetURLHistory&) = delete;
50 INetURLHistory& operator= (const INetURLHistory&) = delete;
52 public:
53 /** GetOrCreate.
55 static INetURLHistory* GetOrCreate();
57 /** QueryProtocol.
59 bool QueryProtocol (INetProtocol eProto) const
61 return ((eProto == INetProtocol::File ) ||
62 (eProto == INetProtocol::Ftp ) ||
63 (eProto == INetProtocol::Http ) ||
64 (eProto == INetProtocol::Https) );
67 /** QueryUrl.
69 bool QueryUrl (const INetURLObject &rUrl)
71 if (QueryProtocol (rUrl.GetProtocol()))
72 return QueryUrl_Impl (rUrl);
73 else
74 return false;
77 bool QueryUrl (const OUString &rUrl)
79 INetProtocol eProto =
80 INetURLObject::CompareProtocolScheme (rUrl);
81 if (QueryProtocol (eProto))
82 return QueryUrl_Impl (INetURLObject (rUrl));
83 else
84 return false;
87 /** PutUrl.
89 void PutUrl (const INetURLObject &rUrl)
91 if (QueryProtocol (rUrl.GetProtocol()))
92 PutUrl_Impl (rUrl);
96 // broadcasted from PutUrl().
97 class SVL_DLLPUBLIC INetURLHistoryHint final : public SfxHint
99 const INetURLObject* pObj;
100 public:
101 explicit INetURLHistoryHint( const INetURLObject* Object ) : pObj(Object) {}
102 const INetURLObject* GetObject() const { return pObj; }
105 #endif // INCLUDED_SVL_INETHIST_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */