import typing, abc
from System import Exception, Array_1
from System.Collections import IDictionary
from System.Reflection import MethodBase
from System.IO import FileInfo, DirectoryInfo
from SIMULTAN.Projects import ExtendedProjectData, HierarchicalProject, CompactProject
from System.Collections.Generic import IEnumerable_1, List_1
from SIMULTAN.Data.Components import SimComponent
from SIMULTAN.Data.Assets import ResourceEntry
from SIMULTAN.Data.MultiValues import SimMultiValueCollection, SimMultiValue
from SIMULTAN.Serializer.SimGeo import SimGeoIOError
from SIMULTAN.Data.Taxonomy import SimTaxonomy
from SIMULTAN.Data.Users import SimUser
from SIMULTAN.Utils import IServicesProvider

class CreateProjectException(Exception):
    def __init__(self, reason: CreateProjectExceptionReason) -> None: ...
    @property
    def Data(self) -> IDictionary: ...
    @property
    def HelpLink(self) -> str: ...
    @HelpLink.setter
    def HelpLink(self, value: str) -> str: ...
    @property
    def HResult(self) -> int: ...
    @HResult.setter
    def HResult(self, value: int) -> int: ...
    @property
    def InnerException(self) -> Exception: ...
    @property
    def Message(self) -> str: ...
    @property
    def Reason(self) -> CreateProjectExceptionReason: ...
    @property
    def Source(self) -> str: ...
    @Source.setter
    def Source(self, value: str) -> str: ...
    @property
    def StackTrace(self) -> str: ...
    @property
    def TargetSite(self) -> MethodBase: ...


class CreateProjectExceptionReason(typing.SupportsInt):
    @typing.overload
    def __init__(self, value : int) -> None: ...
    @typing.overload
    def __init__(self, value : int, force_if_true: bool) -> None: ...
    def __int__(self) -> int: ...
    
    # Values:
    MissingMultiValuesFile : CreateProjectExceptionReason # 0
    MissingComponentFile : CreateProjectExceptionReason # 1


class ProjectExportImport(abc.ABC):
    @staticmethod
    def ExportComponentLibrary(_file: FileInfo, projectData: ExtendedProjectData, _components: IEnumerable_1[SimComponent]) -> None: ...
    @staticmethod
    def ExportGeometryWithRelations(file: FileInfo, projectData: ExtendedProjectData, geometryFiles: IEnumerable_1[ResourceEntry]) -> None: ...
    @staticmethod
    def ExportMultiValueLibrary(_file: FileInfo, _value_factory: SimMultiValueCollection, _values: IEnumerable_1[SimMultiValue]) -> None: ...
    @staticmethod
    def ImportComponentLibrary(_project: HierarchicalProject, _archive_file: FileInfo) -> SimComponent: ...
    @staticmethod
    def ImportGeometryWithRelations(_project: HierarchicalProject, _archive_file: FileInfo, _target_directory: DirectoryInfo, _nameCollisionFormat: str) -> List_1[SimGeoIOError]: ...
    @staticmethod
    def ImportMultiValueLibrary(_project: HierarchicalProject, _value_file: FileInfo) -> None: ...


class ProjectIO(abc.ABC):
    @staticmethod
    def CreateFromSeparateFiles(_project_file: FileInfo, _files_to_convert_to_project: IEnumerable_1[FileInfo], _non_managed_files: IEnumerable_1[FileInfo], _associated_files: IEnumerable_1[FileInfo], _project_data_manager: ExtendedProjectData, _encryption_key: Array_1[int]) -> CompactProject: ...
    @staticmethod
    def CreateMinimalProject(_project_file: FileInfo, _path_to_local_tmp_folder: str, _project_data_manager: ExtendedProjectData) -> CompactProject: ...
    @staticmethod
    def CreateMissingLinkFile(_project: HierarchicalProject) -> None: ...
    @staticmethod
    def ExportTaxonomyFile(file: FileInfo, taxonomies: IEnumerable_1[SimTaxonomy], projectData: ExtendedProjectData) -> None: ...
    @staticmethod
    def ImportTaxonomyFile(file: FileInfo, projectData: ExtendedProjectData) -> None: ...


class ZipProjectIO:
    def __init__(self) -> None: ...
    @classmethod
    @property
    def EncryptionKey(cls) -> Array_1[int]: ...
    @staticmethod
    def Close(_project: HierarchicalProject, _unloading_follows: bool) -> None: ...
    @staticmethod
    def Load(_project_file: FileInfo, _data_manager: ExtendedProjectData) -> HierarchicalProject: ...
    @staticmethod
    def NewProject(_project_file: FileInfo, _path_to_local_tmp_folder: str, _project_data_manager: ExtendedProjectData, initialUser: SimUser) -> HierarchicalProject: ...
    @staticmethod
    def OpenAfterAuthentication(_project: HierarchicalProject, _data_manager: ExtendedProjectData) -> None: ...
    @staticmethod
    def Save(_project: HierarchicalProject, _save_changes_only: bool) -> None: ...
    @staticmethod
    def SaveAs(_project: HierarchicalProject, _new_project_file: FileInfo) -> None: ...
    @staticmethod
    def Unload(_project: HierarchicalProject) -> bool: ...
    # Skipped AuthenticateUserAfterLoading due to it being static, abstract and generic.

    AuthenticateUserAfterLoading : AuthenticateUserAfterLoading_MethodGroup
    class AuthenticateUserAfterLoading_MethodGroup:
        @typing.overload
        def __call__(self, _project: HierarchicalProject, _data_manager: ExtendedProjectData, user: SimUser) -> SimUser:...
        @typing.overload
        def __call__(self, _project: HierarchicalProject, _data_manager: ExtendedProjectData, serviceProvider: IServicesProvider) -> bool:...


