Merge pull request #704 from jgagnon/master
[mono.git] / mcs / class / System.Data.Linq / src / DbMetal / Generator / IProcessor.cs
1 #region MIT license\r
2 // \r
3 // MIT license\r
4 //\r
5 // Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne\r
6 // \r
7 // Permission is hereby granted, free of charge, to any person obtaining a copy\r
8 // of this software and associated documentation files (the "Software"), to deal\r
9 // in the Software without restriction, including without limitation the rights\r
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
11 // copies of the Software, and to permit persons to whom the Software is\r
12 // furnished to do so, subject to the following conditions:\r
13 // \r
14 // The above copyright notice and this permission notice shall be included in\r
15 // all copies or substantial portions of the Software.\r
16 // \r
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
23 // THE SOFTWARE.\r
24 // \r
25 #endregion\r
26 \r
27 using System.Collections.Generic;\r
28 using System.IO;\r
29 using DbLinq.Schema.Dbml;\r
30 using DbLinq.Vendor;\r
31 \r
32 namespace DbMetal.Generator\r
33 {\r
34 #if !MONO_STRICT\r
35     public\r
36 #endif\r
37     interface IProcessor\r
38     {\r
39         /// <summary>\r
40         /// The SchemaLoadFactory is used to create the ISchemaLoader (who loads the schema from the database)\r
41         /// Automatically created by IProcessor implementation\r
42         /// </summary>\r
43         ISchemaLoaderFactory SchemaLoaderFactory { get; set; }\r
44 \r
45         /// <summary>\r
46         /// Log output\r
47         /// </summary>\r
48         TextWriter Log { get; set; }\r
49 \r
50         /// <summary>\r
51         /// Whole process, given application parameters\r
52         /// </summary>\r
53         /// <param name="args"></param>\r
54         void Process(string[] args);\r
55         /// <summary>\r
56         /// Generates a code file, given parameters\r
57         /// </summary>\r
58         /// <param name="parameters">Application parameters</param>\r
59         /// <param name="dbSchema">Loaded schema (from file or database)</param>\r
60         /// <param name="schemaLoader">Schema loader related to dbSchema</param>\r
61         /// <param name="filename">Output filename</param>\r
62         void GenerateCode(Parameters parameters, Database dbSchema, ISchemaLoader schemaLoader, string filename);\r
63         /// <summary>\r
64         /// Loads a schema from a database\r
65         /// </summary>\r
66         /// <param name="parameters"></param>\r
67         /// <param name="schemaLoader"></param>\r
68         /// <returns></returns>\r
69         Database ReadSchema(Parameters parameters, out ISchemaLoader schemaLoader);\r
70         /// <summary>\r
71         /// Loads a schema from a given file\r
72         /// </summary>\r
73         /// <param name="filename"></param>\r
74         /// <param name="parameters"></param>\r
75         /// <returns></returns>\r
76                 Database ReadSchema(Parameters parameters, string filename);\r
77         /// <summary>\r
78         /// Lists all code generators available in DbMetal\r
79         /// </summary>\r
80         /// <returns></returns>\r
81         IEnumerable<ICodeGenerator> EnumerateCodeGenerators();\r
82         /// <summary>\r
83         /// Find a code generator given the /language or filename extension\r
84         /// </summary>\r
85         /// <param name="parameters"></param>\r
86         /// <param name="filename"></param>\r
87         /// <returns></returns>\r
88         ICodeGenerator FindCodeGenerator(Parameters parameters, string filename);\r
89     }\r
90 }\r