Tizen 2.1 base
[framework/security/security-server.git] / ace_client / include / ace-client / ace_client.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file        ace_client.h
18  * @author      Tomasz Swierczek (t.swierczek@samsung.com)
19  * @version     1.0
20  * @brief       This file contains definitions of AceThinClient API
21  */
22 #ifndef WRT_ACE_CLIENT_H
23 #define WRT_ACE_CLIENT_H
24
25 #include <dpl/noncopyable.h>
26 #include <dpl/singleton.h>
27 #include <dpl/exception.h>
28 #include <ace-client/ace_client_types.h>
29
30 class WebRuntimeImpl;
31 class ResourceInformationImpl;
32 class OperationSystemImpl;
33
34 namespace AceClient {
35
36 class AceThinClientImpl;
37
38 class AceThinClient : private DPL::Noncopyable {
39   public:
40     class Exception
41     {
42       public:
43         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
44         DECLARE_EXCEPTION_TYPE(Base, AceThinClientException)
45     };
46
47     bool checkFunctionCall(const AceRequest& ace_request) const;
48     AcePreference getWidgetResourcePreference(
49             const AceResource& resource,
50             const AceWidgetHandle& handle) const;
51     AceResourcesPreferences* getGlobalResourcesPreferences() const;
52     bool isInitialized() const;
53
54   private:
55     AceThinClient();
56     virtual ~AceThinClient();
57
58     AceThinClientImpl* m_impl;
59     friend class DPL::Singleton<AceThinClient>;
60     WebRuntimeImpl* m_wrt;
61     ResourceInformationImpl* m_res;
62     OperationSystemImpl* m_sys;
63 };
64
65 typedef DPL::Singleton<AceThinClient> AceThinClientSingleton;
66
67 } // namespace AceClient
68
69 #endif // WRT_ACE_CLIENT_H