changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / graphic / Canvas.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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 #ifndef HERE_GRAPHIC_CANVAS_H
18 #define HERE_GRAPHIC_CANVAS_H
19
20 #include <cairo/cairo.h>
21 #include <vector>
22 #include "common/HereMaps_global.h"
23 #include "base/BaseObject.h"
24 #include "graphic/Color.h"
25 #include "graphic/BufferInfo.h"
26 #include "graphic/FloatPoint.h"
27
28 TIZEN_MAPS_BEGIN_NAMESPACE
29
30 class Canvas : public Object
31 {
32 public:
33         typedef enum
34         {
35                 LINESTYLE_SOLID,
36                 LINESTYLE_DOTTED,
37                 LINESTYLE_MAX,
38         } LineStyleType;
39
40         typedef std::vector<FloatPoint*> tPoint;
41         Canvas(void);
42         virtual ~Canvas(void);
43         result Construct(const BufferInfo& bufferInfo);
44         result FillPolygon(const Color& color, const tPoint& points);
45         result DrawPolyline(const tPoint& points);
46         result SetLineWidth(int width);
47         result SetLineStyle(LineStyleType lineStyle);
48         void SetForegroundColor(const Color& fgColor);
49 protected:
50         void* _pNativeGfxEngine;
51 private:
52         unsigned long __ComposeColor(unsigned long color32, int opacity);
53         void __SetColor(cairo_t* pCairo, unsigned long composedColor);
54         void __SetLineStyle(cairo_t* pCairo, LineStyleType lineStyle);
55
56         unsigned long* __pBuffer;
57         unsigned long __fgColor;
58         int __lineWidth;
59         cairo_operator_t __cairo_operator;
60         Color __fgColorNative;
61         int __fgOpacity;
62         LineStyleType __lineStyle;
63 };
64
65 TIZEN_MAPS_END_NAMESPACE
66
67 #endif /* HERE_GRAPHIC_CANVAS_H */