AuboStudio SDK  0.6.3
program_node_service.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_PROGRAM_NODE_SERVICE_H
2#define AUBO_SCOPE_PROGRAM_NODE_SERVICE_H
3
10
11namespace arcs {
12namespace aubo_scope {
14
15/**
16 * \chinese
17 * 程序节点服务
18 * 定义了向 AuboScope 添加新类型程序节点所需的 API。
19 * \endchinese
20 * \english
21 * ProgramNodeService
22 * Defines an API required for adding a new type of program node to AuboScope.
23 * \endenglish
24 */
26{
27public:
28 virtual ~ProgramNodeService() = default;
29
30 /**
31 * \chinese
32 * 获取此类程序节点的唯一标识符。该标识符将在存储使用此程序节点的程序时使用。
33 *
34 * @return 唯一标识符
35 * \endchinese
36 * \english
37 * Get the unique identifier for this kind of program node. The identifier
38 * will be used when storing programs that use the program node.
39 *
40 * @return the unique identifier.
41 * \endenglish
42 */
43 virtual std::string getId() = 0;
44
45 /**
46 * \chinese
47 * @return 通过此工厂创建的程序节点在结构标签页中显示的文本
48 * \endchinese
49 * \english
50 * @return The text displayed in the Structure Tab for program nodes created
51 * by this factory.
52 * \endenglish
53 */
54 virtual std::string getTitle() = 0;
55
56 /**
57 * \chinese
58 * @return 通过此工厂创建的程序节点显示的图标
59 * \endchinese
60 * \english
61 * @return The icon displayed for program nodes created by this factory.
62 * \endenglish
63 */
64 virtual std::string getIcon() = 0;
65
66 /**
67 * \chinese
68 * 配置贡献,设置程序节点的属性和行为。
69 * @param configuration 贡献配置对象
70 * \endchinese
71 * \english
72 * configureContribution
73 * @param configuration
74 * \endenglish
75 */
77 ProgramContributionConfigurationPtr configuration) = 0;
78
79 /**
80 * \chinese
81 * 创建一个新的视图实例,实现程序节点画面的 UI。在加载或创建新程序时调用一次。
82 *
83 * @param api_provider 提供对 AuboScope 中与用户界面和终端用户交互相关的
84 * 功能和服务访问
85 * @return 视图
86 * \endchinese
87 * \english
88 * Creates a new View instance which implements the UI for your program node
89 * screen. Called once when a new program is loaded or created.
90 *
91 * @param api_provider Provides access to functionality and services
92 * available from within AuboScope related to user interface and end user
93 * interaction
94 * @return the view
95 * \endenglish
96 */
97 virtual ProgramNodeViewPtr createView(ViewApiProviderPtr api_provider) = 0;
98
99 /**
100 * \chinese
101 * <p>
102 * 创建一个新的程序节点贡献实例。
103 * </p>
104 *
105 * <p>
106 * 返回的节点必须使用提供的数据模型对象来检索和存储其中包含的数据。
107 * 加载或复制/粘贴现有程序节点时,将忽略程序节点构造函数对提供的数据模型
108 * 所做的所有修改。对模型对象的每次更改都将在程序树中注册为一个单独的
109 * 撤销/重做事件。
110 * </p>
111 *
112 * @param api_provider 提供对 AuboScope 中可用的域数据相关功能的访问
113 * @param view 程序节点视图
114 * @param model 新程序节点实例的所有配置数据存储和检索的数据模型对象
115 * @param context 创建上下文
116 * @return 新构建的程序节点贡献实例
117 * \endchinese
118 * \english
119 * <p>
120 * Creates a new program node contribution instance.
121 * </p>
122 *
123 * <p>
124 * The returned node must use the supplied data model object to retrieve and
125 * store the data contained in it. All modifications to the supplied data
126 * model from the program node constructor are ignored when an existing
127 * program node is loaded or copy/pasted. Every change to the model object
128 * is registered as a separate undo/redo event in the program tree.
129 * </p>
130 *
131 * @param api_provider the AuboCap API object with access to domain data
132 * @param view the View created by createView
133 * @param model object where all configuration data of the new program node
134 * instance is to be stored in and retrieved from
135 * @param context the creation context
136 * @return the newly constructed program node contribution instance
137 * \endenglish
138 */
139 virtual ProgramNodeContributionPtr createNode(
140 ProgramApiProviderPtr api_provider, ProgramNodeViewPtr view,
141 DataModelPtr model, ProgramCreationContextPtr context) = 0;
142};
143
144} // namespace aubo_scope
145} // namespace arcs
146
147#endif // AUBO_SCOPE_PROGRAM_NODE_SERVICE_H
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
\chinese 程序节点服务 定义了向 AuboScope 添加新类型程序节点所需的 API。 \endchinese \english ProgramNodeService Defines an A...
virtual std::string getIcon()=0
\chinese
virtual std::string getTitle()=0
\chinese
virtual void configureContribution(ProgramContributionConfigurationPtr configuration)=0
\chinese 配置贡献,设置程序节点的属性和行为。
virtual std::string getId()=0
\chinese 获取此类程序节点的唯一标识符。该标识符将在存储使用此程序节点的程序时使用。
virtual ProgramNodeViewPtr createView(ViewApiProviderPtr api_provider)=0
\chinese 创建一个新的视图实例,实现程序节点画面的 UI。在加载或创建新程序时调用一次。
virtual ProgramNodeContributionPtr createNode(ProgramApiProviderPtr api_provider, ProgramNodeViewPtr view, DataModelPtr model, ProgramCreationContextPtr context)=0
\chinese