当前位置: 首页>>代码示例>>C++>>正文


C++ EventTarget::GetOrCreateListenerManager方法代码示例

本文整理汇总了C++中EventTarget::GetOrCreateListenerManager方法的典型用法代码示例。如果您正苦于以下问题:C++ EventTarget::GetOrCreateListenerManager方法的具体用法?C++ EventTarget::GetOrCreateListenerManager怎么用?C++ EventTarget::GetOrCreateListenerManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventTarget的用法示例。


在下文中一共展示了EventTarget::GetOrCreateListenerManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetPresShell

nsresult
HTMLEditor::EndMoving()
{
  if (mPositioningShadow) {
    nsCOMPtr<nsIPresShell> ps = GetPresShell();
    NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED);

    DeleteRefToAnonymousNode(std::move(mPositioningShadow), ps);

    mPositioningShadow = nullptr;
  }

  EventTarget* eventTarget = GetDOMEventTarget();
  if (eventTarget && mMouseMotionListenerP) {
    EventListenerManager* eventListenerManager =
      eventTarget->GetOrCreateListenerManager();
    eventListenerManager->RemoveEventListenerByType(
                            mMouseMotionListenerP,
                            NS_LITERAL_STRING("mousemove"),
                            TrustedEventsAtSystemGroupBubble());
  }
  mMouseMotionListenerP = nullptr;

  mGrabberClicked = false;
  mIsMoving = false;
  RefPtr<Selection> selection = GetSelection();
  if (!selection) {
    return NS_ERROR_NOT_INITIALIZED;
  }
  nsresult rv = RefereshEditingUI(*selection);
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return rv;
  }
  return NS_OK;
}
开发者ID:marcoscaceres,项目名称:gecko-dev,代码行数:35,代码来源:HTMLAbsPositionEditor.cpp

示例2: TrustedEventsAtCapture

void
DocManager::RemoveListeners(nsIDocument* aDocument)
{
  nsPIDOMWindow* window = aDocument->GetWindow();
  if (!window)
    return;

  EventTarget* target = window->GetChromeEventHandler();
  if (!target)
    return;

  EventListenerManager* elm = target->GetOrCreateListenerManager();
  elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
                                 TrustedEventsAtCapture());

  elm->RemoveEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
                                 TrustedEventsAtCapture());
}
开发者ID:KershawChang,项目名称:gecko-dev,代码行数:18,代码来源:DocManager.cpp

示例3: GetDOMEventTarget

nsresult
HTMLEditor::GrabberClicked()
{
  // add a mouse move listener to the editor
  nsresult rv = NS_OK;
  if (!mMouseMotionListenerP) {
    EventTarget* eventTarget = GetDOMEventTarget();
    if (NS_WARN_IF(!eventTarget)) {
      return NS_ERROR_FAILURE;
    }
    mMouseMotionListenerP = new ResizerMouseMotionListener(*this);
    EventListenerManager* eventListenerManager =
      eventTarget->GetOrCreateListenerManager();
    eventListenerManager->AddEventListenerByType(
                            mMouseMotionListenerP,
                            NS_LITERAL_STRING("mousemove"),
                            TrustedEventsAtSystemGroupBubble());
  }
  mGrabberClicked = true;
  return rv;
}
开发者ID:marcoscaceres,项目名称:gecko-dev,代码行数:21,代码来源:HTMLAbsPositionEditor.cpp


注:本文中的EventTarget::GetOrCreateListenerManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。