1 // Copyright 2011 The Chromium Authors. 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 IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_IN_PAGE_MODEL_H_
6 #define IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_IN_PAGE_MODEL_H_
8 #import <UIKit/UIKit.h>
9 #include "base/mac/scoped_nsobject.h"
11 // This is a simplified version of find_tab_helper.cc.
12 @interface FindInPageModel
: NSObject
{
14 // Should find in page be displayed.
16 // The current search string.
17 base::scoped_nsobject
<NSString
> text_
;
18 // The number of matches for |text_|
20 // The currently higlighted index.
21 NSUInteger currentIndex_
;
22 // The content offset needed to display the |currentIndex_| match.
23 CGPoint currentPoint_
;
26 @
property(nonatomic
, readwrite
, assign
) BOOL enabled
;
27 @
property(nonatomic
, readonly
) NSString
* text
;
28 @
property(nonatomic
, readonly
) NSUInteger matches
;
29 @
property(nonatomic
, readonly
) NSUInteger currentIndex
;
30 @
property(nonatomic
, readonly
) CGPoint currentPoint
;
32 // Update the query string and the number of matches.
33 - (void)updateQuery
:(NSString
*)query matches
:(NSUInteger
)matches
;
34 // Update the current match index and its found position.
35 - (void)updateIndex
:(NSInteger
)index atPoint
:(CGPoint
)point
;
39 #endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_IN_PAGE_MODEL_H_