VPTissue Reference Manual
IFile.h
Go to the documentation of this file.
1 #ifndef WS_IFILE_H_INCLUDED
2 #define WS_IFILE_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "MergedPreferences.h"
23 #include "session/ISession.h"
24 
25 #include <memory>
26 #include <string>
27 
28 class QAction;
29 
30 namespace SimShell {
31 namespace Ws {
32 
40 class IFile
41 {
42 public:
47  using ConstructorType = std::function<std::shared_ptr<IFile>(const std::string&, const std::string&)>;
48 
49 public:
51  virtual ~IFile() {}
52 
54  virtual std::shared_ptr<Session::ISession>
56  std::shared_ptr<SimShell::Ws::IProject> proj,
57  std::shared_ptr<SimShell::Ws::IWorkspace> ws) const = 0;
58 
60  virtual std::vector<QAction*> GetContextMenuActions() const = 0;
61 
63  virtual const std::string& GetPath() const = 0;
64 };
65 
66 } // namespace
67 } // namespace
68 
69 #endif // end_of_inclde_guard
virtual std::shared_ptr< Session::ISession > CreateSession(std::shared_ptr< SimShell::Ws::IProject > proj, std::shared_ptr< SimShell::Ws::IWorkspace > ws) const =0
Create simulation entities from file.
virtual std::vector< QAction * > GetContextMenuActions() const =0
Get Qt actions that can be triggered on this type of file.
std::function< std::shared_ptr< IFile >(const std::string &, const std::string &)> ConstructorType
First argument: filename.
Definition: IFile.h:47
Interface for ISession.
virtual const std::string & GetPath() const =0
Get file path.
Interface for MergedPreferences.
Interface for files in a project in a workspace.
Definition: IFile.h:40
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
virtual ~IFile()
Virtual destructor.
Definition: IFile.h:51