[M67 Dev][EWK] Classify EWK APIs by public, internal, or product
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / private / ewk_hit_test_private.h
1 // Copyright 2014 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ewk_hit_test_private_h
6 #define ewk_hit_test_private_h
7
8 #include <map>
9 #include <string>
10
11 #include <Eina.h>
12
13 #include "common/hit_test_params.h"
14 #include "public/ewk_hit_test_internal.h"
15 #include "third_party/skia/include/core/SkBitmap.h"
16
17 typedef std::map<std::string, std::string> NodeAttributesMap;
18
19 class _Ewk_Hit_Test {
20  public:
21   explicit _Ewk_Hit_Test(const Hit_Test_Params& params);
22   ~_Ewk_Hit_Test();
23
24   Ewk_Hit_Test_Result_Context GetResultContext() const;
25
26   const char* GetLinkUri() const;
27   const char* GetLinkTitle() const;
28   const char* GetLinkLabel() const;
29
30   const char* GetImageUri() const;
31   const char* GetImageFilenameExtension() const;
32   void*       GetImageBuffer() const;
33   size_t      GetImageBufferLength() const;
34
35   const char* GetNodeTagName() const;
36   const char* GetNodeValue() const;
37   Eina_Hash*  GetNodeAttributeHash() const;
38
39  private:
40   const Ewk_Hit_Test_Result_Context context;
41   const std::string linkURI;
42   const std::string linkTitle; // the title of link
43   const std::string linkLabel; // the text of the link
44   const std::string imageURI;
45   const bool isEditable;
46   const Ewk_Hit_Test_Mode mode;
47
48   // store node attributes in a map
49   const class Hit_Test_Node_Data {
50    public:
51     explicit Hit_Test_Node_Data(const Hit_Test_Params::Node_Data& data);
52     ~Hit_Test_Node_Data();
53
54     const std::string tagName;      // tag name for hit element
55     const std::string nodeValue;    // node value for hit element
56     Eina_Hash* attributeHash; // attribute data for hit element
57
58    private:
59     DISALLOW_COPY_AND_ASSIGN(Hit_Test_Node_Data);
60   } nodeData;
61
62   // when hit node is image we need to store image buffer and filename extension
63   const class Hit_Test_Image_Buffer {
64    public:
65     explicit Hit_Test_Image_Buffer(const Hit_Test_Params::Image_Data& data);
66
67     const std::string fileNameExtension; // image filename extension for hit element
68     SkBitmap imageBitmap;          // image pixels data
69
70    private:
71     DISALLOW_COPY_AND_ASSIGN(Hit_Test_Image_Buffer);
72   } imageData;
73
74   DISALLOW_COPY_AND_ASSIGN(_Ewk_Hit_Test);
75 };
76
77
78 #endif // ewk_hit_test_private_h