2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <adaptors/devel-api/adaptor-framework/application-devel.h>
20 #include <adaptors/devel-api/adaptor-framework/window-devel.h>
21 #include <adaptors/common/application-impl.h>
26 namespace DevelApplication
29 Application New( int* argc, char **argv[], const std::string& stylesheet, Application::WINDOW_MODE windowMode, PositionSize positionSize )
31 Internal::Adaptor::ApplicationPtr internal = Internal::Adaptor::Application::GetPreInitializedApplication();
34 if( argc && ( *argc > 0 ) )
36 internal->GetWindow().SetClass( (*argv)[0], "" );
38 internal->SetStyleSheet( stylesheet );
40 DevelWindow::SetTransparency( internal->GetWindow(), ( windowMode == Application::OPAQUE ? false : true ) );
41 DevelWindow::SetSize( internal->GetWindow(), DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
42 DevelWindow::SetPosition( internal->GetWindow(), DevelWindow::WindowPosition( positionSize.x, positionSize.y ) );
44 return Application( internal.Get() );
48 internal = Internal::Adaptor::Application::New( argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL );
49 return Application( internal.Get() );
53 void PreInitialize( int* argc, char** argv[] )
55 Internal::Adaptor::Application::PreInitialize( argc, argv );
58 std::string GetRegion( Application application )
60 return Internal::Adaptor::GetImplementation( application ).GetRegion();
63 std::string GetLanguage( Application application )
65 return Internal::Adaptor::GetImplementation( application ).GetLanguage();
68 LowBatterySignalType& LowBatterySignal( Application application )
70 return Internal::Adaptor::GetImplementation( application ).LowBatterySignal();
73 LowMemorySignalType& LowMemorySignal( Application application )
75 return Internal::Adaptor::GetImplementation( application ).LowMemorySignal();
78 } // namespace DevelApplication