KDELibs4Support

kscan.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001 Carsten Pfeiffer <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "kscan.h"
21 
22 #include <QFile>
23 #include <QPushButton>
24 
25 #include <klocalizedstring.h>
26 #include <kservicetypetrader.h>
27 
28 class Q_DECL_HIDDEN KScanDialog::KScanDialogPrivate
29 {
30 public:
31  KScanDialogPrivate()
32  : m_currentId(1)
33  {}
34  int m_currentId;
35 };
36 
37 // static factory method
39 {
40  return KServiceTypeTrader::createInstanceFromQuery<KScanDialog>("KScan/KScanDialog", QString(), parent);
41 }
42 
43 KScanDialog::KScanDialog(int dialogFace, int buttonMask,
44  QWidget *parent)
45  : KPageDialog(parent),
46  d(new KScanDialogPrivate)
47 {
49  setWindowTitle(i18n("Acquire Image"));
52 }
53 
55 {
56  delete d;
57 }
58 
59 int KScanDialog::id() const
60 {
61  return d->m_currentId;
62 }
63 
65 {
66  return ++d->m_currentId;
67 }
68 
70 {
71  return true;
72 }
73 
75 
76 class Q_DECL_HIDDEN KOCRDialog::KOCRDialogPrivate
77 {
78 public:
79  KOCRDialogPrivate()
80  : m_currentId(1)
81  {}
82  int m_currentId;
83 };
84 
85 // static factory method
87 {
88  return KServiceTypeTrader::createInstanceFromQuery<KOCRDialog>("KScan/KOCRDialog", QString(), parent);
89 }
90 
91 KOCRDialog::KOCRDialog(int dialogFace, int buttonMask,
92  QWidget *parent, bool modal)
93  : KPageDialog(parent),
94  d(new KOCRDialogPrivate)
95 {
97  setWindowTitle(i18n("OCR Image"));
100  setModal(modal);
101 }
102 
103 KOCRDialog::~KOCRDialog()
104 {
105  delete d;
106 }
107 
108 int KOCRDialog::id() const
109 {
110  return d->m_currentId;
111 }
112 
114 {
115  return ++d->m_currentId;
116 }
117 
int id() const
Returns the current id for an image.
Definition: kscan.cpp:108
static KOCRDialog * getOCRDialog(QWidget *parent=nullptr)
Creates the user&#39;s preferred OCR dialog and returns it, or 0L if no OCR-support is available...
Definition: kscan.cpp:86
QDialogButtonBox * buttonBox()
This is a base class for scanning dialogs.
Definition: kscan.h:62
static KScanDialog * getScanDialog(QWidget *parent=nullptr)
Creates the user&#39;s preferred scanning dialog and returns it, or 0L if no scan-support is available...
Definition: kscan.cpp:38
KOCRDialog(int dialogFace=Tabbed, int buttonMask=QDialogButtonBox::Close|QDialogButtonBox::Help, QWidget *parent=nullptr, bool modal=false)
Constructs the OCR dialog.
Definition: kscan.cpp:91
void setFaceType(FaceType faceType)
virtual bool setup()
Reimplement this if you need to set up some things, before showing the dialog, e.g.
Definition: kscan.cpp:69
QString i18n(const char *text, const TYPE &arg...)
typedef StandardButtons
int id() const
Returns the current id for an image.
Definition: kscan.cpp:59
void setStandardButtons(QDialogButtonBox::StandardButtons buttons)
void setWindowTitle(const QString &)
QPushButton * button(QDialogButtonBox::StandardButton which) const const
int nextId()
Returns the id for the next image.
Definition: kscan.cpp:64
~KScanDialog()
Destructs the scan dialog.
Definition: kscan.cpp:54
QObject * parent() const const
KScanDialog(int dialogFace=Tabbed, int buttonMask=QDialogButtonBox::Close|QDialogButtonBox::Help, QWidget *parent=nullptr)
Constructs the scan dialog.
Definition: kscan.cpp:43
int nextId()
Returns the id for the next image.
Definition: kscan.cpp:113
void setDefault(bool)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 22:57:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.