#pragma once

namespace xtr::doc {
class SelectableDoc;
class RSFormDoc;
class RSModelDoc;
class RSFacade;
class OSSDoc;
} // namespace xtr::doc

namespace xtr::view { class OSSLayout; } // namespace xtr::view

//! Namespace to extract task logic from ui, dialog and view
namespace xtr::proc {

void ImportCstDataFromExcel(ccl::semantic::RSModel& model, EntityUID target);
void ExportCstGraph(const ccl::semantic::RSCore& source, CString path);
void ExportSchema(const ccl::semantic::RSForm& schema, CString path);
void ExportModelSchema(const ccl::semantic::RSModel& model, CString path);
void ExportModel(const doc::RSModelDoc& document);
void EraseCstData(ccl::semantic::RSModel& model, EntityUID target);
void ExportCstDataToExcel(const ccl::semantic::RSModel& model, EntityUID target);
void ExportOSS(const doc::OSSDoc& document);
void ExportOSSGraph(const doc::OSSDoc& document, view::OSSLayout& layout);

void EditConstituenta(doc::RSFacade& editor, EntityUID target);
void EditComment(doc::RSFacade& editor);
void ResetNames(doc::RSFacade& editor);
void RenameCst(doc::RSFacade& editor);
void Term2Function(doc::RSFacade& editor);
void Function2Term(doc::RSFacade& editor);
void Structure2Terms(doc::RSFacade& editor);
void MoveCstBefore(doc::RSFacade& editor, const SetOfEntities& what, ccl::semantic::ListIterator pos);

void StandaloneEquation(doc::RSFormDoc& document);
void ResetClaims(doc::RSFormDoc& document);
void EraseSelected(doc::RSFormDoc& document);

void EraseSelected(doc::RSModelDoc& document);
void CalculateSelected(doc::RSModelDoc& document);
void CalculateAll(doc::RSModelDoc& document);

void DoAction(doc::OSSDoc& document);
void EditSelectedOperation(doc::OSSDoc& document);
void EditSelectedHyperlink(doc::OSSDoc& document);
void EditActiveFilename(doc::OSSDoc& document);
void EditOSSFilename(doc::OSSDoc& document);
void EditComment(doc::OSSDoc& document);
void OpenSelectedSource(doc::OSSDoc& document);
void EraseSelected(doc::OSSDoc& document);
void DiscardSelectedSource(doc::OSSDoc& document);
void RunSelectedOperation(doc::OSSDoc& document);
void AttachSourceToSelected(doc::OSSDoc& document);
void RerunAllOperations(doc::OSSDoc& document);
void BackupOSS(const doc::OSSDoc& document);

void StandaloneSynthes(ccl::ops::Type type);
void SpawnModelDocument(const ccl::semantic::RSForm& schema);
void SpawnSchemaDocument(const ccl::semantic::RSModel& model);
void ExecuteRelation(const ccl::semantic::RSForm& schema, EntityUID target);

void FollowHyperlink(CString address, CString subaddress);

} // namespace xtr::proc