1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chtuner.hxx,v $
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 ************************************************************************/
34 #include <vcl/timer.hxx>
35 #include <tools/list.hxx>
37 #include <inet/inetsess.hxx>
41 #include <svtools/lstner.hxx>
49 struct RetryInformation
55 DECLARE_LIST(ReqList
,INetRequest
*)
56 DECLARE_LIST(RetryList
,RetryInformation
*)
58 class ChannelTuner
: public SfxListener
60 ChannelList
* pChannelList
;
61 INetSessionRef xINetSession
;
65 Downloader
* pBTXDecoder
;
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*);
85 ChannelTuner(INetSession
* pSess
, ChannelList
* pChList
);
88 BOOL
RequestChannel(ChannelItem
* pItem
, const Link
& rBTXCallBack
);
90 void SetINetSession(INetSession
* pNewSess
);
91 void SetBTXDecoder(Downloader
* pDecoder
);
94 #endif // _CHTUNER_HXX