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
4 #include <aubo_caps/contribution/view_api_provider.h>
5 #include <aubo_caps/contribution/program/program_node_view.h>
6 #include <aubo_caps/contribution/program/program_creation_context.h>
7 #include <aubo_caps/contribution/program/program_api_provider.h>
8 #include <aubo_caps/contribution/program/program_contribution_configuration.h>
9 #include <aubo_caps/domain/data/data_model.h>
10
11 namespace arcs {
12 namespace aubo_scope {
13 ARCS_CLASS_FORWARD(ProgramNodeService);
14
15 /**
16 * Defines an API required for adding a new type of program node to AuboScope.
17 */
18 class ProgramNodeService
19 {
20 public:
21 virtual ~ProgramNodeService() = default;
22
23 /**
24 * Get the unique identifier for this kind of program node. The identifier
25 * will be used when storing programs that use the program node.
26 *
27 * @return the unique identifier.
28 */
29 virtual std::string getId() = 0;
30
31 /**
32 *
33 * @return The text displayed in the Structure Tab for program nodes created
34 * by this factory.
35 */
36 virtual std::string getTitle() = 0;
37
38 /**
39 *
40 * @return The text displayed in the Structure Tab for program nodes created
41 * by this factory.
42 */
43 virtual std::string getIcon() = 0;
44
45 /**
46 * configureContribution
47 * @param configuration
48 */
49 virtual void configureContribution(
50 ProgramContributionConfigurationPtr configuration) = 0;
51
52 /**
53 * Creates a new View instance which implements the UI for your program node
54 * screen. Called once when a new program is loaded or created.
55 *
56 * @param apiProvider Provides access to functionality and services
57 * available from within AuboScope related to user interface and end user
58 * interaction
59 * @return the view
60 */
61 virtual ProgramNodeViewPtr createView(ViewApiProviderPtr api_provider) = 0;
62
63 /**
64 *
65 * <p>
66 * Creates a new program node contribution instance.
67 * </p>
68 *
69 * <p>
70 * The returned node must use the supplied data model object to retrieve and
71 * store the data contained in it. All modifications to the supplied data
72 * model from the program node constructor are ignored when an existing
73 * program node is loaded or copy/pasted. Every change to the model object
74 * is registered as a separate undo/redo event in the program tree.
75 * </p>
76 *
77 * @param api the AuboCap API object with access to domain data
78 * @param model object where all configuration data of the new program node
79 * instance is to be stored in and retrieved from
80 * @return the newly constructed program node contribution instance
81 */
82 virtual ProgramNodeContributionPtr createNode(
83 ProgramApiProviderPtr api_provider, ProgramNodeViewPtr view,
84 DataModelPtr model, ProgramCreationContextPtr context) = 0;
85 };
86
87 } // namespace aubo_scope
88 } // namespace arcs
89
90 #endif // AUBO_SCOPE_PROGRAM_NODE_SERVICE_H
arcs::aubo_scope::ProgramNodeService
Defines an API required for adding a new type of program node to AuboScope.
Definition: program_node_service.h:19
arcs::aubo_scope::ProgramNodeService::getIcon
virtual std::string getIcon()=0
arcs::aubo_scope::ProgramNodeService::~ProgramNodeService
virtual ~ProgramNodeService()=default
arcs::aubo_scope::ProgramNodeService::getTitle
virtual std::string getTitle()=0
arcs::aubo_scope::ProgramNodeService::configureContribution
virtual void configureContribution(ProgramContributionConfigurationPtr configuration)=0
configureContribution
arcs::aubo_scope::ProgramNodeService::getId
virtual std::string getId()=0
Get the unique identifier for this kind of program node.
arcs::aubo_scope::ProgramNodeService::createView
virtual ProgramNodeViewPtr createView(ViewApiProviderPtr api_provider)=0
Creates a new View instance which implements the UI for your program node screen.
arcs::aubo_scope::ProgramNodeService::createNode
virtual ProgramNodeContributionPtr createNode(ProgramApiProviderPtr api_provider, ProgramNodeViewPtr view, DataModelPtr model, ProgramCreationContextPtr context)=0
data_model.h
arcs::aubo_scope::ARCS_CLASS_FORWARD
ARCS_CLASS_FORWARD(GripForceCapability)
arcs
Definition: contribution_provider.h:7
program_api_provider.h
program_contribution_configuration.h
program_creation_context.h
program_node_view.h
view_api_provider.h