AuboStudio SDK  0.6.3
installation_node_service.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_INSTALLATION_SERVICE_H
2#define AUBO_SCOPE_INSTALLATION_SERVICE_H
3
4#include <string>
12
13namespace arcs {
14namespace aubo_scope {
16
17/**
18 * \chinese
19 * 安装节点服务
20 * 定义了在 AuboScope 中定义和添加安装节点及对应界面(用户界面基于 Qt)所需的 API。
21 * \endchinese
22 * \english
23 * InstallationNodeService
24 * Defines an API required for defining and adding to AuboScope an installation
25 * node and corresponding screen where the user interface is Qt-based.
26 * \endenglish
27 */
29{
30public:
31 virtual ~InstallationNodeService() = default;
32
33 /**
34 * \chinese
35 * @param locale AuboScope 的当前语言环境,可用于支持多种语言的标题
36 * @return 在安装标签页左侧导航中显示的文本以及对应安装节点画面的标题。
37 * 在启动时调用一次。
38 * \endchinese
39 * \english
40 * @param locale the current locale of AuboScope. Can be used for supporting
41 * titles in several languages.
42 * @return The text displayed for this installation contribution in the
43 * left-hand side navigation of the Installation Tab as well as the title of
44 * the corresponding installation node screen. Called once at start up.
45 * \endenglish
46 */
47 virtual std::string getTitle() = 0;
48
49 /**
50 * \chinese
51 * @return 此安装贡献显示的图标。在启动时调用一次。
52 * \endchinese
53 * \english
54 * @return The icon displayed for this installation contribution. Called once
55 * at start up.
56 * \endenglish
57 */
58 virtual std::string getIcon() = 0;
59
60 /**
61 * \chinese
62 * 此方法在服务注册后调用一次。修改 configuration 参数来配置您的贡献。
63 * 配置对象将已经具有匹配大多数用例的默认属性值。
64 * <p>
65 * ContributionConfiguration 对象的值将在方法调用后立即读取一次。
66 * 稍后更改值将不会产生任何效果,因此不要存储对配置对象的引用。
67 * </p>
68 * 如果默认值合适,请将此方法留空。
69 *
70 * @param configuration 具有默认值的可修改贡献配置
71 * \endchinese
72 * \english
73 * This method is called once after this service is registered. Modify the
74 * configuration parameter to configure your contribution. The configuration
75 * object will already have default values for its properties matching most
76 * use cases. <p> The values of the ContributionConfiguration object will be
77 * read once immediately after this method call. Changing values at a later
78 * stage will have no effect, so do not store a reference to the
79 * configuration object.
80 * </p>
81 * If the default values are appropriate, leave this method empty.
82 *
83 * @param configuration a modifiable ContributionConfiguration with default
84 * values
85 * \endenglish
86 */
88 InstallationContributionConfigurationPtr configuration) = 0;
89
90 /**
91 * \chinese
92 * 创建一个新的视图实例,实现安装节点画面的 UI。在加载或创建新安装时调用一次。
93 *
94 * @param api_provider 提供对 AuboScope 中与用户界面和终端用户交互相关的
95 * 功能和服务访问
96 * @return 视图
97 * \endchinese
98 * \english
99 * Creates a new View instance which implements the UI for your installation
100 * node screen. Called once when a new installation is loaded or created.
101 *
102 * @param api_provider Provides access to functionality and services
103 * available from within AuboScope related to user interface and end user
104 * interaction
105 * @return the view
106 * \endenglish
107 */
108 virtual InstallationNodeViewPtr createView(
109 ViewApiProviderPtr api_provider) = 0;
110
111 /**
112 * \chinese
113 * <p>创建一个新的安装节点实例。</p>
114 * <p>返回的节点必须使用提供的数据模型对象来检索和存储其中包含的数据。
115 * 加载现有安装时,将忽略安装节点构造函数对提供的数据模型所做的所有修改。
116 * 数据模型对象在同一 AuboCap 贡献的所有安装节点之间共享。</p>
117 *
118 * @param api_provider 提供对 AuboScope 中与安装节点相关的功能和服务访问
119 * @param view 由 createView 创建的视图
120 * @param model 新安装节点实例的所有配置数据存储和检索的数据模型对象
121 * @param context 创建此节点的上下文
122 * @return 新构建的安装节点贡献实例
123 * \endchinese
124 * \english
125 * <p>
126 * Creates a new installation node instance.
127 * </p>
128 * <p>
129 * The returned node must use the supplied data model object to retrieve and
130 * store the data contained in it. All modifications to the supplied data
131 * model from the installation node constructor are ignored when an existing
132 * installation is loaded. The data model object is shared between all
133 * installation nodes contributed by the same AuboCap.
134 * </p>
135 *
136 * @param api_provider Provides access to functionality and services
137 * available from within AuboScope relevant for the installation node
138 * @param view the View created by {@link #createView(ViewAPIProvider)}
139 * @param model object where all configuration data of the new installation
140 * node instance is to be stored in and retrieved from
141 * @param context the context in which this node is created
142 * @return the newly constructed installation node contribution instance
143 * \endenglish
144 */
145 virtual InstallationNodeContributionPtr createInstallationNode(
146 InstallationApiProviderPtr api_provider, InstallationNodeViewPtr view,
147 DataModelPtr model, InstallationCreationContextPtr context) = 0;
148};
149
150} // namespace aubo_scope
151} // namespace arcs
152
153#endif
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
\chinese 安装节点服务 定义了在 AuboScope 中定义和添加安装节点及对应界面(用户界面基于 Qt)所需的 API。 \endchinese \english InstallationNo...
virtual std::string getIcon()=0
\chinese
virtual InstallationNodeViewPtr createView(ViewApiProviderPtr api_provider)=0
\chinese 创建一个新的视图实例,实现安装节点画面的 UI。在加载或创建新安装时调用一次。
virtual InstallationNodeContributionPtr createInstallationNode(InstallationApiProviderPtr api_provider, InstallationNodeViewPtr view, DataModelPtr model, InstallationCreationContextPtr context)=0
\chinese
virtual std::string getTitle()=0
\chinese
virtual void configureContribution(InstallationContributionConfigurationPtr configuration)=0
\chinese 此方法在服务注册后调用一次。修改 configuration 参数来配置您的贡献。 配置对象将已经具有匹配大多数用例的默认属性值。