1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/image/decoders/icon/gtk/nsIconChannel.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef nsIconChannel_h_ 1.9 +#define nsIconChannel_h_ 1.10 + 1.11 +#include "mozilla/Attributes.h" 1.12 + 1.13 +#include "nsIChannel.h" 1.14 +#include "nsIStreamListener.h" 1.15 +#include "nsIURI.h" 1.16 +#include "nsIIconURI.h" 1.17 +#include "nsCOMPtr.h" 1.18 + 1.19 +/** 1.20 + * This class is the gnome implementation of nsIconChannel. It basically asks 1.21 + * gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for 1.22 + * that file to which all calls will be proxied. 1.23 + */ 1.24 +class nsIconChannel MOZ_FINAL : public nsIChannel { 1.25 + public: 1.26 + NS_DECL_ISUPPORTS 1.27 + NS_FORWARD_NSIREQUEST(mRealChannel->) 1.28 + NS_FORWARD_NSICHANNEL(mRealChannel->) 1.29 + 1.30 + nsIconChannel() {} 1.31 + ~nsIconChannel() {} 1.32 + 1.33 + static void Shutdown(); 1.34 + 1.35 + /** 1.36 + * Called by nsIconProtocolHandler after it creates this channel. 1.37 + * Must be called before calling any other function on this object. 1.38 + * If this method fails, no other function must be called on this object. 1.39 + */ 1.40 + NS_HIDDEN_(nsresult) Init(nsIURI* aURI); 1.41 + private: 1.42 + /** 1.43 + * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html). 1.44 + * Will always be non-null after a successful Init. 1.45 + */ 1.46 + nsCOMPtr<nsIChannel> mRealChannel; 1.47 + 1.48 + /** 1.49 + * Called by Init if we need to use the gnomeui library. 1.50 + */ 1.51 + nsresult InitWithGnome(nsIMozIconURI *aURI); 1.52 + nsresult InitWithGIO(nsIMozIconURI *aIconURI); 1.53 +}; 1.54 + 1.55 +#endif