Added non-generic registration interface to IKernel and IWindsor to accommodate dynam...
[castle.git] / MonoRail / Castle.MonoRail.Framework / IResponse.cs
blob9ed1763cd47ec594fc88eded23ac16670273108f
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework
17 using System;
18 using System.Collections;
19 using System.Collections.Specialized;
20 using System.Web;
22 /// <summary>
23 /// Represents the response data and operations
24 /// </summary>
25 public interface IResponse
27 /// <summary>
28 /// Gets or sets the status code.
29 /// </summary>
30 /// <value>The status code.</value>
31 int StatusCode { get; set; }
33 /// <summary>
34 /// Gets or sets the status code.
35 /// </summary>
36 /// <value>The status code.</value>
37 string StatusDescription { get; set; }
39 /// <summary>
40 /// Gets or sets the type of the content.
41 /// </summary>
42 /// <value>The type of the content.</value>
43 string ContentType { get; set; }
45 /// <summary>
46 /// Gets the caching policy (expiration time, privacy,
47 /// vary clauses) of a Web page.
48 /// </summary>
49 HttpCachePolicy CachePolicy { get; }
51 /// <summary>
52 /// Sets the Cache-Control HTTP header to Public or Private.
53 /// </summary>
54 String CacheControlHeader { get; set; }
56 /// <summary>
57 /// Gets or sets the HTTP character set of the output stream.
58 /// </summary>
59 String Charset { get; set; }
61 /// <summary>
62 /// Gets the output.
63 /// </summary>
64 /// <value>The output.</value>
65 System.IO.TextWriter Output { get; }
67 /// <summary>
68 /// Gets the output stream.
69 /// </summary>
70 /// <value>The output stream.</value>
71 System.IO.Stream OutputStream { get; }
73 /// <summary>
74 /// Appends the header.
75 /// </summary>
76 /// <param name="name">The name.</param>
77 /// <param name="value">The value.</param>
78 void AppendHeader(String name, String value);
80 // /// <summary>
81 // /// Writes the buffer to the browser
82 // /// </summary>
83 // /// <param name="buffer">The buffer.</param>
84 // void BinaryWrite(byte[] buffer);
86 // /// <summary>
87 // /// Writes the stream to the browser
88 // /// </summary>
89 // /// <param name="stream">The stream.</param>
90 // void BinaryWrite(System.IO.Stream stream);
92 /// <summary>
93 /// Clears the response (only works if buffered)
94 /// </summary>
95 void Clear();
97 /// <summary>
98 /// Clears the response content (only works if buffered).
99 /// </summary>
100 void ClearContent();
102 /// <summary>
103 /// Writes the specified string.
104 /// </summary>
105 /// <param name="s">The string.</param>
106 void Write(String s);
108 /// <summary>
109 /// Writes the specified obj.
110 /// </summary>
111 /// <param name="obj">The obj.</param>
112 void Write(object obj);
114 /// <summary>
115 /// Writes the specified char.
116 /// </summary>
117 /// <param name="ch">The char.</param>
118 void Write(char ch);
120 /// <summary>
121 /// Writes the specified buffer.
122 /// </summary>
123 /// <param name="buffer">The buffer.</param>
124 /// <param name="index">The index.</param>
125 /// <param name="count">The count.</param>
126 void Write(char[] buffer, int index, int count);
128 // /// <summary>
129 // /// Writes the file.
130 // /// </summary>
131 // /// <param name="fileName">Name of the file.</param>
132 // void WriteFile(String fileName);
134 /// <summary>
135 /// Redirects the specified controller.
136 /// </summary>
137 /// <param name="parameters">The parameters.</param>
138 void Redirect(object parameters);
140 /// <summary>
141 /// Redirects the specified controller.
142 /// </summary>
143 /// <param name="controller">The controller.</param>
144 /// <param name="action">The action.</param>
145 void Redirect(String controller, String action);
147 /// <summary>
148 /// Redirects the specified area.
149 /// </summary>
150 /// <param name="area">The area.</param>
151 /// <param name="controller">The controller.</param>
152 /// <param name="action">The action.</param>
153 void Redirect(String area, String controller, String action);
155 /// <summary>
156 /// Redirects to another controller and action with the specified paramters.
157 /// </summary>
158 /// <param name="controller">Controller name</param>
159 /// <param name="action">Action name</param>
160 /// <param name="parameters">Key/value pairings</param>
161 void Redirect(string controller, string action, NameValueCollection parameters);
163 /// <summary>
164 /// Redirects to another controller and action with the specified paramters.
165 /// </summary>
166 /// <param name="area">Area name</param>
167 /// <param name="controller">Controller name</param>
168 /// <param name="action">Action name</param>
169 /// <param name="parameters">Key/value pairings</param>
170 void Redirect(string area, string controller, string action, NameValueCollection parameters);
172 /// <summary>
173 /// Redirects to another controller and action with the specified paramters.
174 /// </summary>
175 /// <param name="controller">Controller name</param>
176 /// <param name="action">Action name</param>
177 /// <param name="parameters">Key/value pairings</param>
178 void Redirect(string controller, string action, IDictionary parameters);
180 /// <summary>
181 /// Redirects to another controller and action with the specified paramters.
182 /// </summary>
183 /// <param name="area">Area name</param>
184 /// <param name="controller">Controller name</param>
185 /// <param name="action">Action name</param>
186 /// <param name="parameters">Key/value pairings</param>
187 void Redirect(string area, string controller, string action, IDictionary parameters);
189 /// <summary>
190 /// Redirects the specified URL.
191 /// </summary>
192 /// <param name="url">The URL.</param>
193 void RedirectToUrl(String url);
195 /// <summary>
196 /// Redirects the specified URL.
197 /// </summary>
198 /// <param name="url">The URL.</param>
199 /// <param name="endProcess">if set to <c>true</c> [end process].</param>
200 void RedirectToUrl(String url, bool endProcess);
202 /// <summary>
203 /// Gets a value indicating whether the response sent a redirect.
204 /// </summary>
205 /// <value><c>true</c> if was redirected; otherwise, <c>false</c>.</value>
206 bool WasRedirected { get; }
208 /// <summary>
209 /// Gets a value indicating whether this instance is client connected.
210 /// </summary>
211 /// <value>
212 /// <c>true</c> if this instance is client connected; otherwise, <c>false</c>.
213 /// </value>
214 bool IsClientConnected { get; }
216 /// <summary>
217 /// Creates a cookie.
218 /// </summary>
219 /// <param name="name">The name.</param>
220 /// <param name="value">The value.</param>
221 void CreateCookie(String name, String value);
223 /// <summary>
224 /// Creates a cookie.
225 /// </summary>
226 /// <param name="name">The name.</param>
227 /// <param name="value">The value.</param>
228 /// <param name="expiration">The expiration.</param>
229 void CreateCookie(String name, String value, DateTime expiration);
231 /// <summary>
232 /// Creates a cookie.
233 /// </summary>
234 /// <param name="cookie">The cookie.</param>
235 void CreateCookie(HttpCookie cookie);
237 /// <summary>
238 /// Removes a cookie.
239 /// </summary>
240 /// <param name="name">The name.</param>
241 void RemoveCookie(string name);