~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/layout/html/base/src/nsDummyLayoutRequest.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
 
4
 *
 
5
 * The contents of this file are subject to the Netscape Public License
 
6
 * Version 1.1 (the "License"); you may not use this file except in
 
7
 * compliance with the License. You may obtain a copy of the License at
 
8
 * http://www.mozilla.org/NPL/
 
9
 *
 
10
 * Software distributed under the License is distributed on an "AS IS" basis,
 
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
 * for the specific language governing rights and limitations under the
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
17
 * The Initial Developer of the Original Code is
 
18
 * Netscape Communications Corporation.
 
19
 * Portions created by the Initial Developer are Copyright (C) 2002
 
20
 * the Initial Developer. All Rights Reserved.
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 * Alternatively, the contents of this file may be used under the terms of
 
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
28
 * of those above. If you wish to allow use of your version of this file only
 
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
30
 * use your version of this file under the terms of the NPL, indicate your
 
31
 * decision by deleting the provisions above and replace them with the notice
 
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
33
 * the provisions above, a recipient may use your version of this file under
 
34
 * the terms of any one of the NPL, the GPL or the LGPL.
 
35
 *
 
36
 * ***** END LICENSE BLOCK ***** */
 
37
 
 
38
#ifndef nsDummyLayoutRequest_h__
 
39
#define nsDummyLayoutRequest_h__
 
40
 
 
41
#include "nsIChannel.h"
 
42
#include "nsILoadGroup.h"
 
43
#include "nsNetUtil.h"
 
44
#include "nsWeakPtr.h"
 
45
 
 
46
//----------------------------------------------------------------------
 
47
//
 
48
// DummyLayoutRequest
 
49
//
 
50
//   This is a dummy request implementation that we add to the document's load
 
51
//   group. It ensures that EndDocumentLoad() in the docshell doesn't fire
 
52
//   before we've finished all of layout.
 
53
//
 
54
 
 
55
class nsDummyLayoutRequest : public nsIChannel
 
56
{
 
57
protected:
 
58
  nsDummyLayoutRequest(nsIPresShell* aPresShell);
 
59
  virtual ~nsDummyLayoutRequest();
 
60
 
 
61
  static PRInt32 gRefCnt;
 
62
  static nsIURI* gURI;
 
63
 
 
64
  nsCOMPtr<nsILoadGroup> mLoadGroup;
 
65
  nsWeakPtr mPresShell;
 
66
 
 
67
public:
 
68
  static nsresult
 
69
  Create(nsIRequest** aResult, nsIPresShell* aPresShell);
 
70
 
 
71
  NS_DECL_ISUPPORTS
 
72
 
 
73
        // nsIRequest
 
74
  NS_IMETHOD GetName(nsACString &result) { 
 
75
    result = NS_LITERAL_CSTRING("about:layout-dummy-request");
 
76
    return NS_OK;
 
77
  }
 
78
  NS_IMETHOD IsPending(PRBool *_retval) { *_retval = PR_TRUE; return NS_OK; }
 
79
  NS_IMETHOD GetStatus(nsresult *status) { *status = NS_OK; return NS_OK; } 
 
80
  NS_IMETHOD Cancel(nsresult status);
 
81
  NS_IMETHOD Suspend(void) { return NS_OK; }
 
82
  NS_IMETHOD Resume(void)  { return NS_OK; }
 
83
  NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) { *aLoadGroup = mLoadGroup; NS_IF_ADDREF(*aLoadGroup); return NS_OK; }
 
84
  NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup) { mLoadGroup = aLoadGroup; return NS_OK; }
 
85
  NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) { *aLoadFlags = nsIRequest::LOAD_NORMAL; return NS_OK; }
 
86
  NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) { return NS_OK; }
 
87
 
 
88
        // nsIChannel
 
89
  NS_IMETHOD GetOriginalURI(nsIURI* *aOriginalURI) { *aOriginalURI = gURI; NS_ADDREF(*aOriginalURI); return NS_OK; }
 
90
  NS_IMETHOD SetOriginalURI(nsIURI* aOriginalURI) { gURI = aOriginalURI; NS_ADDREF(gURI); return NS_OK; }
 
91
  NS_IMETHOD GetURI(nsIURI* *aURI) { *aURI = gURI; NS_ADDREF(*aURI); return NS_OK; }
 
92
  NS_IMETHOD SetURI(nsIURI* aURI) { gURI = aURI; NS_ADDREF(gURI); return NS_OK; }
 
93
  NS_IMETHOD Open(nsIInputStream **_retval) { *_retval = nsnull; return NS_OK; }
 
94
  NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt) { return NS_OK; }
 
95
  NS_IMETHOD GetOwner(nsISupports * *aOwner) { *aOwner = nsnull; return NS_OK; }
 
96
  NS_IMETHOD SetOwner(nsISupports * aOwner) { return NS_OK; }
 
97
  NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor * *aNotificationCallbacks) { *aNotificationCallbacks = nsnull; return NS_OK; }
 
98
  NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor * aNotificationCallbacks) { return NS_OK; }
 
99
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) { *aSecurityInfo = nsnull; return NS_OK; } 
 
100
  NS_IMETHOD GetContentType(nsACString &aContentType) { aContentType.Truncate(); return NS_OK; } 
 
101
  NS_IMETHOD SetContentType(const nsACString &aContentType) { return NS_OK; } 
 
102
  NS_IMETHOD GetContentCharset(nsACString &aContentCharset) { aContentCharset.Truncate(); return NS_OK; } 
 
103
  NS_IMETHOD SetContentCharset(const nsACString &aContentCharset) { return NS_OK; } 
 
104
  NS_IMETHOD GetContentLength(PRInt32 *aContentLength) { return NS_OK; }
 
105
  NS_IMETHOD SetContentLength(PRInt32 aContentLength) { return NS_OK; }
 
106
};
 
107
 
 
108
#endif