OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
FileHandler.h
Go to the documentation of this file.
1#pragma once
2
3// OpenTwin header
10#include "OTGui/TableCfg.h"
12
14{
15public:
16 FileHandler() = default;
17 virtual ~FileHandler() = default;
18
19 FileHandler(const FileHandler& _other) = delete;
20 FileHandler(FileHandler&& _other) = delete;
21 FileHandler& operator=(const FileHandler& _other) = delete;
22 FileHandler& operator=(FileHandler&& _other) = delete;
23
24 void addButtons(ot::components::UiComponent* _uiComponent, const std::string& _pageName);
25
26protected:
27 virtual bool handleAction(const std::string& _action, ot::JsonDocument& _doc) override;
28
29private:
30 ot::MenuButtonDescription m_buttonFileImport;
31 ot::MenuButtonDescription m_buttonPythonImport;
32
33 ot::UIDList m_entityIDsTopo;
34 ot::UIDList m_entityVersionsTopo;
35 ot::UIDList m_entityIDsData;
36 ot::UIDList m_entityVersionsData;
37 std::list<bool> m_forceVisible;
38
39 void importFile(const std::string& _fileMask, const std::string& _dialogTitle, const std::string& _functionName);
41 void storeTextFile(ot::JsonDocument& _doc, const std::string& _folderName);
42 void addTextFilesToModel();
43 void clearBuffer();
44
45 void handleChangedText(ot::JsonDocument& _doc);
46 void handleChangedTable(ot::JsonDocument& _doc);
47 void storeChangedText(IVisualisationText* _entity, const std::string _text);
48 void storeChangedTable(IVisualisationTable* _entity ,ot::TableCfg& _cfg);
49 void NotifyOwnerAsync(ot::JsonDocument&& _doc, const std::string _owner);
52 void storeFileInDataBase(const std::string& _text, const std::string& _fileName, const std::string& _folderrName);
53};
Common methods for all central service handler classes.
Definition ActionAndFunctionHandler.h:10
Definition BusinessLogicHandler.h:16
ot::components::UiComponent * _uiComponent
Definition BusinessLogicHandler.h:31
Definition FileHandler.h:14
FileHandler & operator=(FileHandler &&_other)=delete
FileHandler & operator=(const FileHandler &_other)=delete
virtual bool handleAction(const std::string &_action, ot::JsonDocument &_doc) override
Definition FileHandler.cpp:30
virtual ~FileHandler()=default
FileHandler(FileHandler &&_other)=delete
FileHandler()=default
void addButtons(ot::components::UiComponent *_uiComponent, const std::string &_pageName)
Definition FileHandler.cpp:18
FileHandler(const FileHandler &_other)=delete
JSON document.
Definition JSON.h:276
Definition TableCfg.h:19
Definition UiComponent.h:31
std::list< UID > UIDList
Unique identifier list.
Definition CoreTypes.h:31