sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / inethist.hxx
blob23a43766fdd40e7f721d01a22d4f459ecefbb711
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: inethist.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _INETHIST_HXX
31 #define _INETHIST_HXX
33 #ifndef _SOLAR_H
34 #include <tools/solar.h>
35 #endif
37 #ifndef _STRING_HXX
38 #include <tools/string.hxx>
39 #endif
41 #ifndef _URLOBJ_HXX
42 #include <tools/urlobj.hxx>
43 #endif
45 #ifndef _SFXBRDCST_HXX
46 #include <bf_svtools/brdcst.hxx>
47 #endif
49 #ifndef _SFXHINT_HXX
50 #include <bf_svtools/hint.hxx>
51 #endif
53 namespace binfilter
56 /*========================================================================
58 * INetURLHistory interface.
60 *=======================================================================*/
61 class INetURLHistory_Impl;
62 class INetURLHistory : public SfxBroadcaster
64 struct StaticInstance
66 INetURLHistory * operator()();
68 friend INetURLHistory * StaticInstance::operator()();
70 /** Representation.
72 INetURLHistory_Impl *m_pImpl;
74 /** Construction/Destruction.
76 INetURLHistory (void);
77 virtual ~INetURLHistory (void);
79 /** Implementation.
81 static void NormalizeUrl_Impl (INetURLObject &rUrl);
83 void PutUrl_Impl (const INetURLObject &rUrl);
84 BOOL QueryUrl_Impl (const INetURLObject &rUrl);
86 /** Not implemented.
88 INetURLHistory (const INetURLHistory&);
89 INetURLHistory& operator= (const INetURLHistory&);
91 public:
92 /** GetOrCreate.
94 static INetURLHistory* GetOrCreate (void);
96 /** QueryProtocol.
98 BOOL QueryProtocol (INetProtocol eProto) const
100 return ((eProto == INET_PROT_FILE ) ||
101 (eProto == INET_PROT_FTP ) ||
102 (eProto == INET_PROT_HTTP ) ||
103 (eProto == INET_PROT_HTTPS) );
106 /** QueryUrl.
108 BOOL QueryUrl (const INetURLObject &rUrl)
110 if (QueryProtocol (rUrl.GetProtocol()))
111 return QueryUrl_Impl (rUrl);
112 else
113 return FALSE;
116 BOOL QueryUrl (const String &rUrl)
118 INetProtocol eProto =
119 INetURLObject::CompareProtocolScheme (rUrl);
120 if (QueryProtocol (eProto))
121 return QueryUrl_Impl (INetURLObject (rUrl));
122 else
123 return FALSE;
126 /** PutUrl.
128 void PutUrl (const INetURLObject &rUrl)
130 if (QueryProtocol (rUrl.GetProtocol()))
131 PutUrl_Impl (rUrl);
134 void PutUrl (const String &rUrl)
136 INetProtocol eProto =
137 INetURLObject::CompareProtocolScheme (rUrl);
138 if (QueryProtocol (eProto))
139 PutUrl_Impl (INetURLObject (rUrl));
143 /*========================================================================
145 * INetURLHistoryHint (broadcasted from PutUrl()).
147 *=======================================================================*/
148 DECL_PTRHINT (, INetURLHistoryHint, const INetURLObject);
152 #endif /* _INETHIST_HXX */