sync master with lastest vba changes
[ooovba.git] / goodies / inc / chtuner.hxx
blob412f0254c7f2d6c189ea7a09e11158c931639431
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: chtuner.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 ************************************************************************/
31 #ifndef _CHTUNER_HXX
32 #define _CHTUNER_HXX
34 #include <vcl/timer.hxx>
35 #include <tools/list.hxx>
36 #ifndef _INETSESS_HXX
37 #include <inet/inetsess.hxx>
38 #endif
41 #include <svtools/lstner.hxx>
43 class ChannelItem;
44 class ChannelList;
45 class INetRequest;
46 class Downloader;
47 class StringList;
49 struct RetryInformation
51 String aURL;
52 Time aErrorTime;
55 DECLARE_LIST(ReqList,INetRequest*)
56 DECLARE_LIST(RetryList,RetryInformation*)
58 class ChannelTuner : public SfxListener
60 ChannelList* pChannelList;
61 INetSessionRef xINetSession;
62 ReqList* pReqList;
64 Link aBTXCallBack;
65 Downloader* pBTXDecoder;
66 String aBTXFileName;
68 AutoTimer aRetryTimer;
69 RetryList* pRetryList;
71 void SendHttpReq(const INetURLObject& rURL);
72 void SendFtpReq(const INetURLObject& rURL);
73 void SendBTXReq(const INetURLObject& rURL);
74 void GetFileTrans(const INetURLObject& rURL);
76 void RemoveRequest(INetRequest* pReq);
77 void NotifyChannelList(String& rStr);
79 virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType,
80 const SfxHint& rHint, const TypeId& rHintType);
82 DECL_LINK(RetryCallBack, void*);
83 DECL_LINK(BTXCallBack, void*);
84 public:
85 ChannelTuner(INetSession* pSess, ChannelList* pChList);
86 ~ChannelTuner();
88 BOOL RequestChannel(ChannelItem* pItem, const Link& rBTXCallBack);
90 void SetINetSession(INetSession* pNewSess);
91 void SetBTXDecoder(Downloader* pDecoder);
94 #endif // _CHTUNER_HXX