2984fd0038a6c81eeb7c64b620db442525b3f3aa
[framework/web/wrt-plugins-common.git] / src / modules / tizen / Widget / Widget.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  *
18  *
19  * @file       Widget.h
20  * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
21  * @version    0.1
22  * @brief
23  */
24
25 #ifndef PLATFORM_WIDGET_CONFIGURATION_H_
26 #define PLATFORM_WIDGET_CONFIGURATION_H_
27
28 #include <string>
29
30 #include <Commons/WrtWrapper/IWrtWrapper.h>
31
32 #include <Widget/IWidget.h>
33 #include <WidgetDB/IWidgetDB.h>
34 #include "Property.h"
35
36 namespace WrtDeviceApis {
37 namespace Widget {
38
39 class Widget : public Api::IWidget
40 {
41   public:
42
43     explicit Widget(Commons::IWrtWrapperPtr wrtWrapper);
44
45     virtual std::string getAuthor() const;
46     virtual std::string getAuthorEmail() const;
47     virtual std::string getAuthorHref() const;
48     virtual std::string getDescription() const;
49     virtual std::string getId() const;
50     virtual std::string getName() const;
51     virtual std::string getShortName() const;
52     virtual std::string getVersion() const;
53     virtual unsigned int getHeight() const;
54     virtual unsigned int getWidth() const;
55
56   protected:
57
58     Commons::IWrtWrapperPtr m_wrtWrapper;
59
60     mutable StringProperty m_author;
61     mutable StringProperty m_authorEmail;
62     mutable StringProperty m_authorHref;
63     mutable StringProperty m_description;
64     mutable StringProperty m_id;
65     mutable StringProperty m_name;
66     mutable StringProperty m_shortName;
67     mutable StringProperty m_version;
68     mutable UIntProperty m_height;
69     mutable UIntProperty m_width;
70
71   private:
72
73     std::string getProperty(WidgetDB::Api::ConfigAttribute) const;
74
75     void checkWrapperPointer() const;
76 };
77
78 }
79 }
80
81 #endif