OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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. |
| 4 #ifndef IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_EDIT_VIEW_CONTROLLER_H_ |
| 5 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_EDIT_VIEW_CONTROLLER_H_ |
| 6 |
| 7 #import <UIKit/UIKit.h> |
| 8 |
| 9 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 10 |
| 11 @class BookmarkEditViewController; |
| 12 @class BookmarkFolderViewController; |
| 13 |
| 14 namespace bookmarks { |
| 15 class BookmarkNode; |
| 16 } // namespace bookmarks |
| 17 |
| 18 namespace ios { |
| 19 class ChromeBrowserState; |
| 20 } // namespace ios |
| 21 |
| 22 @protocol BookmarkEditViewControllerDelegate |
| 23 |
| 24 // Called when the edited bookmark is set for deletion. |
| 25 // If the delegate returns |YES|, all nodes matching the URL of |bookmark| will |
| 26 // be deleted. |
| 27 // If the delegate returns |NO|, only |bookmark| will be deleted. |
| 28 // If the delegate doesn't implement this method, the default behavior is to |
| 29 // delete all nodes matching the URL of |bookmark|. |
| 30 - (BOOL)bookmarkEditor:(BookmarkEditViewController*)controller |
| 31 shoudDeleteAllOccurencesOfBookmark:(const bookmarks::BookmarkNode*)bookmark; |
| 32 |
| 33 // Called when the controller should be dismissed. |
| 34 - (void)bookmarkEditorWantsDismissal:(BookmarkEditViewController*)controller; |
| 35 |
| 36 @end |
| 37 |
| 38 // View controller for editing bookmarks. Allows editing of the title, URL and |
| 39 // the parent folder of the bookmark. |
| 40 // |
| 41 // This view controller will also monitor bookmark model change events and react |
| 42 // accordingly depending on whether the bookmark and folder it is editing |
| 43 // changes underneath it. |
| 44 @interface BookmarkEditViewController : CollectionViewController |
| 45 |
| 46 @property(nonatomic, assign) id<BookmarkEditViewControllerDelegate> delegate; |
| 47 |
| 48 // Designated initializer. |
| 49 // |bookmark|: mustn't be NULL at initialization time. It also mustn't be a |
| 50 // folder. |
| 51 - (instancetype)initWithBookmark:(const bookmarks::BookmarkNode*)bookmark |
| 52 browserState:(ios::ChromeBrowserState*)browserState |
| 53 NS_DESIGNATED_INITIALIZER; |
| 54 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 55 NS_UNAVAILABLE; |
| 56 |
| 57 // Closes the edit view as if close button was pressed. |
| 58 - (void)dismiss; |
| 59 |
| 60 @end |
| 61 |
| 62 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_EDIT_VIEW_CONTROLLER_H_ |
OLD | NEW |