blob: 99e5c31528504fb49c31c0970e83db501e9d7038 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h"
@class BookmarkFolderEditorViewController;
class Browser;
namespace bookmarks {
class BookmarkModel;
class BookmarkNode;
} // namespace bookmarks
@protocol BookmarkFolderEditorViewControllerDelegate
// Called when the controller successfully created or edited |folder|.
- (void)bookmarkFolderEditor:(BookmarkFolderEditorViewController*)folderEditor
didFinishEditingFolder:(const bookmarks::BookmarkNode*)folder;
// Called when the user deletes the edited folder.
// This is never called if the editor is created with
// |folderCreatorWithBookmarkModel:parentFolder:|.
- (void)bookmarkFolderEditorDidDeleteEditedFolder:
// Called when the user cancels the folder creation.
- (void)bookmarkFolderEditorDidCancel:
// Called when the controller is going to commit the title change.
- (void)bookmarkFolderEditorWillCommitTitleChange:
// View controller for creating or editing a bookmark folder. Allows editing of
// the title and selecting the parent folder of the bookmark.
// This controller monitors the state of the bookmark model, so changes to the
// bookmark model can affect this controller's state.
@interface BookmarkFolderEditorViewController
: ChromeTableViewController <UIAdaptivePresentationControllerDelegate>
@property(nonatomic, weak) id<BookmarkFolderEditorViewControllerDelegate>
// Designated factory methods.
// Returns a view controller set to create a new folder in |parentFolder|.
// If |parentFolder| is NULL, a default parent will be set.
// |bookmarkModel| must not be NULL and must be loaded.
+ (instancetype)
parentFolder:(const bookmarks::BookmarkNode*)parentFolder
// |bookmarkModel| must not be null and must be loaded.
// |folder| must not be NULL and be editable.
// |browser| must not be null.
+ (instancetype)
folder:(const bookmarks::BookmarkNode*)folder
- (instancetype)initWithStyle:(UITableViewStyle)style NS_UNAVAILABLE;