Xcos MVC: properly clone model objects to access sub-diagrams
[scilab.git] / scilab / modules / scicos / src / cpp / view_scilab / BlockAdapter.hxx
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2014-2014 - Scilab Enterprises - Clement DAVID
4  *
5  *  This file must be used under the terms of the CeCILL.
6  *  This source file is licensed as described in the file COPYING, which
7  *  you should have received as part of this distribution.  The terms
8  *  are also available at
9  *  http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10  *
11  */
12
13 #ifndef BLOCKADAPTER_HXX_
14 #define BLOCKADAPTER_HXX_
15
16 #include <string>
17 #include <memory>
18
19 #include "utilities.hxx"
20 #include "BaseAdapter.hxx"
21 #include "DiagramAdapter.hxx"
22 #include "model/Block.hxx"
23
24 namespace org_scilab_modules_scicos
25 {
26 namespace view_scilab
27 {
28
29 class BlockAdapter : public BaseAdapter<BlockAdapter, org_scilab_modules_scicos::model::Block>
30 {
31 public:
32     BlockAdapter(std::shared_ptr<org_scilab_modules_scicos::model::Block> adaptee);
33     BlockAdapter(const BlockAdapter& adapter);
34     ~BlockAdapter();
35
36     static const std::wstring getSharedTypeStr()
37     {
38         return L"Block";
39     }
40
41     std::wstring getTypeStr();
42     std::wstring getShortTypeStr();
43
44     DiagramAdapter* getDiagram() const;
45     void setDiagram(DiagramAdapter* newDiagram);
46
47     types::InternalType* getDocContent() const;
48     void setDocContent(types::InternalType* v);
49
50 private:
51     DiagramAdapter* diagramAdapter;
52
53     types::InternalType* doc_content;
54 };
55
56 } /* namespace view_scilab */
57 } /* namespace org_scilab_modules_scicos */
58
59 #endif /* BLOCKADAPTER_HXX_ */