libs/libksane/libksane
ksane_widget.cpp
Go to the documentation of this file.
196 if (d->m_activityFrame->sizeHint().height() > minHeight) minHeight = d->m_activityFrame->sizeHint().height();
197 if (d->m_warmingUp->sizeHint().height() > minHeight) minHeight = d->m_warmingUp->sizeHint().height();
266 d->devListUpdated(); // this is just a wrapped if (m_vendor.isEmpty()) statement if the vendor is known
267 // devListUpdated here is to ensure that we do not come in between finished and the devListUpdated slot
278 d->devListUpdated(); // this is just a wrapped if (m_vendor.isEmpty()) statement if the vendor is known
279 // devListUpdated here is to ensure that we do not come in between finished and the devListUpdated slot
289 // sel.setDefault(prev_backend); // set default scanner - perhaps application using libksane should remember that
344 dlg = new KPasswordDialog(this, KPasswordDialog::ShowUsernameLine | KPasswordDialog::ShowKeepPassword);
390 kDebug() << "sane_open(\"" << deviceName << "\", &handle) failed! status = " << sane_strstatus(status);
884 if (topLeft.x() > xmax || topLeft.y() > ymax || bottomRight.x() > xmax || bottomRight.y() > ymax) {
901 if (m*topLeft.x() > xmax || m*topLeft.y() > ymax || m*bottomRight.x() > xmax || m*bottomRight.y() > ymax) {
908 d->m_previewViewer->setSelection(m*topLeft.x(), m*topLeft.y(), m*bottomRight.x(), m*bottomRight.y());
QImage toQImageSilent(const QByteArray &data, int width, int height, int bytes_per_line, ImageFormat format)
This is a convenience method that can be used to create a QImage from the image data returned by the ...
Definition: ksane_widget.cpp:539
uchar * scanLine(int i)
QTimer m_readValsTmr
Definition: ksane_widget_private.h:187
void setInterval(int msec)
QToolButton * m_zOutBtn
Definition: ksane_widget_private.h:129
KSaneOption * m_optGamG
Definition: ksane_widget_private.h:164
KPushButton * m_cancelBtn
Definition: ksane_widget_private.h:139
QWidget * m_activityFrame
Definition: ksane_widget_private.h:136
void setMaximum(int maximum)
void setDotsPerMeterX(int x)
void setDotsPerMeterY(int y)
void buttonPressed(const QString &optionName, const QString &optionLabel, bool pressed)
This Signal is emitted when a hardware button is pressed.
void scanCancel()
This method can be used to cancel a scan or prevent an automatic new scan.
Definition: ksane_widget.cpp:652
QToolButton * m_zInBtn
Definition: ksane_widget_private.h:128
void setContentsMargins(int left, int top, int right, int bottom)
void clearDeviceAuth(const QString &resource)
Definition: ksane_auth.cpp:97
void initGetDeviceList() const
Get the list of available scanning devices.
Definition: ksane_widget.cpp:297
static KSaneOptType optionType(const SANE_Option_Descriptor *optDesc)
Definition: ksane_option.cpp:239
void clearDeviceOptions()
Definition: ksane_widget_private.cpp:97
KSaneOption * m_optGamB
Definition: ksane_widget_private.h:165
bool contains(const Key &key) const
QToolButton * m_zSelBtn
Definition: ksane_widget_private.h:130
QList< KSaneOption * > m_optList
Definition: ksane_widget_private.h:148
bool empty() const
void setScanButtonText(const QString &scanLabel)
This function sets the label on the final scan button.
Definition: ksane_widget.cpp:802
KSaneWidget(QWidget *parent=0)
This constructor initializes the private class variables, but the widget is left empty.
Definition: ksane_widget.cpp:69
QString model() const
This methos returns the model of the scanner.
Definition: ksane_widget.cpp:275
void append(const T &value)
A button which appears on the side of a splitter handle and allows easy collapsing of the widget on t...
Definition: splittercollapser.h:41
void setStretchFactor(int index, int stretch)
void setOptionsCollapsed(bool collapse)
This function is used to programatically collapse/restore the options.
Definition: ksane_widget.cpp:916
QScrollArea * m_basicScrollA
Definition: ksane_widget_private.h:115
void setFrameShape(Shape)
void signalDevListUpdate()
Definition: ksane_widget_private.cpp:159
KTabWidget * m_optsTabWidget
Definition: ksane_widget_private.h:114
Definition: ksane_opt_slider.h:38
void setDefaultValues()
Definition: ksane_widget_private.cpp:488
void setAlignment(QFlags< Qt::AlignmentFlag >)
float scanAreaWidth()
This method returns the scan area's width in mm.
Definition: ksane_widget.cpp:836
void unlock()
QList< KSaneOption * > m_pollList
Definition: ksane_widget_private.h:149
QString vendor() const
This method returns the vendor name of the scanner (Same as make).
Definition: ksane_widget.cpp:263
void clear()
void setIcon(const QIcon &icon)
void addWidget(QWidget *widget)
void clear()
void setValues(int bri, int con, int gam)
Definition: labeled_gamma.cpp:100
void setDeviceAuth(const QString &resource, const QString &username, const QString &password)
Definition: ksane_auth.cpp:75
void setSelection(float tl_x, float tl_y, float br_x, float br_y)
This function is used to set a selection without the user setting it.
Definition: ksane_viewer.cpp:281
int width() const
KPushButton * m_prevBtn
Definition: ksane_widget_private.h:134
Definition: ksane_opt_entry.h:38
void start(Priority priority)
One bit per pixel 1 = black 0 = white.
Definition: ksane.h:58
Definition: ksane_opt_combo.h:38
void scanFinal()
This method can be used to start a scan (if no GUI is needed).
Definition: ksane_widget.cpp:641
bool isEnabled() const
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
qreal x() const
qreal y() const
void setPreviewButtonText(const QString &previewLabel)
This function sets the label on the preview button.
Definition: ksane_widget.cpp:811
QWidget * m_previewFrame
Definition: ksane_widget_private.h:125
float scanAreaHeight()
This method returns the scan area's height in mm.
Definition: ksane_widget.cpp:851
KSaneOption * m_optTlY
Definition: ksane_widget_private.h:159
bool m_closeDevicePending
Definition: ksane_widget_private.h:181
KSanePreviewThread * m_previewThread
Definition: ksane_widget_private.h:191
LabeledCheckbox * m_splitGamChB
Definition: ksane_widget_private.h:166
QSplitter * m_splitter
Definition: ksane_widget_private.h:122
QToolButton * m_zFitBtn
Definition: ksane_widget_private.h:131
int width() const
static void authorization(SANE_String_Const resource, SANE_Char *username, SANE_Char *password)
static function called by sane_open to get authorization from user
Definition: ksane_auth.cpp:109
QByteArray m_scanData
Definition: ksane_widget_private.h:184
Every pixel consists of three colors in the order Read, Grean and Blue, with two bytes per color(no a...
Definition: ksane.h:64
QImage m_previewImg
Definition: ksane_widget_private.h:174
bool isEmpty() const
void startFinalScan()
Definition: ksane_widget_private.cpp:844
SplitterCollapser * m_optionsCollapser
Definition: ksane_widget_private.h:123
QTimer m_optionPollTmr
Definition: ksane_widget_private.h:189
virtual bool getMaxValue(float &max)
Definition: ksane_option.cpp:197
bool setOptVal(const QString &optname, const QString &value)
This function writes one parameter value into a string.
Definition: ksane_widget.cpp:751
Definition: ksane_opt_gamma.h:38
float currentDPI()
This method returns the current resolution of the acquired image, in dots per inch.
Definition: ksane_widget.cpp:825
WId winId() const
void setText(const QString &)
void hide()
The error string should contain an error message.
Definition: ksane.h:78
void setAutoRaise(bool enable)
void enableAutoSelect(bool enable)
This function can be used to enable/disable automatic selections on previews.
Definition: ksane_widget.cpp:820
Definition: ksane_option.h:49
Definition: ksane_opt_button.h:38
This enumeration value should never be returned to the user.
Definition: ksane.h:68
KSaneOption * m_optGamR
Definition: ksane_widget_private.h:163
QLabel * m_warmingUp
Definition: ksane_widget_private.h:137
void setSelection(QPointF topLeft, QPointF bottomRight)
This method sets the selection according to the given points.
Definition: ksane_widget.cpp:866
KSaneOption * m_optBrY
Definition: ksane_widget_private.h:161
bool getOptVal(const QString &optname, QString &value)
This function reads one parameter value into a string.
Definition: ksane_widget.cpp:684
Definition: ksane_viewer.h:37
KSaneScanThread * m_scanThread
Definition: ksane_widget_private.h:190
void lock()
void setWidgetResizable(bool resizable)
bool isRunning() const
sizeHint
Grayscale with one byte per pixel 0 = black 255 = white.
Definition: ksane.h:59
QProgressBar * m_progressBar
Definition: ksane_widget_private.h:138
KSaneOption * m_optBrX
Definition: ksane_widget_private.h:160
const QList< KSaneWidget::DeviceInfo > devicesList() const
Definition: ksane_find_devices_thread.cpp:102
KSaneOption * m_optRes
Definition: ksane_widget_private.h:155
void setScanButtonHidden(bool hidden)
This function is used hide/show the final scan button.
Definition: ksane_widget.cpp:926
QByteArray toLatin1() const
float m_previewDPI
Definition: ksane_widget_private.h:173
void scanDone(int status, const QString &strStatus)
This signal is emitted when the scanning has ended.
KSaneViewer * m_previewViewer
Definition: ksane_widget_private.h:126
bool wait(unsigned long time)
QString selectDevice(QWidget *parent=0)
This helper method displays a dialog for selecting a scanner.
Definition: ksane_widget.cpp:284
void addStretch(int stretch)
KPushButton * m_scanBtn
Definition: ksane_widget_private.h:133
void devListUpdated()
Definition: ksane_widget_private.cpp:143
QScrollArea * m_otherScrollA
Definition: ksane_widget_private.h:118
Grayscale withtTwo bytes per pixel.
Definition: ksane.h:60
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
QImage toQImage(const QByteArray &data, int width, int height, int bytes_per_line, ImageFormat format)
This is a convenience method that can be used to create a QImage from the image data returned by the ...
Definition: ksane_widget.cpp:627
virtual QSize sizeHint() const
int height() const
void setColorTable(const QVector< QRgb > colors)
QString make() const
This method returns the make name of the scanner.
Definition: ksane_widget.cpp:271
void setMinimumHeight(int minh)
T * data()
char * data()
void setPreviewResolution(float dpi)
This function is used to set the preferred resolution for scanning the preview.
Definition: ksane_widget.cpp:663
void alertUser(int type, const QString &strStatus)
Definition: ksane_widget_private.cpp:1109
void start(int msec)
FindSaneDevicesThread * m_findDevThread
Definition: ksane_widget_private.h:196
LabeledCheckbox * m_invertColors
Definition: ksane_widget_private.h:120
int height() const
void clearActiveSelection()
Definition: ksane_viewer.cpp:485
void setAutoFillBackground(bool enabled)
int setOptVals(const QMap< QString, QString > &opts)
This method can be used to write many parameter values at once.
Definition: ksane_widget.cpp:699
QTimer m_updProgressTmr
Definition: ksane_widget_private.h:188
bool openDevice(const QString &device_name)
This method opens the specified scanner device and adds the scan options to the KSane widget...
Definition: ksane_widget.cpp:310
void setToolTip(const QString &)
void setDisabled(bool disable)
void getOptVals(QMap< QString, QString > &opts)
This method reads the available parameters and their values and returns them in a QMap (Name...
Definition: ksane_widget.cpp:668
void createOptInterface()
Definition: ksane_widget_private.cpp:231
KSaneOption * m_optTlX
Definition: ksane_widget_private.h:158
void setBackgroundRole(QPalette::ColorRole role)
int size() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
int compare(const QString &other) const
LabeledGamma * m_commonGamma
Definition: ksane_widget_private.h:167
int height() const
QWidget * m_btnFrame
Definition: ksane_widget_private.h:127
void updatePreviewSize()
Definition: ksane_widget_private.cpp:646
Every pixel consists of three colors in the order Read, Grean and Blue, with one byte per color (no a...
Definition: ksane.h:62
QToolButton * m_clearSelBtn
Definition: ksane_widget_private.h:132
KSaneOption * getOption(const QString &name)
Definition: ksane_widget_private.cpp:220
bool closeDevice()
This method closes the currently open scanner device.
Definition: ksane_widget.cpp:505
SANE_Handle m_saneHandle
Definition: ksane_widget_private.h:142
void setSingleShot(bool singleShot)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:47 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:47 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.