AuboCaps  0.6.0
program_node_service.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_PROGRAM_NODE_SERVICE_H
2 #define AUBO_SCOPE_PROGRAM_NODE_SERVICE_H
3 
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  */
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
virtual std::string getIcon()=0
ARCS_CLASS_FORWARD(GripForceCapability)
Defines an API required for adding a new type of program node to AuboScope.
virtual std::string getTitle()=0
virtual ProgramNodeViewPtr createView(ViewApiProviderPtr api_provider)=0
Creates a new View instance which implements the UI for your program node screen. ...
virtual std::string getId()=0
Get the unique identifier for this kind of program node.
virtual ProgramNodeContributionPtr createNode(ProgramApiProviderPtr api_provider, ProgramNodeViewPtr view, DataModelPtr model, ProgramCreationContextPtr context)=0
virtual void configureContribution(ProgramContributionConfigurationPtr configuration)=0
configureContribution