1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski #ifndef _INETHIST_HXX 24*b1cdbd2cSJim Jagielski #define _INETHIST_HXX 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski #include "svl/svldllapi.h" 27*b1cdbd2cSJim Jagielski #include <tools/solar.h> 28*b1cdbd2cSJim Jagielski #include <tools/string.hxx> 29*b1cdbd2cSJim Jagielski #include <tools/urlobj.hxx> 30*b1cdbd2cSJim Jagielski #include <svl/brdcst.hxx> 31*b1cdbd2cSJim Jagielski #include <svl/hint.hxx> 32*b1cdbd2cSJim Jagielski 33*b1cdbd2cSJim Jagielski /*======================================================================== 34*b1cdbd2cSJim Jagielski * 35*b1cdbd2cSJim Jagielski * INetURLHistory interface. 36*b1cdbd2cSJim Jagielski * 37*b1cdbd2cSJim Jagielski *=======================================================================*/ 38*b1cdbd2cSJim Jagielski class INetURLHistory_Impl; 39*b1cdbd2cSJim Jagielski class INetURLHistory : public SfxBroadcaster 40*b1cdbd2cSJim Jagielski { 41*b1cdbd2cSJim Jagielski struct StaticInstance 42*b1cdbd2cSJim Jagielski { 43*b1cdbd2cSJim Jagielski INetURLHistory * operator()(); 44*b1cdbd2cSJim Jagielski }; 45*b1cdbd2cSJim Jagielski friend INetURLHistory * StaticInstance::operator()(); 46*b1cdbd2cSJim Jagielski 47*b1cdbd2cSJim Jagielski /** Representation. 48*b1cdbd2cSJim Jagielski */ 49*b1cdbd2cSJim Jagielski INetURLHistory_Impl *m_pImpl; 50*b1cdbd2cSJim Jagielski 51*b1cdbd2cSJim Jagielski /** Construction/Destruction. 52*b1cdbd2cSJim Jagielski */ 53*b1cdbd2cSJim Jagielski INetURLHistory (void); 54*b1cdbd2cSJim Jagielski virtual ~INetURLHistory (void); 55*b1cdbd2cSJim Jagielski 56*b1cdbd2cSJim Jagielski /** Implementation. 57*b1cdbd2cSJim Jagielski */ 58*b1cdbd2cSJim Jagielski static void NormalizeUrl_Impl (INetURLObject &rUrl); 59*b1cdbd2cSJim Jagielski 60*b1cdbd2cSJim Jagielski SVL_DLLPUBLIC void PutUrl_Impl (const INetURLObject &rUrl); 61*b1cdbd2cSJim Jagielski SVL_DLLPUBLIC sal_Bool QueryUrl_Impl (const INetURLObject &rUrl); 62*b1cdbd2cSJim Jagielski 63*b1cdbd2cSJim Jagielski /** Not implemented. 64*b1cdbd2cSJim Jagielski */ 65*b1cdbd2cSJim Jagielski INetURLHistory (const INetURLHistory&); 66*b1cdbd2cSJim Jagielski INetURLHistory& operator= (const INetURLHistory&); 67*b1cdbd2cSJim Jagielski 68*b1cdbd2cSJim Jagielski public: 69*b1cdbd2cSJim Jagielski /** GetOrCreate. 70*b1cdbd2cSJim Jagielski */ 71*b1cdbd2cSJim Jagielski SVL_DLLPUBLIC static INetURLHistory* GetOrCreate (void); 72*b1cdbd2cSJim Jagielski 73*b1cdbd2cSJim Jagielski /** QueryProtocol. 74*b1cdbd2cSJim Jagielski */ QueryProtocol(INetProtocol eProto) const75*b1cdbd2cSJim Jagielski sal_Bool QueryProtocol (INetProtocol eProto) const 76*b1cdbd2cSJim Jagielski { 77*b1cdbd2cSJim Jagielski return ((eProto == INET_PROT_FILE ) || 78*b1cdbd2cSJim Jagielski (eProto == INET_PROT_FTP ) || 79*b1cdbd2cSJim Jagielski (eProto == INET_PROT_HTTP ) || 80*b1cdbd2cSJim Jagielski (eProto == INET_PROT_HTTPS) ); 81*b1cdbd2cSJim Jagielski } 82*b1cdbd2cSJim Jagielski 83*b1cdbd2cSJim Jagielski /** QueryUrl. 84*b1cdbd2cSJim Jagielski */ QueryUrl(const INetURLObject & rUrl)85*b1cdbd2cSJim Jagielski sal_Bool QueryUrl (const INetURLObject &rUrl) 86*b1cdbd2cSJim Jagielski { 87*b1cdbd2cSJim Jagielski if (QueryProtocol (rUrl.GetProtocol())) 88*b1cdbd2cSJim Jagielski return QueryUrl_Impl (rUrl); 89*b1cdbd2cSJim Jagielski else 90*b1cdbd2cSJim Jagielski return sal_False; 91*b1cdbd2cSJim Jagielski } 92*b1cdbd2cSJim Jagielski QueryUrl(const String & rUrl)93*b1cdbd2cSJim Jagielski sal_Bool QueryUrl (const String &rUrl) 94*b1cdbd2cSJim Jagielski { 95*b1cdbd2cSJim Jagielski INetProtocol eProto = 96*b1cdbd2cSJim Jagielski INetURLObject::CompareProtocolScheme (rUrl); 97*b1cdbd2cSJim Jagielski if (QueryProtocol (eProto)) 98*b1cdbd2cSJim Jagielski return QueryUrl_Impl (INetURLObject (rUrl)); 99*b1cdbd2cSJim Jagielski else 100*b1cdbd2cSJim Jagielski return sal_False; 101*b1cdbd2cSJim Jagielski } 102*b1cdbd2cSJim Jagielski 103*b1cdbd2cSJim Jagielski /** PutUrl. 104*b1cdbd2cSJim Jagielski */ PutUrl(const INetURLObject & rUrl)105*b1cdbd2cSJim Jagielski void PutUrl (const INetURLObject &rUrl) 106*b1cdbd2cSJim Jagielski { 107*b1cdbd2cSJim Jagielski if (QueryProtocol (rUrl.GetProtocol())) 108*b1cdbd2cSJim Jagielski PutUrl_Impl (rUrl); 109*b1cdbd2cSJim Jagielski } 110*b1cdbd2cSJim Jagielski PutUrl(const String & rUrl)111*b1cdbd2cSJim Jagielski void PutUrl (const String &rUrl) 112*b1cdbd2cSJim Jagielski { 113*b1cdbd2cSJim Jagielski INetProtocol eProto = 114*b1cdbd2cSJim Jagielski INetURLObject::CompareProtocolScheme (rUrl); 115*b1cdbd2cSJim Jagielski if (QueryProtocol (eProto)) 116*b1cdbd2cSJim Jagielski PutUrl_Impl (INetURLObject (rUrl)); 117*b1cdbd2cSJim Jagielski } 118*b1cdbd2cSJim Jagielski }; 119*b1cdbd2cSJim Jagielski 120*b1cdbd2cSJim Jagielski /*======================================================================== 121*b1cdbd2cSJim Jagielski * 122*b1cdbd2cSJim Jagielski * INetURLHistoryHint (broadcasted from PutUrl()). 123*b1cdbd2cSJim Jagielski * 124*b1cdbd2cSJim Jagielski *=======================================================================*/ 125*b1cdbd2cSJim Jagielski DECL_PTRHINT (SVL_DLLPUBLIC, INetURLHistoryHint, const INetURLObject); 126*b1cdbd2cSJim Jagielski 127*b1cdbd2cSJim Jagielski #endif /* _INETHIST_HXX */ 128*b1cdbd2cSJim Jagielski 129