384c22b1baf77a4ffb54d2b6a197e2c42b8f04e8
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-test-application.h
1 #ifndef __DALI_TOOLKIT_TEST_APPLICATION_H__
2 #define __DALI_TOOLKIT_TEST_APPLICATION_H__
3
4 /*
5  * Copyright (c) 2014 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 // INTERNAL INCLUDES
22 #include <dali-test-suite-utils.h>
23 #include <dali/devel-api/text-abstraction/font-client.h>
24
25 namespace Dali
26 {
27
28 /**
29  * Adds some functionality on top of TestApplication that is required by the Toolkit.
30  */
31 class ToolkitTestApplication : public TestApplication
32 {
33 public:
34
35   ToolkitTestApplication( size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
36                           size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
37                           float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
38                           float  verticalDpi   = DEFAULT_VERTICAL_DPI )
39   : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
40   {
41     Initialize();
42
43     // set the DPI value for font rendering
44     Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
45     if( fontClient )
46     {
47       fontClient.SetDpi( mDpi.x, mDpi.y );
48     }
49   }
50
51   ~ToolkitTestApplication()
52   {
53     // Need to delete core before we delete the adaptor.
54     delete mCore;
55     mCore = NULL;
56   }
57
58   //ToolkitOrientation& GetOrientation()
59   //{
60   //return mOrientation;
61   //}
62
63 private:
64   //ToolkitOrientation mOrientation;
65 };
66
67 } // namespace Dali
68
69 #endif // __DALI_TOOLKIT_TEST_APPLICATION_H__