#ifndef IOS_WEB_PUBLIC_ANNOTATIONS_ANNOTATIONS_TEXT_MANAGER_H_
#define IOS_WEB_PUBLIC_ANNOTATIONS_ANNOTATIONS_TEXT_MANAGER_H_
#import <UIKit/UIKit.h>
#import "base/observer_list.h"
#import "base/values.h"
#import "ios/web/public/web_state_observer.h"
#import "ios/web/public/web_state_user_data.h"
@protocol CRWWebViewHandlerDelegate;
namespace web {
class AnnotationsTextObserver;
class WebState;
* Class in charge of annotations in text.
*/
class AnnotationsTextManager : public WebStateUserData<AnnotationsTextManager> {
public:
static void CreateForWebState(WebState* web_state);
static ContentWorld GetFeatureContentWorld();
AnnotationsTextManager() = default;
AnnotationsTextManager(const AnnotationsTextManager&) = delete;
AnnotationsTextManager& operator=(const AnnotationsTextManager&) = delete;
virtual void AddObserver(AnnotationsTextObserver* observer) = 0;
virtual void RemoveObserver(AnnotationsTextObserver* observer) = 0;
virtual void DecorateAnnotations(WebState* web_state,
base::Value& annotations,
int seq_id) = 0;
virtual void RemoveDecorations() = 0;
virtual void RemoveDecorationsWithType(const std::string& type) = 0;
virtual void RemoveHighlight() = 0;
virtual void SetSupportedTypes(NSTextCheckingType supported_types) = 0;
protected:
~AnnotationsTextManager() override = default;
};
}
#endif