本文整理汇总了C++中CPDFDoc_Environment::GetAnnotHandlerMgr方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFDoc_Environment::GetAnnotHandlerMgr方法的具体用法?C++ CPDFDoc_Environment::GetAnnotHandlerMgr怎么用?C++ CPDFDoc_Environment::GetAnnotHandlerMgr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFDoc_Environment
的用法示例。
在下文中一共展示了CPDFDoc_Environment::GetAnnotHandlerMgr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadFXAnnots
void CPDFSDK_PageView::LoadFXAnnots()
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
//Disable the default AP construction.
CPDF_InterForm::EnableUpdateAP(FALSE);
m_pAnnotList = new CPDF_AnnotList(m_page);
CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
int nCount = m_pAnnotList->Count();
SetLock(TRUE);
for(int i=0; i<nCount; i++)
{
CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
CPDF_Document * pDoc = GetPDFDocument();
CheckUnSupportAnnot(pDoc, pPDFAnnot);
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
ASSERT(pAnnotHandlerMgr != NULL);
if(pAnnotHandlerMgr)
{
CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this);
if(!pAnnot)
continue;
m_fxAnnotArray.Add(pAnnot);
pAnnotHandlerMgr->Annot_OnLoad(pAnnot);
}
}
SetLock(FALSE);
}
示例2: AddAnnot
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot * pPDFAnnot)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
CPDFSDK_AnnotHandlerMgr * pAnnotHandler= pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot =NULL;
if(pAnnotHandler)
{
pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this);
}
if(!pSDKAnnot)
return NULL;
m_fxAnnotArray.Add(pSDKAnnot);
if(pAnnotHandler)
{
pAnnotHandler->Annot_OnCreate(pSDKAnnot);
}
return pSDKAnnot;
}
示例3: OnMouseMove
FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point& point, int nFlag) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
if (CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y)) {
if (m_CaptureWidget && m_CaptureWidget != pFXAnnot) {
m_bExitWidget = TRUE;
m_bEnterWidget = FALSE;
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
}
m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
m_bOnWidget = TRUE;
if (!m_bEnterWidget) {
m_bEnterWidget = TRUE;
m_bExitWidget = FALSE;
pAnnotHandlerMgr->Annot_OnMouseEnter(this, pFXAnnot, nFlag);
}
pAnnotHandlerMgr->Annot_OnMouseMove(this, pFXAnnot, nFlag, point);
return TRUE;
}
if (m_bOnWidget) {
m_bOnWidget = FALSE;
m_bExitWidget = TRUE;
m_bEnterWidget = FALSE;
if (m_CaptureWidget) {
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
m_CaptureWidget = NULL;
}
}
return FALSE;
}
示例4: KillFocusAnnot
CPDFSDK_PageView::~CPDFSDK_PageView()
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
int nAnnotCount = m_fxAnnotArray.GetSize();
for (int i=0; i<nAnnotCount; i++)
{
CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
//if there is a focused annot on the page, we should kill the focus first.
if(pAnnot == m_pSDKDoc->GetFocusAnnot())
KillFocusAnnot();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
ASSERT(pAnnotHandlerMgr);
pAnnotHandlerMgr->ReleaseAnnot(pAnnot);
}
m_fxAnnotArray.RemoveAll();
delete m_pAnnotList;
m_pAnnotList = NULL;
m_page->RemovePrivateData((void*)m_page);
if(m_bTakeOverPage) {
delete m_page;
}
}
示例5: OnKeyDown
FX_BOOL CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag) {
if (CPDFSDK_Annot* pAnnot = GetFocusAnnot()) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
return pAnnotHandlerMgr->Annot_OnKeyDown(pAnnot, nKeyCode, nFlag);
}
return FALSE;
}
示例6: OnChar
FX_BOOL CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag) {
if (CPDFSDK_Annot* pAnnot = GetFocusAnnot()) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
return pAnnotHandlerMgr->Annot_OnChar(pAnnot, nChar, nFlag);
}
return FALSE;
}
示例7: OnMouseWheel
FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y))
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
ASSERT(pAnnotHandlerMgr);
return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag, (int)deltaY, point);
}
return FALSE;
}
示例8: AddAnnot
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot* pPDFAnnot) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this);
if (!pSDKAnnot)
return nullptr;
m_fxAnnotArray.push_back(pSDKAnnot);
pAnnotHandler->Annot_OnCreate(pSDKAnnot);
return pSDKAnnot;
}
示例9: PageView_OnDraw
void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
CPDF_Matrix* pUser2Device,
CPDF_RenderOptions* pOptions) {
m_curMatrix = *pUser2Device;
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotIterator annotIterator(this, true);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0);
}
}
示例10: GetFXAnnotAtPoint
CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX,
FX_FLOAT pageY) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_AnnotIterator annotIterator(this, false);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
if (rc.Contains(pageX, pageY))
return pSDKAnnot;
}
return nullptr;
}
示例11:
CPDFSDK_PageView::~CPDFSDK_PageView() {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray)
pAnnotHandlerMgr->ReleaseAnnot(pAnnot);
m_fxAnnotArray.clear();
m_pAnnotList.reset();
m_page->RemovePrivateData((void*)m_page);
if (m_bTakeOverPage) {
delete m_page;
}
}
示例12: PageView_OnDraw
void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions)
{
m_curMatrix = *pUser2Device;
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotIterator annotIterator(this, TRUE);
CPDFSDK_Annot* pSDKAnnot = nullptr;
int index = -1;
while ((pSDKAnnot = annotIterator.Next(index))) {
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
ASSERT(pAnnotHandlerMgr);
pAnnotHandlerMgr->Annot_OnDraw(
this, pSDKAnnot, pDevice, pUser2Device, 0);
}
}
示例13: OnLButtonUp
FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot();
FX_BOOL bRet = FALSE;
if (pFocusAnnot && pFocusAnnot != pFXAnnot) {
// Last focus Annot gets a chance to handle the event.
bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFocusAnnot, nFlag, point);
}
if (pFXAnnot && !bRet)
bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFXAnnot, nFlag, point);
return bRet;
}
示例14: GetFXWidgetAtPoint
CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX,
FX_FLOAT pageY) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_AnnotIterator annotIterator(this, false);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
if (pSDKAnnot->GetType() == "Widget") {
pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
CPDF_Point point(pageX, pageY);
if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point))
return pSDKAnnot;
}
}
return nullptr;
}
示例15: GetFXAnnotAtPoint
CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
{
CPDFSDK_AnnotIterator annotIterator(this, FALSE);
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = NULL;
int index = -1;
while((pSDKAnnot = annotIterator.Next(index)))
{
CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
if(rc.Contains(pageX, pageY))
return pSDKAnnot;
}
return NULL;
}