KIO
kscan.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "kscan.h"
00022
00023 #include <QtCore/QFile>
00024
00025 #include <klocale.h>
00026 #include <kservicetypetrader.h>
00027
00028 class KScanDialog::KScanDialogPrivate
00029 {
00030 public:
00031 KScanDialogPrivate()
00032 : m_currentId( 1 )
00033 {}
00034 int m_currentId;
00035 };
00036
00037
00038 KScanDialog * KScanDialog::getScanDialog( QWidget *parent )
00039 {
00040 return KServiceTypeTrader::createInstanceFromQuery<KScanDialog>( "KScan/KScanDialog", QString(), parent );
00041 }
00042
00043
00044 KScanDialog::KScanDialog( int dialogFace, int buttonMask,
00045 QWidget *parent )
00046 : KPageDialog( parent ),
00047 d( new KScanDialogPrivate )
00048 {
00049 setFaceType( (KPageDialog::FaceType)dialogFace );
00050 setCaption( i18n("Acquire Image") );
00051 setButtons( (KDialog::ButtonCodes)buttonMask );
00052 setDefaultButton( Close );
00053 }
00054
00055 KScanDialog::~KScanDialog()
00056 {
00057 delete d;
00058 }
00059
00060 int KScanDialog::id() const
00061 {
00062 return d->m_currentId;
00063 }
00064
00065 int KScanDialog::nextId()
00066 {
00067 return ++d->m_currentId;
00068 }
00069
00070 bool KScanDialog::setup()
00071 {
00072 return true;
00073 }
00074
00076
00077 class KOCRDialog::KOCRDialogPrivate
00078 {
00079 public:
00080 KOCRDialogPrivate()
00081 : m_currentId( 1 )
00082 {}
00083 int m_currentId;
00084 };
00085
00086
00087 KOCRDialog * KOCRDialog::getOCRDialog( QWidget *parent )
00088 {
00089 return KServiceTypeTrader::createInstanceFromQuery<KOCRDialog>( "KScan/KOCRDialog", QString(), parent );
00090 }
00091
00092
00093 KOCRDialog::KOCRDialog( int dialogFace, int buttonMask,
00094 QWidget *parent, bool modal )
00095 : KPageDialog( parent ),
00096 d( new KOCRDialogPrivate )
00097 {
00098 setFaceType( (KPageDialog::FaceType)dialogFace );
00099 setCaption( i18n("OCR Image") );
00100 setButtons( (KDialog::ButtonCodes)buttonMask );
00101 setDefaultButton( Close );
00102 setModal( modal );
00103 showButtonSeparator( true );
00104 }
00105
00106 KOCRDialog::~KOCRDialog()
00107 {
00108 delete d;
00109 }
00110
00111 int KOCRDialog::id() const
00112 {
00113 return d->m_currentId;
00114 }
00115
00116 int KOCRDialog::nextId()
00117 {
00118 return ++d->m_currentId;
00119 }
00120
00121
00122
00123 #include "kscan.moc"