[Tizen] Add DALi Autofill implementation
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / windows / platform-implement-win.h
1 #ifndef PLATFORM_IMPLEMENT_WIN_INCLUDE\r
2 #define PLATFORM_IMPLEMENT_WIN_INCLUDE\r
3 \r
4 /*\r
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
6 *\r
7 * Licensed under the Apache License, Version 2.0 (the "License");\r
8 * you may not use this file except in compliance with the License.\r
9 * You may obtain a copy of the License at\r
10 *\r
11 * http://www.apache.org/licenses/LICENSE-2.0\r
12 *\r
13 * Unless required by applicable law or agreed to in writing, software\r
14 * distributed under the License is distributed on an "AS IS" BASIS,\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 * See the License for the specific language governing permissions and\r
17 * limitations under the License.\r
18 *\r
19 */\r
20 \r
21 // EXTERNAL_HEADERS\r
22 #include <stdint.h>\r
23 #include <string>\r
24 #include <dali/public-api/signals/callback.h>\r
25 \r
26 typedef uintptr_t  WinWindowHandle;\r
27 typedef uint64_t   WinPixmap;\r
28 \r
29 namespace Dali\r
30 {\r
31 \r
32 namespace Internal\r
33 {\r
34 \r
35 namespace Adaptor\r
36 {\r
37 \r
38 namespace WindowsPlatform\r
39 {\r
40 \r
41 bool PostWinThreadMessage(\r
42     _In_ uint32_t Msg,\r
43     _In_ uint64_t wParam,\r
44     _In_ uint64_t lParam,\r
45     _In_ uint64_t threadID = -1 );\r
46 \r
47 using timerCallback = bool(*)(void *data);\r
48 \r
49 intptr_t SetTimer(int interval, timerCallback callback, void *data);\r
50 \r
51 void KillTimer(intptr_t id);\r
52 \r
53 std::string GetKeyName( int keyCode );\r
54 \r
55 uint64_t GetCurrentThreadId();\r
56 \r
57 void GetNanoseconds( uint64_t& timeInNanoseconds );\r
58 \r
59 unsigned int GetCurrentMilliSeconds( void );\r
60 \r
61 class WindowImpl\r
62 {\r
63 public:\r
64   static const uint32_t STYLE;\r
65   static const int32_t EDGE_WIDTH;\r
66   static const int32_t EDGE_HEIGHT;\r
67 \r
68   WindowImpl();\r
69 \r
70   virtual ~WindowImpl();\r
71 \r
72   static void ProcWinMessage( uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam );\r
73 \r
74   static uint64_t CreateHwnd(\r
75     _In_opt_ const char *lpWindowName,\r
76     _In_ int X,\r
77     _In_ int Y,\r
78     _In_ int nWidth,\r
79     _In_ int nHeight,\r
80     _In_opt_ uint64_t parent );\r
81 \r
82   static void DestroyHWnd(uint64_t hWnd);\r
83 \r
84   void GetDPI( float &xDpi, float &yDpi );\r
85 \r
86   int GetColorDepth();\r
87 \r
88   void SetListener( CallbackBase *callback );\r
89 \r
90   bool PostWinMessage(\r
91     _In_ uint32_t Msg,\r
92     _In_ uint64_t wParam,\r
93     _In_ uint64_t lParam );\r
94 \r
95   void SetHWND(uint64_t inHWnd);\r
96   void SetWinProc();\r
97 \r
98 protected:\r
99 \r
100 private:\r
101   int colorDepth;\r
102   uint64_t mHWnd; // no ownership, managed outside\r
103   uint64_t mHdc;\r
104 \r
105   CallbackBase *listener;\r
106 };\r
107 \r
108 } // namespace WindowsPlatformImplement\r
109 \r
110 } // namespace Adaptor\r
111 \r
112 } // namespace internal\r
113 \r
114 } // namespace Dali\r
115 \r
116 #endif // WIN32_WINDOWS_SYSTEM_INCLUDE\r