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 .
22 #include "svl/svldllapi.h"
23 #include <tools/solar.h>
24 #include <tools/string.hxx>
25 #include <tools/urlobj.hxx>
26 #include <svl/brdcst.hxx>
27 #include <svl/hint.hxx>
29 /*========================================================================
31 * INetURLHistory interface.
33 *=======================================================================*/
34 class INetURLHistory_Impl
;
35 class INetURLHistory
: public SfxBroadcaster
39 INetURLHistory
* operator()();
41 friend INetURLHistory
* StaticInstance::operator()();
45 INetURLHistory_Impl
*m_pImpl
;
47 /** Construction/Destruction.
49 INetURLHistory (void);
50 virtual ~INetURLHistory (void);
54 static void NormalizeUrl_Impl (INetURLObject
&rUrl
);
56 SVL_DLLPUBLIC
void PutUrl_Impl (const INetURLObject
&rUrl
);
57 SVL_DLLPUBLIC sal_Bool
QueryUrl_Impl (const INetURLObject
&rUrl
);
61 INetURLHistory (const INetURLHistory
&);
62 INetURLHistory
& operator= (const INetURLHistory
&);
67 SVL_DLLPUBLIC
static INetURLHistory
* GetOrCreate (void);
71 sal_Bool
QueryProtocol (INetProtocol eProto
) const
73 return ((eProto
== INET_PROT_FILE
) ||
74 (eProto
== INET_PROT_FTP
) ||
75 (eProto
== INET_PROT_HTTP
) ||
76 (eProto
== INET_PROT_HTTPS
) );
81 sal_Bool
QueryUrl (const INetURLObject
&rUrl
)
83 if (QueryProtocol (rUrl
.GetProtocol()))
84 return QueryUrl_Impl (rUrl
);
89 sal_Bool
QueryUrl (const String
&rUrl
)
92 INetURLObject::CompareProtocolScheme (rUrl
);
93 if (QueryProtocol (eProto
))
94 return QueryUrl_Impl (INetURLObject (rUrl
));
101 void PutUrl (const INetURLObject
&rUrl
)
103 if (QueryProtocol (rUrl
.GetProtocol()))
107 void PutUrl (const String
&rUrl
)
109 INetProtocol eProto
=
110 INetURLObject::CompareProtocolScheme (rUrl
);
111 if (QueryProtocol (eProto
))
112 PutUrl_Impl (INetURLObject (rUrl
));
116 /*========================================================================
118 * INetURLHistoryHint (broadcasted from PutUrl()).
120 *=======================================================================*/
121 DECL_PTRHINT (SVL_DLLPUBLIC
, INetURLHistoryHint
, const INetURLObject
);
123 #endif /* _INETHIST_HXX */
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */