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

« back to all changes in this revision

Viewing changes to mozilla/webshell/tests/viewer/public/nsIXPBaseWindow.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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
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 Communicator client 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) 1998
 
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
#ifndef nsIXPBaseWindow_h___
 
38
#define nsIXPBaseWindow_h___
 
39
 
 
40
#include "nsISupports.h"
 
41
 
 
42
class nsIAppShell;
 
43
class nsIFactory;
 
44
class nsIWebShell;
 
45
class nsString;
 
46
class nsIPresShell;
 
47
class nsIDOMElement;
 
48
class nsIDOMNode;
 
49
class nsIWindowListener;
 
50
class nsIDOMHTMLDocument;
 
51
 
 
52
struct nsRect;
 
53
 
 
54
#define NS_IXPBASE_WINDOW_IID \
 
55
{ 0x36c1fe51, 0x6f3e, 0x11d2, { 0x8d, 0xca, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
 
56
 
 
57
#define NS_XPBASE_WINDOW_CID \
 
58
{ 0x36c1fe51, 0x6f3e, 0x11d2, { 0x8d, 0xca, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
 
59
 
 
60
enum nsXPBaseWindowType {   
 
61
                  ///creates a window
 
62
                eXPBaseWindowType_window,
 
63
                  ///creates a dialog
 
64
                eXPBaseWindowType_dialog,
 
65
                  ///creates a modal dialog
 
66
                eXPBaseWindowType_modalDialog
 
67
              }; 
 
68
 
 
69
 
 
70
/**
 
71
 * BaseWindow for HTML Dialog Boxes and Windows. The desciption of the dialog box
 
72
 * or window is encoded in a HTML File. The Contents of the HTML file and the current
 
73
 * settings for form elements are accessed through the W3C DOM interfaces. 
 
74
 * Access to the nsIDOM classes is done through C++ rather than JavaScript. However,
 
75
 * JavaScript event handlers can be used with the HTML File as well.
 
76
 * The BaseWindow contains methods for:
 
77
 *
 
78
 * 1) loading a HTML file 
 
79
 * 2) Initializing the default values for form elements.
 
80
 * 3) attaching an event listener to process click events.
 
81
 * 4) Getting a handle to the HTMLDocumentElement to access nsIDOMElements.
 
82
 */
 
83
 
 
84
class nsIXPBaseWindow : public nsISupports {
 
85
public:
 
86
 
 
87
 /**
 
88
  * Initialize the window or dialog box.
 
89
  * @param aType see nsXPBaseWindowType's above
 
90
  * @param aAppShell application shell
 
91
  * @param aPref     Preferences
 
92
  * @param aDialogURL URL of HTML file describing the dialog or window
 
93
  * @param aTitle    Title of the dialog box or window
 
94
  * @param aBounds   x, y, width, and height of the window or dialog box
 
95
  * XXX: aChrome is probably not needed for dialog boxes and windows, this is a holdover
 
96
  * from the nsBrowserWindow.
 
97
  * @param aChrome   Chrome mask for toolbars and statusbars. 
 
98
  * @param aAllowPlugins  if TRUE then plugins can be referenced in the HTML file.          
 
99
  */
 
100
 
 
101
  NS_IMETHOD Init(nsXPBaseWindowType aType,
 
102
                  nsIAppShell*       aAppShell,
 
103
                  const nsString&    aDialogURL,
 
104
                  const nsString&    aTitle,
 
105
                  const nsRect&      aBounds,
 
106
                  PRUint32           aChromeMask,
 
107
                  PRBool             aAllowPlugins = PR_TRUE) = 0;
 
108
  
 
109
 /**
 
110
  * Set the location the window or dialog box on the screen
 
111
  * @param aX   horizontal location of the upper left 
 
112
  *             corner of the window in pixels from the screen.
 
113
  * @param aY   vertical location of the upper left 
 
114
  *             corner of the window in pixels from the screen.        
 
115
  */
 
116
 
 
117
  NS_IMETHOD SetLocation(PRInt32 aX, PRInt32 aY) = 0;
 
118
 
 
119
 /**
 
120
  * Set the width and height of the window or dialog box in pixels
 
121
  * @param aWidth width of the window or dialog box in pixels.
 
122
  * @param aHeight height of the window or dialog box in pixels. 
 
123
  */
 
124
 
 
125
  NS_IMETHOD SetDimensions(PRInt32 aWidth, PRInt32 aHeight) = 0;
 
126
 
 
127
  NS_IMETHOD GetBounds(nsRect& aResult) = 0;
 
128
 
 
129
  NS_IMETHOD GetWindowBounds(nsRect& aResult) = 0;
 
130
 
 
131
  NS_IMETHOD SetVisible(PRBool aIsVisible) = 0;
 
132
 
 
133
  NS_IMETHOD Close() = 0;
 
134
 
 
135
  NS_IMETHOD SetTitle(const PRUnichar* aTitle) = 0;
 
136
 
 
137
  NS_IMETHOD GetTitle(const PRUnichar** aResult) = 0;
 
138
 
 
139
  NS_IMETHOD GetWebShell(nsIWebShell*& aResult) = 0;
 
140
 
 
141
  NS_IMETHOD LoadURL(const nsString &aURL) = 0;
 
142
 
 
143
  NS_IMETHOD GetPresShell(nsIPresShell*& aPresShell) = 0;
 
144
 
 
145
  NS_IMETHOD GetDocument(nsIDOMHTMLDocument *& aDocument) = 0;
 
146
 
 
147
  NS_IMETHOD AddEventListener(nsIDOMNode * aNode) = 0;
 
148
 
 
149
  NS_IMETHOD RemoveEventListener(nsIDOMNode * aNode) = 0;
 
150
 
 
151
  NS_IMETHOD AddWindowListener(nsIWindowListener * aWindowListener) = 0;
 
152
 
 
153
  // XXX minimize, maximize
 
154
  // XXX event control: enable/disable window close box, stick to glass, modal
 
155
};
 
156
 
 
157
#endif /* nsIXPBaseWindow_h___ */