blob: 4556e0b7d8977ac5007bfd4da19d3d091a6ab7eb [file] [log] [blame]
// Copyright (c) 2010 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 <Cocoa/Cocoa.h>
#import "chrome/browser/ui/cocoa/applescript/element_applescript.h"
namespace bookmarks {
class BookmarkModel;
class BookmarkNode;
// Contains all the elements that are common to both a bookmark folder and
// bookmark item.
@interface BookmarkNodeAppleScript : ElementAppleScript {
const bookmarks::BookmarkNode* bookmarkNode_; // weak.
// Contains the temporary title when a scripter creates a new folder/item with
// title specified like
// |make new bookmark folder with properties {title:"foo"}|.
NSString* tempTitle_;
// Does not actually create a folder/item but just sets its ID, the folder is
// created in insertInBookmarksFolder: in the corresponding bookmarks folder.
- (id)init;
// Does not make a folder/item but instead uses an existing one.
- (id)initWithBookmarkNode:(const bookmarks::BookmarkNode*)aBookmarkNode;
// Assigns a node, sets its unique ID and also copies temporary values.
- (void)setBookmarkNode:(const bookmarks::BookmarkNode*)aBookmarkNode;
// Get and Set title.
- (NSString*)title;
- (void)setTitle:(NSString*)aTitle;
// Returns the index with respect to its parent bookmark folder.
- (NSNumber*)index;
// Returns the bookmark model of the browser, returns NULL if there is an error.
- (bookmarks::BookmarkModel*)bookmarkModel;