Lines Matching refs:n
326 sal_Bool Sane::Open( int n ) in Open() argument
328 if( n >= 0 && n < nDevices ) in Open()
330 mnDevice = n; in Open()
331 return Open( (char*)ppDevices[n]->name ); in Open()
360 sal_Bool Sane::GetOptionValue( int n, sal_Bool& rRet ) in GetOptionValue() argument
362 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL ) in GetOptionValue()
365 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, &nRet ); in GetOptionValue()
373 sal_Bool Sane::GetOptionValue( int n, ByteString& rRet ) in GetOptionValue() argument
376 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING ) in GetOptionValue()
378 char* pRet = new char[mppOptions[n]->size+1]; in GetOptionValue()
379 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pRet ); in GetOptionValue()
389 sal_Bool Sane::GetOptionValue( int n, double& rRet, int nElement ) in GetOptionValue() argument
393 if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && in GetOptionValue()
394 mppOptions[n]->type != SANE_TYPE_FIXED ) ) in GetOptionValue()
397 SANE_Word* pRet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in GetOptionValue()
398 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pRet ); in GetOptionValue()
402 if( mppOptions[n]->type == SANE_TYPE_INT ) in GetOptionValue()
411 sal_Bool Sane::GetOptionValue( int n, double* pSet ) in GetOptionValue() argument
413 if( ! maHandle || ! ( mppOptions[n]->type == SANE_TYPE_FIXED || in GetOptionValue()
414 mppOptions[n]->type == SANE_TYPE_INT ) ) in GetOptionValue()
417 SANE_Word* pFixedSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in GetOptionValue()
418 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pFixedSet ); in GetOptionValue()
424 for( size_t i = 0; i <mppOptions[n]->size/sizeof(SANE_Word); i++ ) in GetOptionValue()
426 if( mppOptions[n]->type == SANE_TYPE_FIXED ) in GetOptionValue()
435 sal_Bool Sane::SetOptionValue( int n, sal_Bool bSet ) in SetOptionValue() argument
437 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL ) in SetOptionValue()
440 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nRet ); in SetOptionValue()
446 sal_Bool Sane::SetOptionValue( int n, const String& rSet ) in SetOptionValue() argument
448 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING ) in SetOptionValue()
451 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, (void*)aSet.GetBuffer() ); in SetOptionValue()
457 sal_Bool Sane::SetOptionValue( int n, double fSet, int nElement ) in SetOptionValue() argument
461 if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && in SetOptionValue()
462 mppOptions[n]->type != SANE_TYPE_FIXED ) ) in SetOptionValue()
466 if( mppOptions[n]->size/sizeof(SANE_Word) > 1 ) in SetOptionValue()
468 SANE_Word* pSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in SetOptionValue()
469 nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pSet ); in SetOptionValue()
472 pSet[nElement] = mppOptions[n]->type == SANE_TYPE_INT ? in SetOptionValue()
474 nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pSet ); in SetOptionValue()
481 mppOptions[n]->type == SANE_TYPE_INT ? in SetOptionValue()
484 nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nSetTo ); in SetOptionValue()
491 sal_Bool Sane::SetOptionValue( int n, double* pSet ) in SetOptionValue() argument
493 if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && in SetOptionValue()
494 mppOptions[n]->type != SANE_TYPE_FIXED ) ) in SetOptionValue()
496 SANE_Word* pFixedSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in SetOptionValue()
497 for( size_t i = 0; i < mppOptions[n]->size/sizeof(SANE_Word); i++ ) in SetOptionValue()
499 if( mppOptions[n]->type == SANE_TYPE_FIXED ) in SetOptionValue()
504 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pFixedSet ); in SetOptionValue()
906 int Sane::GetRange( int n, double*& rpDouble ) in GetRange() argument
908 if( mppOptions[n]->constraint_type != SANE_CONSTRAINT_RANGE && in GetRange()
909 mppOptions[n]->constraint_type != SANE_CONSTRAINT_WORD_LIST ) in GetRange()
916 sal_Bool bIsFixed = mppOptions[n]->type == SANE_TYPE_FIXED ? sal_True : sal_False; in GetRange()
918 dbg_msg( "Sane::GetRange of option %s ", mppOptions[n]->name ); in GetRange()
919 if(mppOptions[n]->constraint_type == SANE_CONSTRAINT_RANGE ) in GetRange()
924 fMin = SANE_UNFIX( mppOptions[n]->constraint.range->min ); in GetRange()
925 fMax = SANE_UNFIX( mppOptions[n]->constraint.range->max ); in GetRange()
926 fQuant = SANE_UNFIX( mppOptions[n]->constraint.range->quant ); in GetRange()
930 fMin = (double)mppOptions[n]->constraint.range->min; in GetRange()
931 fMax = (double)mppOptions[n]->constraint.range->max; in GetRange()
932 fQuant = (double)mppOptions[n]->constraint.range->quant; in GetRange()
958 nItems = mppOptions[n]->constraint.word_list[0]; in GetRange()
963 SANE_UNFIX( mppOptions[n]->constraint.word_list[i+1] ) : in GetRange()
964 (double)mppOptions[n]->constraint.word_list[i+1]; in GetRange()
982 String Sane::GetOptionUnitName( int n ) in GetOptionUnitName() argument
985 SANE_Unit nUnit = mppOptions[n]->unit; in GetOptionUnitName()
994 sal_Bool Sane::ActivateButtonOption( int n ) in ActivateButtonOption() argument
996 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, NULL ); in ActivateButtonOption()