1 // Copyright (c) 2012 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.
5 #ifndef CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
6 #define CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
13 #include "base/compiler_specific.h"
14 #include "base/macros.h"
15 #include "base/strings/string16.h"
16 #include "content/common/clipboard_format.h"
17 #include "ui/base/clipboard/clipboard_types.h"
24 // Renderer interface to read/write from the clipboard over IPC.
25 class RendererClipboardDelegate
{
27 RendererClipboardDelegate();
29 uint64
GetSequenceNumber(ui::ClipboardType type
);
30 bool IsFormatAvailable(ClipboardFormat format
, ui::ClipboardType type
);
31 void Clear(ui::ClipboardType type
);
32 void ReadAvailableTypes(ui::ClipboardType type
,
33 std::vector
<base::string16
>* types
,
34 bool* contains_filenames
);
35 void ReadText(ui::ClipboardType type
, base::string16
* result
);
36 void ReadHTML(ui::ClipboardType type
,
37 base::string16
* markup
,
39 uint32
* fragment_start
,
40 uint32
* fragment_end
);
41 void ReadRTF(ui::ClipboardType type
, std::string
* result
);
42 void ReadImage(ui::ClipboardType type
, std::string
* data
);
43 void ReadCustomData(ui::ClipboardType clipboard_type
,
44 const base::string16
& type
,
45 base::string16
* data
);
47 void WriteText(ui::ClipboardType type
, const base::string16
& text
);
48 void WriteHTML(ui::ClipboardType type
,
49 const base::string16
& markup
,
51 void WriteSmartPasteMarker(ui::ClipboardType type
);
52 void WriteCustomData(ui::ClipboardType type
,
53 const std::map
<base::string16
, base::string16
>& data
);
54 void WriteBookmark(ui::ClipboardType type
,
56 const base::string16
& title
);
57 bool WriteImage(ui::ClipboardType type
, const SkBitmap
& bitmap
);
58 void CommitWrite(ui::ClipboardType type
);
61 DISALLOW_COPY_AND_ASSIGN(RendererClipboardDelegate
);
64 } // namespace content
66 #endif // CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_