Merge "Add Text Preedit Style" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-window.h
1 #ifndef TOOLKIT_WINDOW_H
2 #define TOOLKIT_WINDOW_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 //EXTERNAL INCLUDES
22 #include <string>
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>
27
28 namespace Dali
29 {
30
31 class Actor;
32 class Layer;
33 struct KeyEvent;
34 class TouchData;
35 struct WheelEvent;
36
37 typedef Dali::Rect<int> PositionSize;
38
39 namespace Internal
40 {
41 namespace Adaptor
42 {
43 class Window;
44 }
45 }
46
47 class Window;
48 typedef Signal< void (Window,bool) > FocusChangeSignalType;
49
50 class Window : public BaseHandle
51 {
52 public:
53
54   static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
55   static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
56
57   Window();
58   ~Window();
59   Window(const Window& handle);
60   Window& operator=(const Window& rhs);
61
62   Integration::Scene GetScene();
63   Integration::RenderSurface& GetRenderSurface();
64   void Add( Dali::Actor actor );
65   void Remove( Dali::Actor actor );
66   Dali::Layer GetRootLayer() const;
67   void SetBackgroundColor( const Vector4& color );
68   Vector4 GetBackgroundColor() const;
69   void Raise();
70   void Hide();
71   FocusChangeSignalType& FocusChangeSignal();
72
73 public:
74   explicit Window( Internal::Adaptor::Window* window );
75 };
76
77 Internal::Adaptor::Window& GetImplementation(Dali::Window& window);
78 const Internal::Adaptor::Window& GetImplementation(const Dali::Window& window);
79
80 namespace DevelWindow
81 {
82 typedef Signal< void () > EventProcessingFinishedSignalType;
83 typedef Signal< void (const KeyEvent&) > KeyEventSignalType;
84 typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;
85 typedef Signal< void (const TouchData&) > TouchSignalType;
86 typedef Signal< void (const WheelEvent&) > WheelEventSignalType;
87 typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType;
88
89 Dali::Window Get( Actor actor );
90 Dali::Window DownCast(  BaseHandle handle );
91
92 EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
93 KeyEventSignalType& KeyEventSignal( Dali::Window window );
94 KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Window window );
95 TouchSignalType& TouchSignal( Dali::Window window );
96 WheelEventSignalType& WheelEventSignal( Window window );
97 VisibilityChangedSignalType& VisibilityChangedSignal( Window window );
98 }
99
100 } // namespace Dali
101
102 #endif // TOOLKIT_WINDOW_H