Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/cpp/iedriver/ElementRepository.h
2867 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
17
#ifndef WEBDRIVER_IE_ELEMENTREPOSITORY_H_
18
#define WEBDRIVER_IE_ELEMENTREPOSITORY_H_
19
20
#include <unordered_map>
21
22
#include "CustomTypes.h"
23
#include "DocumentHost.h"
24
25
namespace webdriver {
26
27
class ElementRepository {
28
public:
29
ElementRepository(void);
30
virtual ~ElementRepository(void);
31
int GetManagedElement(const std::string& element_id,
32
ElementHandle* element_wrapper) const;
33
bool AddManagedElement(BrowserHandle current_browser,
34
IHTMLElement* element,
35
ElementHandle* element_wrapper);
36
bool AddManagedElement(ElementHandle element_wrapper);
37
void RemoveManagedElement(const std::string& element_id);
38
void ListManagedElements(void);
39
void ClearCache(void);
40
void Clear(void);
41
private:
42
bool IsElementManaged(IHTMLElement* element, ElementHandle* element_wrapper);
43
typedef std::unordered_map<std::string, ElementHandle> ElementMap;
44
ElementMap managed_elements_;
45
};
46
47
} // namespace webdriver
48
49
#endif // WEBDRIVER_IE_ELEMENTREPOSITORY_H_
50
51