Fixing an issue with output parameters that are of type IntPtr
[castle.git] / MonoRail / Castle.MonoRail.Framework / IViewEngineManager.cs
blobb451766f545f87492ac44f305b5362f15ce99f05
1 // Copyright 2004-2008 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.Generic;
19 using System.IO;
20 using JSGeneration;
22 #region JSCodeGeneratorInfo
24 /// <summary>
25 /// Pendent
26 /// </summary>
27 public class JSCodeGeneratorInfo
29 private IJSCodeGenerator codeGenerator;
30 private IJSGenerator libraryGenerator;
31 private object[] extensions;
32 private object[] elementExtensions;
34 /// <summary>
35 /// Initializes a new instance of the <see cref="JSCodeGeneratorInfo"/> class.
36 /// </summary>
37 /// <param name="codeGenerator">The code generator.</param>
38 /// <param name="libraryGenerator">The library generator.</param>
39 /// <param name="extensions">The extensions.</param>
40 /// <param name="elementExtensions">The element extensions.</param>
41 public JSCodeGeneratorInfo(IJSCodeGenerator codeGenerator, IJSGenerator libraryGenerator, object[] extensions, object[] elementExtensions)
43 this.codeGenerator = codeGenerator;
44 this.libraryGenerator = libraryGenerator;
45 this.extensions = extensions;
46 this.elementExtensions = elementExtensions;
49 /// <summary>
50 /// Gets or sets the code generator.
51 /// </summary>
52 /// <value>The code generator.</value>
53 public IJSCodeGenerator CodeGenerator
55 get { return codeGenerator; }
56 set { codeGenerator = value; }
59 /// <summary>
60 /// Gets or sets the library generator.
61 /// </summary>
62 /// <value>The library generator.</value>
63 public IJSGenerator LibraryGenerator
65 get { return libraryGenerator; }
66 set { libraryGenerator = value; }
69 /// <summary>
70 /// Gets or sets the extensions.
71 /// </summary>
72 /// <value>The extensions.</value>
73 public object[] Extensions
75 get { return extensions; }
76 set { extensions = value; }
79 /// <summary>
80 /// Gets or sets the element extensions.
81 /// </summary>
82 /// <value>The element extensions.</value>
83 public object[] ElementExtensions
85 get { return elementExtensions; }
86 set { elementExtensions = value; }
90 #endregion
92 /// <summary>
93 /// Sits between the controller and the view engines (multiples)
94 /// to decide which view engine should render a specific content
95 /// </summary>
96 public interface IViewEngineManager
98 /// <summary>
99 /// Creates the JS code generator info. Temporarily on IViewEngineManager
100 /// </summary>
101 /// <param name="engineContext">The engine context.</param>
102 /// <param name="controller">The controller.</param>
103 /// <param name="controllerContext">The controller context.</param>
104 /// <returns></returns>
105 JSCodeGeneratorInfo CreateJSCodeGeneratorInfo(IEngineContext engineContext, IController controller,
106 IControllerContext controllerContext);
108 /// <summary>
109 /// Evaluates whether the specified template exists.
110 /// </summary>
111 /// <returns><c>true</c> if it exists</returns>
112 bool HasTemplate(String templateName);
114 ///<summary>
115 /// Processes the view - using the templateName
116 /// to obtain the correct template
117 /// and writes the results to the System.TextWriter.
118 /// </summary>
119 void Process(string templateName, TextWriter output, IEngineContext context, IController controller, IControllerContext controllerContext);
121 /// <summary>
122 /// Processes the view - using the templateName
123 /// to obtain the correct template
124 /// and writes the results to the System.TextWriter.
125 /// </summary>
126 void Process(string templateName, string layoutName, TextWriter output, IDictionary<string,object> parameters);
128 /// <summary>
129 /// Processes a partial view using the partialName
130 /// to obtain the correct template and writes the
131 /// results to the System.TextWriter.
132 /// </summary>
133 /// <param name="partialName">The partial name.</param>
134 /// <param name="output">The output.</param>
135 /// <param name="context">The context.</param>
136 /// <param name="controller">The controller.</param>
137 /// <param name="controllerContext">The controller context.</param>
138 void ProcessPartial(String partialName, TextWriter output, IEngineContext context, IController controller, IControllerContext controllerContext);
140 // Holding it a little more as it would be a breaking change (meaning all partials view would break)
142 // /// <summary>
143 // /// Processes a partial view using the partialName
144 // /// to obtain the correct template and writes the
145 // /// results to the System.TextWriter.
146 // /// </summary>
147 // /// <param name="partialName">The partial name.</param>
148 // /// <param name="output">The output.</param>
149 // /// <param name="context">The context.</param>
150 // /// <param name="parameters">The parameters.</param>
151 // void ProcessPartial(String partialName, TextWriter output, IEngineContext context, IDictionary<string, object> parameters);
153 /// <summary>
154 /// Wraps the specified content in the layout using
155 /// the context to output the result.
156 /// </summary>
157 void RenderStaticWithinLayout(String contents, IEngineContext context, IController controller, IControllerContext controllerContext);