📄 htmlediting.cpp
字号:
}NodeImpl *InsertNodeBeforeCommand::refChild() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->refChild();}//------------------------------------------------------------------------------------------// InsertTextCommandInsertTextCommand::InsertTextCommand(DocumentImpl *document, TextImpl *node, long offset, const DOMString &text) : EditCommand(new InsertTextCommandImpl(document, node, offset, text)){}InsertTextCommand::~InsertTextCommand(){}InsertTextCommandImpl *InsertTextCommand::impl() const{ return static_cast<InsertTextCommandImpl *>(get());}TextImpl *InsertTextCommand::node() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->node();}long InsertTextCommand::offset() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->offset();}DOMString InsertTextCommand::text() const{ IF_IMPL_NULL_RETURN_ARG(DOMString()); return impl()->text();}//------------------------------------------------------------------------------------------// JoinTextNodesCommandJoinTextNodesCommand::JoinTextNodesCommand(DocumentImpl *document, TextImpl *text1, TextImpl *text2) : EditCommand(new JoinTextNodesCommandImpl(document, text1, text2)){}JoinTextNodesCommand::~JoinTextNodesCommand(){}JoinTextNodesCommandImpl *JoinTextNodesCommand::impl() const{ return static_cast<JoinTextNodesCommandImpl *>(get());}TextImpl *JoinTextNodesCommand::firstNode() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->firstNode();}TextImpl *JoinTextNodesCommand::secondNode() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->secondNode();}//------------------------------------------------------------------------------------------// ReplaceSelectionCommandReplaceSelectionCommand::ReplaceSelectionCommand(DocumentImpl *document, DOM::DocumentFragmentImpl *fragment, bool selectReplacement) : CompositeEditCommand(new ReplaceSelectionCommandImpl(document, fragment, selectReplacement)){}ReplaceSelectionCommand::~ReplaceSelectionCommand() {}ReplaceSelectionCommandImpl *ReplaceSelectionCommand::impl() const{ return static_cast<ReplaceSelectionCommandImpl *>(get());}//------------------------------------------------------------------------------------------// MoveSelectionCommandMoveSelectionCommand::MoveSelectionCommand(DocumentImpl *document, DOM::DocumentFragmentImpl *fragment, DOM::Position &position) : CompositeEditCommand(new MoveSelectionCommandImpl(document, fragment, position)){}MoveSelectionCommand::~MoveSelectionCommand() {}MoveSelectionCommandImpl *MoveSelectionCommand::impl() const{ return static_cast<MoveSelectionCommandImpl *>(get());}//------------------------------------------------------------------------------------------// RemoveCSSPropertyCommandRemoveCSSPropertyCommand::RemoveCSSPropertyCommand(DocumentImpl *document, CSSStyleDeclarationImpl *decl, int property) : EditCommand(new RemoveCSSPropertyCommandImpl(document, decl, property)){}RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand(){}RemoveCSSPropertyCommandImpl *RemoveCSSPropertyCommand::impl() const{ return static_cast<RemoveCSSPropertyCommandImpl *>(get());}CSSStyleDeclarationImpl *RemoveCSSPropertyCommand::styleDeclaration() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->styleDeclaration();}int RemoveCSSPropertyCommand::property() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->property();}//------------------------------------------------------------------------------------------// RemoveNodeAttributeCommandRemoveNodeAttributeCommand::RemoveNodeAttributeCommand(DocumentImpl *document, ElementImpl *element, NodeImpl::Id attribute) : EditCommand(new RemoveNodeAttributeCommandImpl(document, element, attribute)){}RemoveNodeAttributeCommand::~RemoveNodeAttributeCommand(){}RemoveNodeAttributeCommandImpl *RemoveNodeAttributeCommand::impl() const{ return static_cast<RemoveNodeAttributeCommandImpl *>(get());}ElementImpl *RemoveNodeAttributeCommand::element() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->element();}NodeImpl::Id RemoveNodeAttributeCommand::attribute() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->attribute();}//------------------------------------------------------------------------------------------// RemoveNodeCommandRemoveNodeCommand::RemoveNodeCommand(DocumentImpl *document, NodeImpl *node) : EditCommand(new RemoveNodeCommandImpl(document, node)){}RemoveNodeCommand::~RemoveNodeCommand(){}RemoveNodeCommandImpl *RemoveNodeCommand::impl() const{ return static_cast<RemoveNodeCommandImpl *>(get());}NodeImpl *RemoveNodeCommand::node() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->node();}//------------------------------------------------------------------------------------------// RemoveNodeAndPruneCommandRemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand(DocumentImpl *document, NodeImpl *pruneNode, NodeImpl *stopNode) : CompositeEditCommand(new RemoveNodeAndPruneCommandImpl(document, pruneNode, stopNode)){}RemoveNodeAndPruneCommand::~RemoveNodeAndPruneCommand(){}RemoveNodeAndPruneCommandImpl *RemoveNodeAndPruneCommand::impl() const{ return static_cast<RemoveNodeAndPruneCommandImpl *>(get());}NodeImpl *RemoveNodeAndPruneCommand::pruneNode() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->pruneNode();}NodeImpl *RemoveNodeAndPruneCommand::stopNode() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->stopNode();}//------------------------------------------------------------------------------------------// RemoveNodePreservingChildrenCommandRemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand(DocumentImpl *document, NodeImpl *node) : CompositeEditCommand(new RemoveNodePreservingChildrenCommandImpl(document, node)){}RemoveNodePreservingChildrenCommand::~RemoveNodePreservingChildrenCommand(){}RemoveNodePreservingChildrenCommandImpl *RemoveNodePreservingChildrenCommand::impl() const{ return static_cast<RemoveNodePreservingChildrenCommandImpl *>(get());}NodeImpl *RemoveNodePreservingChildrenCommand::node() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->node();}//------------------------------------------------------------------------------------------// SetNodeAttributeCommandSetNodeAttributeCommand::SetNodeAttributeCommand(DocumentImpl *document, ElementImpl *element, NodeImpl::Id attribute, const DOM::DOMString &value) : EditCommand(new SetNodeAttributeCommandImpl(document, element, attribute, value)){}SetNodeAttributeCommand::~SetNodeAttributeCommand(){}SetNodeAttributeCommandImpl *SetNodeAttributeCommand::impl() const{ return static_cast<SetNodeAttributeCommandImpl *>(get());}ElementImpl *SetNodeAttributeCommand::element() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->element();}NodeImpl::Id SetNodeAttributeCommand::attribute() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->attribute();}DOMString SetNodeAttributeCommand::value() const{ IF_IMPL_NULL_RETURN_ARG(""); return impl()->value();}//------------------------------------------------------------------------------------------// SplitTextNodeCommandSplitTextNodeCommand::SplitTextNodeCommand(DocumentImpl *document, TextImpl *text, long offset) : EditCommand(new SplitTextNodeCommandImpl(document, text, offset)){}SplitTextNodeCommand::~SplitTextNodeCommand(){}SplitTextNodeCommandImpl *SplitTextNodeCommand::impl() const{ return static_cast<SplitTextNodeCommandImpl *>(get());}TextImpl *SplitTextNodeCommand::node() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->node();}long SplitTextNodeCommand::offset() const{ IF_IMPL_NULL_RETURN_ARG(0); return impl()->offset();}//------------------------------------------------------------------------------------------// TypingCommandTypingCommand::TypingCommand(DocumentImpl *document) : CompositeEditCommand(new TypingCommandImpl(document)){}TypingCommand::~TypingCommand() {}TypingCommandImpl *TypingCommand::impl() const{ return static_cast<TypingCommandImpl *>(get());}void TypingCommand::insertText(DocumentImpl *document, const DOMString &text){ ASSERT(document); KHTMLPart *part = document->part(); ASSERT(part); EditCommand lastEditCommand = part->lastEditCommand(); if (isOpenForMoreTypingCommand(lastEditCommand)) { static_cast<TypingCommand &>(lastEditCommand).insertText(text); } else { TypingCommand typingCommand(document); typingCommand.apply(); static_cast<TypingCommand &>(typingCommand).insertText(text); }}void TypingCommand::insertNewline(DocumentImpl *document){ ASSERT(document); KHTMLPart *part = document->part(); ASSERT(part); EditCommand lastEditCommand = part->lastEditCommand(); if (isOpenForMoreTypingCommand(lastEditCommand)) { static_cast<TypingCommand &>(lastEditCommand).insertNewline(); } else { TypingCommand typingCommand(document); typingCommand.apply(); static_cast<TypingCommand &>(typingCommand).insertNewline(); }}void TypingCommand::deleteKeyPressed(DocumentImpl *document){ ASSERT(document); KHTMLPart *part = document->part(); ASSERT(part); EditCommand lastEditCommand = part->lastEditCommand(); if (isOpenForMoreTypingCommand(lastEditCommand)) { static_cast<TypingCommand &>(lastEditCommand).deleteKeyPressed(); } else { TypingCommand typingCommand(document); typingCommand.apply(); static_cast<TypingCommand &>(typingCommand).deleteKeyPressed(); }}bool TypingCommand::isOpenForMoreTypingCommand(const EditCommand &cmd){ return cmd.commandID() == TypingCommandID && static_cast<const TypingCommand &>(cmd).openForMoreTyping();}void TypingCommand::closeTyping(EditCommand cmd){ if (isOpenForMoreTypingCommand(cmd)) static_cast<TypingCommand &>(cmd).closeTyping();}void TypingCommand::closeTyping(){ IF_IMPL_NULL_RETURN; return impl()->closeTyping();}bool TypingCommand::openForMoreTyping() const{ IF_IMPL_NULL_RETURN_ARG(false); return impl()->openForMoreTyping();}void TypingCommand::insertText(const DOMString &text){ IF_IMPL_NULL_RETURN; return impl()->insertText(text);}void TypingCommand::insertNewline(){ IF_IMPL_NULL_RETURN; return impl()->insertNewline();}void TypingCommand::deleteKeyPressed(){ IF_IMPL_NULL_RETURN; return impl()->deleteKeyPressed();}} // namespace khtml
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -