AppView  0.8.1
C++ AppView API
app_view_2d.hpp
Go to the documentation of this file.
1 // Copyright 2008-2023 by Rightware. All rights reserved.
2 
3 #ifndef APP_VIEW_2D_HPP
4 #define APP_VIEW_2D_HPP
5 
6 #include <kanzi/core.ui/node/node2d.hpp>
7 #include <app_view.hpp>
8 
9 namespace kanzi
10 {
11 
12 namespace plugin
13 {
14 
15 namespace appview
16 {
17 
18 class AppView2D;
19 using AppView2DSharedPtr = shared_ptr<AppView2D>;
20 
22 class APP_VIEW_PLUGIN_API AppView2D : public AppViewConceptImpl<Node2D, AppView2D>
23 {
24 public:
26 
27  static AppView2DSharedPtr create(Domain* domain, string_view name);
28 
29  KZ_METACLASS_BEGIN(AppView2D, ConceptClass, "Kanzi.AppView2D")
30  KZ_METACLASS_END()
31 
32  void onStartApp(const StartAppMessageArguments& messageArguments)
33  {
34  ConceptClass::handleStartAppMessage(messageArguments);
35  }
36 
37  void onFinishApp(FinishAppMessageArguments& messageArguments)
38  {
39  ConceptClass::handleFinishAppMessage(messageArguments);
40  }
41 
42  void onNavigateBack(const NavigateBackMessageArguments& messageArguments)
43  {
44  ConceptClass::handleNavigateBackMessage(messageArguments);
45  }
46 
48  {
49  ConceptClass::handleUpdateVirtualDisplayMessage(messageArguments);
50  }
51 
52 protected:
53  explicit AppView2D(Domain* domain, string_view name);
54 
55  void onAttached() override;
56 
57  Vector2 measureOverride(Vector2 /*availableSize*/) override;
58 
59  void updateRenderOverride() override;
60 
61  void setupMaterialOverride() override;
62 
64  void onNodePropertyChanged(AbstractPropertyType propertyType, PropertyNotificationReason reason) override;
65 
66  bool calculateHitUV(
67  const TouchPoint& touchPoint,
68  Vector2& outHitUV) override;
69 
71  void onAppViewTextureChanged() override;
72 
73  static PropertyTypeEditorInfoSharedPtr makeEditorInfo();
74 
75 private:
77  ClassPropertyDefaultValue<Node::ContentStretch> m_contentStretchDefaultValue;
78 
80  bool m_contentTextureUpdateRequired = true;
81 };
82 
83 }
84 
85 }
86 
87 }
88 
89 #endif
App View. Starts and renders a 3rd party application.
Definition: app_view_2d.hpp:22
void onUpdateVirtualDisplay(const UpdateVirtualDisplayMessageArguments &messageArguments)
Definition: app_view_2d.hpp:47
Definition: app_view.hpp:11
void onNavigateBack(const NavigateBackMessageArguments &messageArguments)
Definition: app_view_2d.hpp:42
shared_ptr< AppView2D > AppView2DSharedPtr
Definition: app_view_2d.hpp:19
Definition: app_view.hpp:141
void onFinishApp(FinishAppMessageArguments &messageArguments)
Definition: app_view_2d.hpp:37