michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsIconChannel_h_ michael@0: #define nsIconChannel_h_ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #include "nsIChannel.h" michael@0: #include "nsIStreamListener.h" michael@0: #include "nsIURI.h" michael@0: #include "nsIIconURI.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: /** michael@0: * This class is the gnome implementation of nsIconChannel. It basically asks michael@0: * gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for michael@0: * that file to which all calls will be proxied. michael@0: */ michael@0: class nsIconChannel MOZ_FINAL : public nsIChannel { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_FORWARD_NSIREQUEST(mRealChannel->) michael@0: NS_FORWARD_NSICHANNEL(mRealChannel->) michael@0: michael@0: nsIconChannel() {} michael@0: ~nsIconChannel() {} michael@0: michael@0: static void Shutdown(); michael@0: michael@0: /** michael@0: * Called by nsIconProtocolHandler after it creates this channel. michael@0: * Must be called before calling any other function on this object. michael@0: * If this method fails, no other function must be called on this object. michael@0: */ michael@0: NS_HIDDEN_(nsresult) Init(nsIURI* aURI); michael@0: private: michael@0: /** michael@0: * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html). michael@0: * Will always be non-null after a successful Init. michael@0: */ michael@0: nsCOMPtr mRealChannel; michael@0: michael@0: /** michael@0: * Called by Init if we need to use the gnomeui library. michael@0: */ michael@0: nsresult InitWithGnome(nsIMozIconURI *aURI); michael@0: nsresult InitWithGIO(nsIMozIconURI *aIconURI); michael@0: }; michael@0: michael@0: #endif