本文整理汇总了C++中CJS_PropValue::IsSetting方法的典型用法代码示例。如果您正苦于以下问题:C++ CJS_PropValue::IsSetting方法的具体用法?C++ CJS_PropValue::IsSetting怎么用?C++ CJS_PropValue::IsSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJS_PropValue
的用法示例。
在下文中一共展示了CJS_PropValue::IsSetting方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: path
FX_BOOL Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
return FALSE;
}
vp << app::SysPathToPDFPath(m_pDocument->GetPath());
return TRUE;
}
示例2: filesize
FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
return FALSE;
}
vp << 0;
return TRUE;
}
示例3: DoProperty
FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
switch (vp.GetType())
{
case VT_number:
{
double dData;
vp >> dData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_boolean:
{
bool bData;
vp >> bData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_string:
{
CFX_ByteString sData;
vp >> sData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Handle<v8::Object>(), FALSE);
}
case VT_object:
{
JSObject pData = (JSObject)vp;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
// else
// {
// if (vp.IsArrayObject())
// {
// CJS_Array array;
// vp.ConvertToArray(array);
// return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
// (Dobject*)(Darray*)array, FALSE);
// }
// else
// return FALSE;
// }
}
case VT_null:
{
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_undefined:
{
DelProperty(cc, propname, sError);
return TRUE;
}
default:
return FALSE;
}
}
示例4: numFields
//the total number of fileds in document.
FX_BOOL Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
return FALSE;
}
CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm *pPDFForm = pInterForm->GetInterForm();
vp << (int)pPDFForm->CountFields();
return TRUE;
}
示例5: type
FX_BOOL Annot::type(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
return FALSE;
}
vp << CPDF_Annot::AnnotSubtypeToString(m_BAAnnot->GetAnnotSubtype());
return TRUE;
}
示例6: calculate
bool app::calculate(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsSetting()) {
bool bVP;
vp >> bVP;
m_bCalculate = (bool)bVP;
CJS_Context* pContext = (CJS_Context*)cc;
pContext->GetFormFillEnv()->GetInterForm()->EnableCalculate(
(bool)m_bCalculate);
} else {
示例7: calculate
FX_BOOL app::calculate(IFXJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsSetting()) {
bool bVP;
vp >> bVP;
m_bCalculate = (FX_BOOL)bVP;
CJS_Context* pContext = (CJS_Context*)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CJS_Array aDocs(pRuntime->GetIsolate());
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate);
} else {
示例8: DoProperty
FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
switch (vp.GetType())
{
case VT_number:
{
double dData;
vp >> dData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE);
}
case VT_boolean:
{
bool bData;
vp >> bData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE);
}
case VT_string:
{
CFX_ByteString sData;
vp >> sData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE);
}
case VT_object:
{
JSObject pData;
vp >> pData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
}
case VT_null:
{
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), FALSE);
}
case VT_undefined:
{
DelProperty(cc, propname, sError);
return TRUE;
}
default:
return FALSE;
}
}
示例9: DoProperty
FX_BOOL JSGlobalAlternate::DoProperty(IJS_Context* cc,
const FX_WCHAR* propname,
CJS_PropValue& vp,
CFX_WideString& sError) {
CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc);
if (vp.IsSetting()) {
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
switch (vp.GetJSValue()->GetType()) {
case CJS_Value::VT_number: {
double dData;
vp >> dData;
return SetGlobalVariables(sPropName, JS_GlobalDataType::NUMBER, dData,
false, "", v8::Local<v8::Object>(), FALSE);
}
case CJS_Value::VT_boolean: {
bool bData;
vp >> bData;
return SetGlobalVariables(sPropName, JS_GlobalDataType::BOOLEAN, 0,
bData, "", v8::Local<v8::Object>(), FALSE);
}
case CJS_Value::VT_string: {
CFX_ByteString sData;
vp >> sData;
return SetGlobalVariables(sPropName, JS_GlobalDataType::STRING, 0,
false, sData, v8::Local<v8::Object>(), FALSE);
}
case CJS_Value::VT_object: {
v8::Local<v8::Object> pData;
vp >> pData;
return SetGlobalVariables(sPropName, JS_GlobalDataType::OBJECT, 0,
false, "", pData, FALSE);
}
case CJS_Value::VT_null: {
return SetGlobalVariables(sPropName, JS_GlobalDataType::NULLOBJ, 0,
false, "", v8::Local<v8::Object>(), FALSE);
}
case CJS_Value::VT_undefined: {
DelProperty(cc, propname, sError);
return TRUE;
}
default:
break;
}
} else {
示例10: icons
FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
return FALSE;
}
if (!m_pIconTree)
{
vp.SetNull();
return TRUE;
}
CJS_Array Icons(m_isolate);
IconElement* pIconElement = NULL;
int iIconTreeLength = m_pIconTree->GetLength();
CJS_Context* pContext = (CJS_Context *)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
for (int i = 0; i < iIconTreeLength; i++)
{
pIconElement = (*m_pIconTree)[i];
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
if (pObj.IsEmpty()) return FALSE;
CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
if (!pJS_Icon) return FALSE;
Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
if (!pIcon)return FALSE;
pIcon->SetStream(pIconElement->IconStream->GetStream());
pIcon->SetIconName(pIconElement->IconName);
Icons.SetElement(i, CJS_Value(m_isolate,pJS_Icon));
}
vp << Icons;
return TRUE;
}
示例11: documentFileName
FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
return FALSE;
}
CFX_WideString wsFilePath = m_pDocument->GetPath();
FX_INT32 i = wsFilePath.GetLength() - 1;
for ( ; i >= 0; i-- )
{
if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) == L'/' )
break;
}
if ( i >= 0 && i < wsFilePath.GetLength() - 1 )
{
vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 );
}else{
vp << L"";
}
return TRUE;
}