gecko-dev/gfx/public/nsIImageRequest.h

82 lines
2.5 KiB
C
Raw Normal View History

1998-04-13 20:24:54 +00:00
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
1998-04-13 20:24:54 +00:00
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
1998-04-13 20:24:54 +00:00
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
1998-04-13 20:24:54 +00:00
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
1998-04-13 20:24:54 +00:00
*/
#ifndef nsIImageRequest_h___
#define nsIImageRequest_h___
#include <stdio.h>
#include "nsISupports.h"
#include "nscore.h"
class nsIImageRequestObserver;
class nsIImage;
// IID for the nsIImageRequest interface
#define NS_IIMAGEREQUEST_IID \
{ 0xc31444c0, 0xaec9, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
1998-04-15 19:37:44 +00:00
/**
*
* An image request generated as a result of invoking the
* <code>GetImage</code> method of the <code>nsIImageGroup</code>
* interface.
*/
1998-04-13 20:24:54 +00:00
class nsIImageRequest : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IIMAGEREQUEST_IID)
1998-04-15 19:37:44 +00:00
/// @return the image object associated with the request.
1998-04-13 20:24:54 +00:00
virtual nsIImage* GetImage() = 0;
1998-04-15 19:37:44 +00:00
/**
* Returns the natural dimensions of the image. Returns 0,0
* if the dimensions are unknown.
*
* Note: the dimensions that are returned are in pixels
1998-04-15 19:37:44 +00:00
*
* @param aWidth, aHeight - pointers to integers to be filled in with
* the dimensions.
*/
1998-04-13 20:24:54 +00:00
virtual void GetNaturalDimensions(PRUint32 *aWidth, PRUint32 *aHeight) = 0;
1998-04-15 19:37:44 +00:00
/**
* Add an observers to be informed of image loading notifications.
*
* @param aObserver - An observer to add to the observer list.
* @param boolean indicating whether addition was successful.
*/
1998-04-13 20:24:54 +00:00
virtual PRBool AddObserver(nsIImageRequestObserver *aObserver) = 0;
1998-04-15 19:37:44 +00:00
/**
* Remove a previously added observer from the observer list.
*
* @param aObserver - An observer to remove from the observer list.
* @param boolean indicating whether the removal was successful.
*/
1998-04-13 20:24:54 +00:00
virtual PRBool RemoveObserver(nsIImageRequestObserver *aObserver) = 0;
1998-04-15 19:37:44 +00:00
/// Interrupt loading of just this image.
1998-04-13 20:24:54 +00:00
virtual void Interrupt() = 0;
};
#endif