2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUi_UiManagerProxy.cpp
20 * @brief This is the implementation for the _UiManagerProxy class.
23 #include <FIo_IpcClient.h>
24 #include "FUi_UiManagerIpcMessages.h"
25 #include "FUi_UiManagerProxy.h"
28 using namespace Tizen::Io;
30 namespace Tizen { namespace Ui
33 _UiManagerProxy::_UiManagerProxy(void)
37 _UiManagerProxy::~_UiManagerProxy(void)
42 _UiManagerProxy::Construct(void)
44 unique_ptr<_IpcClient> pIpcClient(new (std::nothrow) _IpcClient());
45 SysTryReturnResult(NID_UI, pIpcClient, E_OUT_OF_MEMORY, "Memory is insufficient.");
47 result r = pIpcClient->Construct(L"osp.ui.ipcserver.uimanager");
48 SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "Propagating.");
50 __pIpcClient = move(pIpcClient);
56 _UiManagerProxy::SetZOrderGroup(unsigned int window, int windowZOrderGroup)
58 SysTryReturnResult(NID_UI, __pIpcClient, E_INVALID_STATE, "This has not been constructed as yet.");
61 unique_ptr<IPC::Message> pMsg(new (std::nothrow) UiManager_SetZOrderGroup(window, windowZOrderGroup, &r));
62 SysTryReturnResult(NID_UI, pMsg, E_OUT_OF_MEMORY, "Memory is insufficient.");
64 SysLog(NID_UI, "IPC message(0x%x, %d) is sent.", window, windowZOrderGroup);
65 result ret = __pIpcClient->SendRequest(*pMsg.get());
66 SysTryReturnResult(NID_UI, ret == E_SUCCESS, ret, "Propagating.");
67 SysTryReturnResult(NID_UI, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");