NAP
portalitemdropdown.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Local Includes
8 #include "portalitem.h"
9 
10 // External Includes
11 #include <apievent.h>
12 #include <parameterdropdown.h>
13 
14 namespace nap
15 {
20  {
21  RTTI_ENABLE(PortalItem)
22 
23  public:
24 
30  bool init(utility::ErrorState& errorState) override;
31 
35  void onDestroy() override;
36 
43  virtual bool processUpdate(const APIEvent& event, utility::ErrorState& error) override;
44 
48  virtual APIEventPtr getDescriptor() const override;
49 
53  virtual APIEventPtr getValue() const override;
54 
55  // Properties
57  private:
61  Slot<int> mIndexChangedSlot = { this, &PortalItemDropDown::onIndexChanged };
62  void onIndexChanged(int newIndex);
63 
67  Slot<const std::vector<std::string>&> mItemsChangedSlot = { this, &PortalItemDropDown::onItemsChanged };
68  void onItemsChanged(const std::vector<std::string>& newItems);
69  };
70 }
nap::PortalItemDropDown::onDestroy
void onDestroy() override
nap::PortalItemDropDown::getDescriptor
virtual APIEventPtr getDescriptor() const override
nap::PortalItemDropDown::processUpdate
virtual bool processUpdate(const APIEvent &event, utility::ErrorState &error) override
nap::Slot< int >
nap::PortalItemDropDown::getValue
virtual APIEventPtr getValue() const override
nap::rtti::ObjectPtr
Definition: objectptr.h:154
nap::PortalItemDropDown::mParameter
ResourcePtr< ParameterDropDown > mParameter
Property: 'Parameter' the parameter linked to this portal item.
Definition: portalitemdropdown.h:56
nap::PortalItemDropDown::init
bool init(utility::ErrorState &errorState) override
nap::utility::ErrorState
Definition: errorstate.h:19
nap::PortalItemDropDown
Definition: portalitemdropdown.h:19
nap::PortalItem
Definition: portalitem.h:19
nap::APIEventPtr
std::unique_ptr< nap::APIEvent > APIEventPtr
Definition: apievent.h:179
nap
Definition: templateapp.h:17
nap::APIEvent
Definition: apievent.h:37