本文整理汇总了C++中CJS_PropValue::IsGetting方法的典型用法代码示例。如果您正苦于以下问题:C++ CJS_PropValue::IsGetting方法的具体用法?C++ CJS_PropValue::IsGetting怎么用?C++ CJS_PropValue::IsGetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJS_PropValue
的用法示例。
在下文中一共展示了CJS_PropValue::IsGetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activeDocs
FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (!vp.IsGetting())
return FALSE;
CJS_Context* pContext = (CJS_Context *)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument();
CJS_Array aDocs(pRuntime->GetIsolate());
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
{
CJS_Document* pJSDocument = NULL;
if (pDoc == pCurDoc)
{
JSFXObject pObj = JS_GetThisObj(*pRuntime);
if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"Document"))
pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
}
else
{
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime,L"Document"));
pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
ASSERT(pJSDocument != NULL);
}
aDocs.SetElement(0,CJS_Value(pRuntime->GetIsolate(),pJSDocument));
}
if (aDocs.GetLength() > 0)
vp << aDocs;
else
vp.SetNull();
return TRUE;
}
示例2: pageNum
FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsGetting())
{
if (CPDFSDK_PageView* pPageView = m_pDocument->GetCurrentView())
{
vp << pPageView->GetPageIndex();
}
}
else
{
int iPageCount = m_pDocument->GetPageCount();
int iPageNum = 0;
vp >> iPageNum;
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
if (iPageNum >= 0 && iPageNum < iPageCount)
{
pEnv->JS_docgotoPage(iPageNum);
}
else if (iPageNum >= iPageCount)
{
pEnv->JS_docgotoPage(iPageCount-1);
}
else if (iPageNum < 0)
{
pEnv->JS_docgotoPage(0);
}
}
return TRUE;
}
示例3: dirty
FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsGetting())
{
if (m_pDocument->GetChangeMark())
vp << true;
else
vp << false;
}
else
{
bool bChanged = false;
vp >> bChanged;
if (bChanged)
m_pDocument->SetChangeMark();
else
m_pDocument->ClearChangeMark();
}
return TRUE;
}
示例4: title
FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL)
return FALSE;
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)return FALSE;
if (vp.IsGetting())
{
vp << pDictionary->GetUnicodeText("Title");
return TRUE;
}
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
CFX_WideString cstitle;
vp >> cstitle;
pDictionary->SetAtString("Title", PDF_EncodeText(cstitle));
m_pDocument->SetChangeMark();
return TRUE;
}
}
示例5: hidden
FX_BOOL Annot::hidden(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsGetting()) {
CPDF_Annot* pPDFAnnot = m_BAAnnot->GetPDFAnnot();
vp << CPDF_Annot::IsAnnotationHidden(pPDFAnnot->GetAnnotDict());
return TRUE;
}
bool bHidden;
vp >> bHidden;
uint32_t flags = m_BAAnnot->GetFlags();
if (bHidden) {
flags |= ANNOTFLAG_HIDDEN;
flags |= ANNOTFLAG_INVISIBLE;
flags |= ANNOTFLAG_NOVIEW;
flags &= ~ANNOTFLAG_PRINT;
} else {
flags &= ~ANNOTFLAG_HIDDEN;
flags &= ~ANNOTFLAG_INVISIBLE;
flags &= ~ANNOTFLAG_NOVIEW;
flags |= ANNOTFLAG_PRINT;
}
m_BAAnnot->SetFlags(flags);
return TRUE;
}
示例6: name
FX_BOOL Icon::name(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) {
if (!vp.IsGetting())
return FALSE;
vp << m_swIconName;
return TRUE;
}
示例7: external
FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
//In Chrome case,should always return true.
if (vp.IsGetting()) {
vp << TRUE;
}
return TRUE;
}
示例8: info
FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)return FALSE;
CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author");
CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title");
CFX_WideString cwSubject = pDictionary->GetUnicodeText("Subject");
CFX_WideString cwKeywords = pDictionary->GetUnicodeText("Keywords");
CFX_WideString cwCreator = pDictionary->GetUnicodeText("Creator");
CFX_WideString cwProducer = pDictionary->GetUnicodeText("Producer");
CFX_WideString cwCreationDate = pDictionary->GetUnicodeText("CreationDate");
CFX_WideString cwModDate = pDictionary->GetUnicodeText("ModDate");
CFX_WideString cwTrapped = pDictionary->GetUnicodeText("Trapped");
v8::Isolate* isolate = GetIsolate(cc);
if (vp.IsGetting())
{
CJS_Context* pContext = (CJS_Context *)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1);
JS_PutObjectString(isolate, pObj, L"Author", cwAuthor.c_str());
JS_PutObjectString(isolate, pObj, L"Title", cwTitle.c_str());
JS_PutObjectString(isolate, pObj, L"Subject", cwSubject.c_str());
JS_PutObjectString(isolate, pObj, L"Keywords", cwKeywords.c_str());
JS_PutObjectString(isolate, pObj, L"Creator", cwCreator.c_str());
JS_PutObjectString(isolate, pObj, L"Producer", cwProducer.c_str());
JS_PutObjectString(isolate, pObj, L"CreationDate", cwCreationDate.c_str());
JS_PutObjectString(isolate, pObj, L"ModDate", cwModDate.c_str());
JS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str());
// It's to be compatible to non-standard info dictionary.
FX_POSITION pos = pDictionary->GetStartPos();
while(pos)
{
CFX_ByteString bsKey;
CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey);
CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength());
if((pValueObj->GetType()==PDFOBJ_STRING) || (pValueObj->GetType()==PDFOBJ_NAME) )
JS_PutObjectString(isolate, pObj, wsKey.c_str(), pValueObj->GetUnicodeText().c_str());
if(pValueObj->GetType()==PDFOBJ_NUMBER)
JS_PutObjectNumber(isolate,pObj, wsKey.c_str(), (float)pValueObj->GetNumber());
if(pValueObj->GetType()==PDFOBJ_BOOLEAN)
JS_PutObjectBoolean(isolate,pObj, wsKey.c_str(), (bool)pValueObj->GetInteger());
}
vp << pObj;
return TRUE;
}
else
{
return TRUE;
}
}
示例9: baseURL
FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << m_cwBaseURL;
}
else
{
vp >> m_cwBaseURL;
}
return TRUE;
}
示例10: name
FX_BOOL Annot::name(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsGetting()) {
vp << m_BAAnnot->GetAnnotName();
return TRUE;
}
CFX_WideString annotName;
vp >> annotName;
m_BAAnnot->SetAnnotName(annotName);
return TRUE;
}
示例11: delay
FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << m_bDelay;
return TRUE;
}
else
{
ASSERT(m_pDocument != NULL);
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
bool b;
vp >> b;
m_bDelay = b;
if (m_bDelay)
{
for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
delete m_DelayData.GetAt(i);
m_DelayData.RemoveAll();
}
else
{
CFX_ArrayTemplate<CJS_DelayData*> DelayDataToProcess;
for (int i=0,sz=m_DelayData.GetSize(); i < sz; i++)
{
if (CJS_DelayData* pData = m_DelayData.GetAt(i))
{
DelayDataToProcess.Add(pData);
m_DelayData.SetAt(i, NULL);
}
}
m_DelayData.RemoveAll();
for (int i=0,sz=DelayDataToProcess.GetSize(); i < sz; i++)
{
CJS_DelayData* pData = DelayDataToProcess.GetAt(i);
Field::DoDelay(m_pDocument, pData);
DelayDataToProcess.SetAt(i,NULL);
delete pData;
}
}
return TRUE;
}
}
示例12: ADBE
FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsGetting())
{
vp.SetNull();
}
else
{
}
return TRUE;
}
示例13: PropertyHelper
bool color::PropertyHelper(CJS_Runtime* pRuntime,
CJS_PropValue& vp,
CPWL_Color* var) {
CJS_Array array;
if (vp.IsGetting()) {
ConvertPWLColorToArray(pRuntime, *var, &array);
vp << array;
return true;
}
if (!vp.GetJSValue()->ConvertToArray(pRuntime, array))
return false;
ConvertArrayToPWLColor(pRuntime, array, var);
return true;
}
示例14: calculate
FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
if (vp.IsGetting())
{
if (pInterForm->IsCalculateEnabled())
vp << true;
else
vp << false;
}
else
{
bool bCalculate;
vp >> bCalculate;
pInterForm->EnableCalculate(bCalculate);
}
return TRUE;
}
示例15: activeDocs
bool app::activeDocs(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (!vp.IsGetting())
return false;
CJS_Context* pContext = (CJS_Context*)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CJS_Document* pJSDocument = nullptr;
v8::Local<v8::Object> pObj = pRuntime->GetThisObj();
if (CFXJS_Engine::GetObjDefnID(pObj) == CJS_Document::g_nObjDefnID) {
pJSDocument = static_cast<CJS_Document*>(pRuntime->GetObjectPrivate(pObj));
}
CJS_Array aDocs;
aDocs.SetElement(pRuntime, 0, CJS_Value(pRuntime, pJSDocument));
if (aDocs.GetLength(pRuntime) > 0)
vp << aDocs;
else
vp.GetJSValue()->SetNull(pRuntime);
return true;
}