Lines Matching refs:n
324 sal_Bool Sane::Open( int n ) in Open() argument
326 if( n >= 0 && n < nDevices ) in Open()
328 mnDevice = n; in Open()
329 return Open( (char*)ppDevices[n]->name ); in Open()
358 sal_Bool Sane::GetOptionValue( int n, sal_Bool& rRet ) in GetOptionValue() argument
360 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL ) in GetOptionValue()
363 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, &nRet ); in GetOptionValue()
371 sal_Bool Sane::GetOptionValue( int n, ByteString& rRet ) in GetOptionValue() argument
374 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING ) in GetOptionValue()
376 char* pRet = new char[mppOptions[n]->size+1]; in GetOptionValue()
377 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pRet ); in GetOptionValue()
387 sal_Bool Sane::GetOptionValue( int n, double& rRet, int nElement ) in GetOptionValue() argument
391 if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && in GetOptionValue()
392 mppOptions[n]->type != SANE_TYPE_FIXED ) ) in GetOptionValue()
395 SANE_Word* pRet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in GetOptionValue()
396 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pRet ); in GetOptionValue()
400 if( mppOptions[n]->type == SANE_TYPE_INT ) in GetOptionValue()
409 sal_Bool Sane::GetOptionValue( int n, double* pSet ) in GetOptionValue() argument
411 if( ! maHandle || ! ( mppOptions[n]->type == SANE_TYPE_FIXED || in GetOptionValue()
412 mppOptions[n]->type == SANE_TYPE_INT ) ) in GetOptionValue()
415 SANE_Word* pFixedSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in GetOptionValue()
416 SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pFixedSet ); in GetOptionValue()
422 for( size_t i = 0; i <mppOptions[n]->size/sizeof(SANE_Word); i++ ) in GetOptionValue()
424 if( mppOptions[n]->type == SANE_TYPE_FIXED ) in GetOptionValue()
433 sal_Bool Sane::SetOptionValue( int n, sal_Bool bSet ) in SetOptionValue() argument
435 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL ) in SetOptionValue()
438 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nRet ); in SetOptionValue()
444 sal_Bool Sane::SetOptionValue( int n, const String& rSet ) in SetOptionValue() argument
446 if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING ) in SetOptionValue()
449 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, (void*)aSet.GetBuffer() ); in SetOptionValue()
455 sal_Bool Sane::SetOptionValue( int n, double fSet, int nElement ) in SetOptionValue() argument
459 if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && in SetOptionValue()
460 mppOptions[n]->type != SANE_TYPE_FIXED ) ) in SetOptionValue()
464 if( mppOptions[n]->size/sizeof(SANE_Word) > 1 ) in SetOptionValue()
466 SANE_Word* pSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in SetOptionValue()
467 nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pSet ); in SetOptionValue()
470 pSet[nElement] = mppOptions[n]->type == SANE_TYPE_INT ? in SetOptionValue()
472 nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pSet ); in SetOptionValue()
479 mppOptions[n]->type == SANE_TYPE_INT ? in SetOptionValue()
482 nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nSetTo ); in SetOptionValue()
489 sal_Bool Sane::SetOptionValue( int n, double* pSet ) in SetOptionValue() argument
491 if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT && in SetOptionValue()
492 mppOptions[n]->type != SANE_TYPE_FIXED ) ) in SetOptionValue()
494 SANE_Word* pFixedSet = new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]; in SetOptionValue()
495 for( size_t i = 0; i < mppOptions[n]->size/sizeof(SANE_Word); i++ ) in SetOptionValue()
497 if( mppOptions[n]->type == SANE_TYPE_FIXED ) in SetOptionValue()
502 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pFixedSet ); in SetOptionValue()
904 int Sane::GetRange( int n, double*& rpDouble ) in GetRange() argument
906 if( mppOptions[n]->constraint_type != SANE_CONSTRAINT_RANGE && in GetRange()
907 mppOptions[n]->constraint_type != SANE_CONSTRAINT_WORD_LIST ) in GetRange()
914 sal_Bool bIsFixed = mppOptions[n]->type == SANE_TYPE_FIXED ? sal_True : sal_False; in GetRange()
916 dbg_msg( "Sane::GetRange of option %s ", mppOptions[n]->name ); in GetRange()
917 if(mppOptions[n]->constraint_type == SANE_CONSTRAINT_RANGE ) in GetRange()
922 fMin = SANE_UNFIX( mppOptions[n]->constraint.range->min ); in GetRange()
923 fMax = SANE_UNFIX( mppOptions[n]->constraint.range->max ); in GetRange()
924 fQuant = SANE_UNFIX( mppOptions[n]->constraint.range->quant ); in GetRange()
928 fMin = (double)mppOptions[n]->constraint.range->min; in GetRange()
929 fMax = (double)mppOptions[n]->constraint.range->max; in GetRange()
930 fQuant = (double)mppOptions[n]->constraint.range->quant; in GetRange()
956 nItems = mppOptions[n]->constraint.word_list[0]; in GetRange()
961 SANE_UNFIX( mppOptions[n]->constraint.word_list[i+1] ) : in GetRange()
962 (double)mppOptions[n]->constraint.word_list[i+1]; in GetRange()
980 String Sane::GetOptionUnitName( int n ) in GetOptionUnitName() argument
983 SANE_Unit nUnit = mppOptions[n]->unit; in GetOptionUnitName()
992 sal_Bool Sane::ActivateButtonOption( int n ) in ActivateButtonOption() argument
994 SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, NULL ); in ActivateButtonOption()