1 #ifndef TOOLKIT_WINDOW_H
2 #define TOOLKIT_WINDOW_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
23 #include <dali/public-api/math/rect.h>
24 #include <dali/public-api/object/base-handle.h>
25 #include <dali/public-api/signals/dali-signal.h>
26 #include <dali/integration-api/scene.h>
33 class RenderSurfaceInterface;
38 typedef Dali::Rect<int> PositionSize;
49 typedef Signal< void (Window,bool) > FocusChangeSignalType;
51 class Window : public BaseHandle
54 using KeyEventSignalType = Signal< void (const KeyEvent&) >;
55 using TouchSignalType = Signal< void (const TouchData&) >;
57 static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
58 static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
62 Window(const Window& handle);
63 Window& operator=(const Window& rhs);
65 Integration::Scene GetScene();
66 Dali::RenderSurfaceInterface& GetRenderSurface();
67 void Add( Dali::Actor actor );
68 void Remove( Dali::Actor actor );
69 Dali::Layer GetRootLayer() const;
70 void SetBackgroundColor( const Vector4& color );
71 Vector4 GetBackgroundColor() const;
74 FocusChangeSignalType& FocusChangeSignal();
75 KeyEventSignalType& KeyEventSignal();
76 TouchSignalType& TouchSignal();
79 explicit Window( Internal::Adaptor::Window* window );
82 Internal::Adaptor::Window& GetImplementation(Dali::Window& window);
83 const Internal::Adaptor::Window& GetImplementation(const Dali::Window& window);
87 typedef Signal< void () > EventProcessingFinishedSignalType;
88 typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;
89 typedef Signal< void (const WheelEvent&) > WheelEventSignalType;
90 typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType;
92 Dali::Window Get( Actor actor );
93 Dali::Window DownCast( BaseHandle handle );
95 EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
96 KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Window window );
97 WheelEventSignalType& WheelEventSignal( Window window );
98 VisibilityChangedSignalType& VisibilityChangedSignal( Window window );
103 #endif // TOOLKIT_WINDOW_H