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.
5 #ifndef ewk_hit_test_private_h
6 #define ewk_hit_test_private_h
13 #include "common/hit_test_params.h"
14 #include "public/ewk_hit_test_internal.h"
15 #include "third_party/skia/include/core/SkBitmap.h"
17 typedef std::map<std::string, std::string> NodeAttributesMap;
21 explicit _Ewk_Hit_Test(const Hit_Test_Params& params);
24 Ewk_Hit_Test_Result_Context GetResultContext() const;
26 const char* GetLinkUri() const;
27 const char* GetLinkTitle() const;
28 const char* GetLinkLabel() const;
30 const char* GetImageUri() const;
31 const char* GetImageFilenameExtension() const;
32 void* GetImageBuffer() const;
33 size_t GetImageBufferLength() const;
35 const char* GetNodeTagName() const;
36 const char* GetNodeValue() const;
37 Eina_Hash* GetNodeAttributeHash() const;
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;
48 // store node attributes in a map
49 const class Hit_Test_Node_Data {
51 explicit Hit_Test_Node_Data(const Hit_Test_Params::Node_Data& data);
52 ~Hit_Test_Node_Data();
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
59 DISALLOW_COPY_AND_ASSIGN(Hit_Test_Node_Data);
62 // when hit node is image we need to store image buffer and filename extension
63 const class Hit_Test_Image_Buffer {
65 explicit Hit_Test_Image_Buffer(const Hit_Test_Params::Image_Data& data);
67 const std::string fileNameExtension; // image filename extension for hit element
68 SkBitmap imageBitmap; // image pixels data
71 DISALLOW_COPY_AND_ASSIGN(Hit_Test_Image_Buffer);
74 DISALLOW_COPY_AND_ASSIGN(_Ewk_Hit_Test);
78 #endif // ewk_hit_test_private_h