Add readRtf feature with appropriate spec test. Docs updated as well.
This commit is contained in:
parent
acd5d40ab0
commit
252b12be13
3 changed files with 28 additions and 2 deletions
|
@ -93,6 +93,13 @@ void WriteText(const base::string16& text, mate::Arguments* args) {
|
|||
writer.WriteText(text);
|
||||
}
|
||||
|
||||
base::string16 ReadRtf(mate::Arguments* args) {
|
||||
std::string data;
|
||||
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
|
||||
clipboard->ReadRTF(GetClipboardType(args), &data);
|
||||
return base::UTF8ToUTF16(data);
|
||||
}
|
||||
|
||||
void WriteRtf(const std::string& text, mate::Arguments* args) {
|
||||
ui::ScopedClipboardWriter writer(GetClipboardType(args));
|
||||
writer.WriteRTF(text);
|
||||
|
@ -139,6 +146,7 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
|||
dict.SetMethod("write", &Write);
|
||||
dict.SetMethod("readText", &ReadText);
|
||||
dict.SetMethod("writeText", &WriteText);
|
||||
dict.SetMethod("readRtf", &ReadRtf);
|
||||
dict.SetMethod("writeRtf", &WriteRtf);
|
||||
dict.SetMethod("readHtml", &ReadHtml);
|
||||
dict.SetMethod("writeHtml", &WriteHtml);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue