New test.
[mono.git] / mcs / class / System.Configuration / System.Configuration.Internal / IInternalConfigHost.cs
1 //
2 // System.Configuration.Internal.IInternalConfigHost.cs
3 //
4 // Authors:
5 //  Lluis Sanchez Gual (lluis@novell.com)
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining
8 // a copy of this software and associated documentation files (the
9 // "Software"), to deal in the Software without restriction, including
10 // without limitation the rights to use, copy, modify, merge, publish,
11 // distribute, sublicense, and/or sell copies of the Software, and to
12 // permit persons to whom the Software is furnished to do so, subject to
13 // the following conditions:
14 // 
15 // The above copyright notice and this permission notice shall be
16 // included in all copies or substantial portions of the Software.
17 // 
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
27 //
28
29 #if NET_2_0
30
31 using System;
32 using System.IO;
33 using System.Security;
34
35 namespace System.Configuration.Internal
36 {
37         [System.Runtime.InteropServices.ComVisible (false)]
38         public interface IInternalConfigHost
39         {
40                 object CreateConfigurationContext (string configPath, string locationSubPath);
41                 object CreateDeprecatedConfigContext (string configPath);
42                 string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
43                 void DeleteStream (string streamName);
44                 string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
45                 string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath);
46                 Type GetConfigType (string typeName, bool throwOnError);
47                 string GetConfigTypeName (Type t);
48                 void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady);
49                 string GetStreamName (string configPath);
50                 string GetStreamNameForConfigSource (string streamName, string configSource);
51                 object GetStreamVersion (string streamName);
52                 IDisposable Impersonate ();
53                 void Init (IInternalConfigRoot root, params object[] hostInitParams);
54                 void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams);
55                 bool IsAboveApplication (string configPath);
56                 bool IsConfigRecordRequired (string configPath);
57                 bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition);
58                 bool IsFile (string streamName);
59                 bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord);
60                 bool IsInitDelayed (IInternalConfigRecord configRecord);
61                 bool IsLocationApplicable (string configPath);
62                 bool IsRemote { get; }
63                 bool IsSecondaryRoot (string configPath);
64                 bool IsTrustedConfigPath (string configPath);
65                 Stream OpenStreamForRead (string streamName);
66                 Stream OpenStreamForRead (string streamName, bool assertPermissions);
67                 Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext);
68                 Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions);
69                 bool PrefetchAll (string configPath, string streamName);
70                 bool PrefetchSection (string sectionGroupName, string sectionName);
71                 void RequireCompleteInit (IInternalConfigRecord configRecord);
72                 object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback);
73                 void StopMonitoringStreamForChanges (string streamName, StreamChangeCallback callback);
74                 void VerifyDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition, IConfigErrorInfo errorInfo);
75                 void WriteCompleted (string streamName, bool success, object writeContext);
76                 void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions);
77                 
78                 bool SupportsChangeNotifications { get; }
79                 bool SupportsLocation { get; }
80                 bool SupportsPath { get; }
81                 bool SupportsRefresh { get; }
82         }
83 }
84
85 #endif