Minor changes to improve testability of helpers
[castle.git] / MonoRail / Castle.MonoRail.Framework / IViewEngineManager.cs
blobc42a56ed111c4d549a2fc4a1835783085b69b248
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.IO;
20 /// <summary>
21 /// Sits between the controller and the view engines (multiples)
22 /// to decide which view engine should render a specific content
23 /// </summary>
24 public interface IViewEngineManager
26 /// <summary>
27 /// Evaluates whether the specified template exists.
28 /// </summary>
29 /// <returns><c>true</c> if it exists</returns>
30 bool HasTemplate(String templateName);
32 /// <summary>
33 /// Processes the view - using the templateName
34 /// to obtain the correct template,
35 /// and using the context to output the result.
36 /// </summary>
37 void Process(IRailsEngineContext context, IController controller, String templateName);
39 ///<summary>
40 /// Processes the view - using the templateName
41 /// to obtain the correct template
42 /// and writes the results to the System.TextWriter.
43 /// <para>
44 /// Please note that no layout is applied
45 /// </para>
46 /// </summary>
47 void Process(TextWriter output, IRailsEngineContext context, IController controller, String templateName);
49 /// <summary>
50 /// Processes a partial view = using the partialName
51 /// to obtain the correct template and writes the
52 /// results to the System.TextWriter.
53 /// </summary>
54 /// <param name="output">The output.</param>
55 /// <param name="context">The context.</param>
56 /// <param name="controller">The controller.</param>
57 /// <param name="partialName">The partial name.</param>
58 void ProcessPartial(TextWriter output, IRailsEngineContext context, IController controller, String partialName);
60 /// <summary>
61 /// Wraps the specified content in the layout using
62 /// the context to output the result.
63 /// </summary>
64 void ProcessContents(IRailsEngineContext context, IController controller, String contents);