本文整理汇总了C++中webcore::Frame::editor方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::editor方法的具体用法?C++ Frame::editor怎么用?C++ Frame::editor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::Frame
的用法示例。
在下文中一共展示了Frame::editor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findString
bool DumpRenderTreeSupportQt::findString(QWebPageAdapter *adapter, const QString& string, const QStringList& optionArray)
{
// 1. Parse the options from the array
WebCore::FindOptions options = 0;
const int optionCount = optionArray.size();
for (int i = 0; i < optionCount; ++i) {
const QString& option = optionArray.at(i);
if (option == QLatin1String("CaseInsensitive"))
options |= WebCore::CaseInsensitive;
else if (option == QLatin1String("AtWordStarts"))
options |= WebCore::AtWordStarts;
else if (option == QLatin1String("TreatMedialCapitalAsWordStart"))
options |= WebCore::TreatMedialCapitalAsWordStart;
else if (option == QLatin1String("Backwards"))
options |= WebCore::Backwards;
else if (option == QLatin1String("WrapAround"))
options |= WebCore::WrapAround;
else if (option == QLatin1String("StartInSelection"))
options |= WebCore::StartInSelection;
}
// 2. find the string
WebCore::Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
return frame && frame->editor()->findString(string, options);
}
示例2: handleSendEditingCapabilities
void BWebPage::handleSendEditingCapabilities(BMessage*)
{
bool canCut = false;
bool canCopy = false;
bool canPaste = false;
WebCore::Frame* frame = fPage->focusController()->focusedOrMainFrame();
if (frame && frame->editor()) {
WebCore::Editor* editor = frame->editor();
canCut = editor->canCut() || editor->canDHTMLCut();
canCopy = editor->canCopy() || editor->canDHTMLCopy();
canPaste = editor->canPaste() || editor->canDHTMLPaste();
}
BMessage message(B_EDITING_CAPABILITIES_RESULT);
message.AddBool("can cut", canCut);
message.AddBool("can copy", canCopy);
message.AddBool("can paste", canPaste);
dispatchMessage(message);
}
示例3: firstRectForCharacterRange
QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPageAdapter *adapter, int location, int length)
{
WebCore::Frame* frame = adapter->page->focusController()->focusedOrMainFrame();
QVariantList rect;
if ((location + length < location) && (location + length))
length = 0;
RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
if (!range)
return QVariantList();
QRect resultRect = frame->editor()->firstRectForRange(range.get());
rect << resultRect.x() << resultRect.y() << resultRect.width() << resultRect.height();
return rect;
}
示例4: webkit_web_view_button_release_event
static gboolean webkit_web_view_button_release_event(GtkWidget* widget, GdkEventButton* event)
{
//WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
////WebKitWebViewPrivate* priv = webView->priv;
WebCore::Frame* focusedFrame = core(webView_s)->focusController()->focusedFrame();
if (focusedFrame && focusedFrame->editor()->canEdit()) {
GdkWindow* window = gtk_widget_get_parent_window(widget);
gtk_im_context_set_client_window(imContext, window);
#ifdef MAEMO_CHANGES
hildon_gtk_im_context_filter_event(imContext, (GdkEvent*)event);
hildon_gtk_im_context_show(imContext);
#endif
}
return focusedFrame->eventHandler()->handleMouseReleaseEvent(PlatformMouseEvent(event));
}
示例5: firstRectForCharacterRange
WebCore::IntRect DumpRenderTreeSupportEfl::firstRectForCharacterRange(Evas_Object* ewkView, int location, int length)
{
DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, WebCore::IntRect());
if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
return WebCore::IntRect();
if ((location + length < location) && (location + length))
length = 0;
WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
RefPtr<WebCore::Range> range = WebCore::TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
if (!range)
return WebCore::IntRect();
return frame->editor().firstRectForRange(range.get());
}
示例6: firstRectForCharacterRange
WebCore::IntRect DumpRenderTreeSupportEfl::firstRectForCharacterRange(Evas_Object* ewkView, int location, int length)
{
WebCore::Page* page = EWKPrivate::corePage(ewkView);
if (!page || !page->focusController() || !page->focusController()->focusedOrMainFrame() || !page->focusController()->focusedOrMainFrame()->editor())
return WebCore::IntRect();
if ((location + length < location) && (location + length))
length = 0;
WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
WebCore::Editor* editor = frame->editor();
RefPtr<WebCore::Range> range = WebCore::TextIterator::rangeFromLocationAndLength(frame->selection()->rootEditableElementOrDocumentElement(), location, length);
if (!range)
return WebCore::IntRect();
return editor->firstRectForRange(range.get());
}
示例7: webkit_web_view_real_paste_clipboard
static void webkit_web_view_real_paste_clipboard(WebKitWebView*)
{
WebCore::Frame* frame = core(webView_s)->focusController()->focusedOrMainFrame();
frame->editor()->command("Paste").execute();
}
示例8: webkit_web_view_real_select_all
static void webkit_web_view_real_select_all(WebKitWebView*)
{
WebCore::Frame* frame = core(webView_s)->focusController()->focusedOrMainFrame();
frame->editor()->command("SelectAll").execute();
}