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_FOLDER_EDITOR_VIEW_CONTROLLER_H
_ |
| 5 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_FOLDER_EDITOR_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 BookmarkFolderEditorViewController; |
| 12 |
| 13 namespace bookmarks { |
| 14 class BookmarkModel; |
| 15 class BookmarkNode; |
| 16 } // namespace bookmarks |
| 17 |
| 18 namespace ios { |
| 19 class ChromeBrowserState; |
| 20 } // namespace ios |
| 21 |
| 22 @protocol BookmarkFolderEditorViewControllerDelegate |
| 23 // Called when the controller successfully created or edited |folder|. |
| 24 - (void)bookmarkFolderEditor:(BookmarkFolderEditorViewController*)folderEditor |
| 25 didFinishEditingFolder:(const bookmarks::BookmarkNode*)folder; |
| 26 // Called when the user deletes the edited folder. |
| 27 // This is never called if the editor is created with |
| 28 // |folderCreatorWithBookmarkModel:parentFolder:|. |
| 29 - (void)bookmarkFolderEditorDidDeleteEditedFolder: |
| 30 (BookmarkFolderEditorViewController*)folderEditor; |
| 31 // Called when the user cancels the folder creation. |
| 32 - (void)bookmarkFolderEditorDidCancel: |
| 33 (BookmarkFolderEditorViewController*)folderEditor; |
| 34 @end |
| 35 |
| 36 // View controller for creating or editing a bookmark folder. Allows editing of |
| 37 // the title and selecting the parent folder of the bookmark. |
| 38 // This controller monitors the state of the bookmark model, so changes to the |
| 39 // bookmark model can affect this controller's state. |
| 40 @interface BookmarkFolderEditorViewController : CollectionViewController |
| 41 |
| 42 @property(nonatomic, assign) id<BookmarkFolderEditorViewControllerDelegate> |
| 43 delegate; |
| 44 |
| 45 // Designated factory methods. |
| 46 |
| 47 // Returns a view controller set to create a new folder in |parentFolder|. |
| 48 // If |parentFolder| is NULL, a default parent will be set. |
| 49 // |bookmarkModel| must not be NULL and must be loaded. |
| 50 + (instancetype) |
| 51 folderCreatorWithBookmarkModel:(bookmarks::BookmarkModel*)bookmarkModel |
| 52 parentFolder:(const bookmarks::BookmarkNode*)parentFolder; |
| 53 |
| 54 // |bookmarkModel| must not be null and must be loaded. |
| 55 // |folder| must not be NULL and be editable. |
| 56 // |browserState| must not be null. |
| 57 + (instancetype) |
| 58 folderEditorWithBookmarkModel:(bookmarks::BookmarkModel*)bookmarkModel |
| 59 folder:(const bookmarks::BookmarkNode*)folder |
| 60 browserState:(ios::ChromeBrowserState*)browserState; |
| 61 |
| 62 @end |
| 63 |
| 64 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_FOLDER_EDITOR_VIEW_CONTROLLE
R_H_ |
OLD | NEW |