Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / FUi_UiManagerProxy.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19  * @file         FUi_UiManagerProxy.cpp
20  * @brief       This is the implementation for the _UiManagerProxy class.
21  */
22
23 #include <FIo_IpcClient.h>
24 #include "FUi_UiManagerIpcMessages.h"
25 #include "FUi_UiManagerProxy.h"
26
27 using namespace std;
28 using namespace Tizen::Io;
29
30 namespace Tizen { namespace Ui
31 {
32
33 _UiManagerProxy::_UiManagerProxy(void)
34 {
35 }
36
37 _UiManagerProxy::~_UiManagerProxy(void)
38 {
39 }
40
41 result
42 _UiManagerProxy::Construct(void)
43 {
44         unique_ptr<_IpcClient> pIpcClient(new (std::nothrow) _IpcClient());
45         SysTryReturnResult(NID_UI, pIpcClient, E_OUT_OF_MEMORY, "Memory is insufficient.");
46
47         result r = pIpcClient->Construct(L"osp.ui.ipcserver.uimanager");
48         SysTryReturnResult(NID_UI, r == E_SUCCESS, r, "Propagating.");
49
50         __pIpcClient = move(pIpcClient);
51
52         return E_SUCCESS;
53 }
54
55 result
56 _UiManagerProxy::SetZOrderGroup(unsigned int window, int windowZOrderGroup)
57 {
58         SysTryReturnResult(NID_UI, __pIpcClient, E_INVALID_STATE, "This has not been constructed as yet.");
59
60         result r = E_SUCCESS;
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.");
63
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.");
68
69         return E_SUCCESS;
70 }
71
72 }} // Tizen::Ui