22 #include <tdelocale.h>
32 if ( offers.isEmpty() )
35 KService::Ptr ptr = *(offers.begin());
36 KLibFactory *factory = KLibLoader::self()->factory( TQFile::encodeName(ptr->library()) );
42 args << TQString::number( (
int)modal );
44 TQObject *res = factory->create( parent, name,
"KScanDialog", args );
51 TQWidget *parent,
const char *name,
bool modal )
52 : KDialogBase( dialogFace, i18n(
"Acquire Image"), buttonMask, Close,
53 parent, name, modal, true ),
75 if ( offers.isEmpty() )
78 KService::Ptr ptr = *(offers.begin());
79 KLibFactory *factory = KLibLoader::self()->factory( TQFile::encodeName(ptr->library()) );
85 args << TQString::number( (
int)modal );
87 TQObject *res = factory->create( parent, name,
"KOCRDialog", args );
94 TQWidget *parent,
const char *name,
bool modal )
95 : KDialogBase( dialogFace, i18n(
"OCR Image"), buttonMask, Close,
96 parent, name, modal, true ),
102 KOCRDialog::~KOCRDialog()
111 : KLibFactory( parent, name ),
116 KScanDialogFactory::~KScanDialogFactory()
121 TQObject *KScanDialogFactory::createObject( TQObject *parent,
const char *name,
122 const char *classname,
123 const TQStringList &args )
125 if ( strcmp( classname,
"KScanDialog" ) != 0 )
128 if ( parent && !parent->isWidgetType() )
133 if ( args.count() == 1 )
134 modal = (bool)args[ 0 ].toInt();
136 return createDialog(
static_cast<TQWidget*
>( parent ), name, modal );
144 : KLibFactory( parent, name ),
149 KOCRDialogFactory::~KOCRDialogFactory()
154 TQObject *KOCRDialogFactory::createObject( TQObject *parent,
const char *name,
155 const char *classname,
156 const TQStringList &args )
158 if ( strcmp( classname,
"KOCRDialog" ) != 0 )
161 if ( parent && !parent->isWidgetType() )
166 if ( args.count() == 1 )
167 modal = (bool)args[ 0 ].toInt();
169 return createDialog(
static_cast<TQWidget*
>( parent ), name, modal );
172 void KScanDialog::virtual_hook(
int id,
void* data )
173 { KDialogBase::virtual_hook(
id, data ); }
175 void KScanDialogFactory::virtual_hook(
int id,
void* data )
176 { KLibFactory::virtual_hook(
id, data ); }
178 void KOCRDialog::virtual_hook(
int id,
void* data )
179 { KDialogBase::virtual_hook(
id, data ); }
181 void KOCRDialogFactory::virtual_hook(
int id,
void* data )
182 { KLibFactory::virtual_hook(
id, data ); }
virtual KOCRDialog * createDialog(TQWidget *parent=0, const char *name=0, bool modal=false)=0
Your library should reimplement this method to return your KOCRDialog derived dialog.
KOCRDialogFactory(TQObject *parent=0, const char *name=0)
Creates a new KScanDialogFactory.
Base class for OCR Dialogs.
KOCRDialog(int dialogFace=Tabbed, int buttonMask=Close|Help, TQWidget *parent=0L, const char *name=0, bool modal=false)
Constructs the OCR dialog.
static KOCRDialog * getOCRDialog(TQWidget *parent=0L, const char *name=0, bool modal=false)
Creates the user's preferred OCR dialog and returns it, or 0L if no OCR-support is available.
virtual KScanDialog * createDialog(TQWidget *parent=0, const char *name=0, bool modal=false)=0
Your library should reimplement this method to return your KScanDialog derived dialog.
KScanDialogFactory(TQObject *parent=0, const char *name=0)
Creates a new KScanDialogFactory.
This is a base class for scanning dialogs.
KScanDialog(int dialogFace=Tabbed, int buttonMask=Close|Help, TQWidget *parent=0L, const char *name=0, bool modal=false)
Constructs the scan dialog.
static KScanDialog * getScanDialog(TQWidget *parent=0L, const char *name=0, bool modal=false)
Creates the user's preferred scanning dialog and returns it, or 0L if no scan-support is available.
~KScanDialog()
Destructs the scan dialog.
virtual bool setup()
Reimplement this if you need to set up some things, before showing the dialog, e.g.
virtual OfferList query(const TQString &servicetype, const TQString &constraint=TQString::null, const TQString &preferences=TQString::null) const
The main function in the TDETrader class.
static TDETrader * self()
This is a static pointer to a TDETrader instance.
TQValueList< KService::Ptr > OfferList
A list of services.