本文整理汇总了C++中nsCOMPtr::GetCurrentNode方法的典型用法代码示例。如果您正苦于以下问题:C++ nsCOMPtr::GetCurrentNode方法的具体用法?C++ nsCOMPtr::GetCurrentNode怎么用?C++ nsCOMPtr::GetCurrentNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsCOMPtr
的用法示例。
在下文中一共展示了nsCOMPtr::GetCurrentNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
nsINode*
nsFindContentIterator::GetCurrentNode()
{
if (mInnerIterator && !mInnerIterator->IsDone()) {
return mInnerIterator->GetCurrentNode();
}
return mOuterIterator->GetCurrentNode();
}
示例2: formControl
void
nsFindContentIterator::MaybeSetupInnerIterator()
{
mInnerIterator = nsnull;
nsCOMPtr<nsIContent> content =
do_QueryInterface(mOuterIterator->GetCurrentNode());
if (!content || !content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL))
return;
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(content));
if (!formControl->IsTextControl(true)) {
return;
}
SetupInnerIterator(content);
if (mInnerIterator) {
if (!mFindBackward) {
mInnerIterator->First();
// finish setup: position mOuterIterator on the actual "next"
// node (this completes its re-init, @see SetupInnerIterator)
if (!mOuterIterator->IsDone())
mOuterIterator->First();
}
else {
mInnerIterator->Last();
// finish setup: position mOuterIterator on the actual "previous"
// node (this completes its re-init, @see SetupInnerIterator)
if (!mOuterIterator->IsDone())
mOuterIterator->Last();
}
}
}
示例3: formControl
void
nsFindContentIterator::MaybeSetupInnerIterator()
{
mInnerIterator = nsnull;
nsIContent* content = mOuterIterator->GetCurrentNode();
if (!content || !content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL))
return;
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(content));
PRInt32 controlType = formControl->GetType();
if (controlType != NS_FORM_TEXTAREA &&
controlType != NS_FORM_INPUT_TEXT)
return;
SetupInnerIterator(content);
if (mInnerIterator) {
if (!mFindBackward) {
mInnerIterator->First();
// finish setup: position mOuterIterator on the actual "next"
// node (this completes its re-init, @see SetupInnerIterator)
mOuterIterator->First();
}
else {
mInnerIterator->Last();
// finish setup: position mOuterIterator on the actual "previous"
// node (this completes its re-init, @see SetupInnerIterator)
mOuterIterator->Last();
}
}
}
示例4: MaybeSetupInnerIterator
nsresult
nsFindContentIterator::PositionAt(nsINode* aCurNode)
{
nsINode* oldNode = mOuterIterator->GetCurrentNode();
nsresult rv = mOuterIterator->PositionAt(aCurNode);
if (NS_SUCCEEDED(rv)) {
MaybeSetupInnerIterator();
}
else {
mOuterIterator->PositionAt(oldNode);
if (mInnerIterator)
rv = mInnerIterator->PositionAt(aCurNode);
}
return rv;
}