1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
28 class INetURLHistory_Impl
;
29 class SVL_DLLPUBLIC INetURLHistory final
: public SfxBroadcaster
33 std::unique_ptr
<INetURLHistory_Impl
> m_pImpl
;
35 /** Construction/Destruction.
37 SAL_DLLPRIVATE
INetURLHistory();
38 SAL_DLLPRIVATE
virtual ~INetURLHistory() override
;
42 SAL_DLLPRIVATE
static void NormalizeUrl_Impl (INetURLObject
&rUrl
);
44 void PutUrl_Impl (const INetURLObject
&rUrl
);
45 bool QueryUrl_Impl (INetURLObject rUrl
) const;
49 INetURLHistory (const INetURLHistory
&) = delete;
50 INetURLHistory
& operator= (const INetURLHistory
&) = delete;
55 static INetURLHistory
* GetOrCreate();
59 bool QueryProtocol (INetProtocol eProto
) const
61 return ((eProto
== INetProtocol::File
) ||
62 (eProto
== INetProtocol::Ftp
) ||
63 (eProto
== INetProtocol::Http
) ||
64 (eProto
== INetProtocol::Https
) );
69 bool QueryUrl (const INetURLObject
&rUrl
) const
71 if (QueryProtocol (rUrl
.GetProtocol()))
72 return QueryUrl_Impl (rUrl
);
77 bool QueryUrl (const OUString
&rUrl
) const;
81 void PutUrl (const INetURLObject
&rUrl
)
83 if (QueryProtocol (rUrl
.GetProtocol()))
88 // broadcasted from PutUrl().
89 class SVL_DLLPUBLIC INetURLHistoryHint final
: public SfxHint
91 const INetURLObject
* pObj
;
93 explicit INetURLHistoryHint( const INetURLObject
* Object
) : pObj(Object
) {}
94 const INetURLObject
* GetObject() const { return pObj
; }
97 #endif // INCLUDED_SVL_INETHIST_HXX
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */