1// Copyright (c) 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.
4
5#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
6#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
7
8#include "chrome/browser/bookmarks/bookmark_node_data.h"
9
10#if defined(__OBJC__)
11@class NSString;
12#endif  // __OBJC__
13
14namespace base {
15class FilePath;
16}
17
18// This set of functions lets C++ code interact with the cocoa pasteboard
19// and dragging methods.
20namespace bookmark_pasteboard_helper_mac {
21
22enum PasteboardType {
23  kCopyPastePasteboard,
24  kDragPasteboard
25};
26
27// Writes a set of bookmark elements from a profile to the specified pasteboard.
28void WriteToPasteboard(PasteboardType type,
29                       const std::vector<BookmarkNodeData::Element>& elements,
30                       const base::FilePath& profile_path);
31
32// Reads a set of bookmark elements from the specified pasteboard.
33bool ReadFromPasteboard(PasteboardType type,
34                        std::vector<BookmarkNodeData::Element>& elements,
35                        base::FilePath* profile_path);
36
37// Returns true if the specified pasteboard contains any sort of
38// bookmark elements.  It currently does not consider a plaintext url a
39// valid bookmark.
40bool PasteboardContainsBookmarks(PasteboardType type);
41
42}  // namespace bookmark_pasteboard_helper_mac
43
44#if defined(__OBJC__)
45// Pasteboard type for dictionary containing bookmark structure consisting
46// of individual bookmark nodes and/or bookmark folders.
47extern "C" NSString* const kBookmarkDictionaryListPboardType;
48#endif  // __OBJC__
49
50#endif  // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
51