109
108
* @param bytes_per_line is the number of bytes used per line. This might include padding
110
109
* and is probably only relevant for 'FormatBlackWhite'.
111
110
* @param format is the KSane image format of the data.
112
* @param img is the QImage reference to the image to fill.
114
bool makeQImage(const QByteArray &data,
119
QImage &img) KDE_DEPRECATED;
111
* @param img is the QImage reference to the image to fill. */
112
KDE_DEPRECATED bool makeQImage(const QByteArray &data,
121
119
* This is a convenience method that can be used to create a QImage from the image data
122
120
* returned by the imageReady(...) signal. Note: If the image data has 16 bits/color the
146
143
/** This method returns the current resolution of the aquired image,
147
144
* in dots per inch.
148
145
* @note This function should be called from the slot connected
149
* to the imageReady signal.
146
* to the imageReady signal. The connection should not be queued.
150
147
* @return the resolution used for scanning or 0.0 on failure. */
151
148
float currentDPI();
150
/** This method returns the scan area's width in mm
151
* @return Width of the scannable area in mm */
152
float scanAreaWidth();
154
/** This method returns the scan area's height in mm
155
* @return Height of the scannable area in mm */
156
float scanAreaHeight();
158
/** This method sets the selection according to the given points
159
* @note The points are defined with respect to the scan areas top-left corner in mm
160
* @param topLeft Upper left corner of the selection (in mm)
161
* @param bottomRight Lower right corner of the selection (in mm) */
162
void setSelection(QPointF topLeft, QPointF bottomRight);
164
/** This function is used to set the preferred resolution for scanning the preview.
165
* @param dpi is the wanted scan resolution for the preview
166
* @note if the set value is not supported, the cloasest one is used
167
* @note setting the value 0 means that the default calculated value should be used */
168
void setPreviewResolution(float dpi);
153
170
/** This method reads the available parameters and their values and
154
171
* returns them in a QMap (Name, value)
155
* @param opts is a QMap with the parameter names and values.
172
* @param opts is a QMap with the parameter names and values. */
157
173
void getOptVals(QMap <QString, QString> &opts);
159
175
/** This method can be used to write many parameter values at once.
160
176
* @param opts is a QMap with the parameter names and values.
161
* @return This function returns the number of successful writes.
177
* @return This function returns the number of successful writes. */
163
178
int setOptVals(const QMap <QString, QString> &opts);
165
180
/** This function reads one parameter value into a string.
166
181
* @param optname is the name of the parameter to read.
167
182
* @param value is the string representation of the value.
168
* @return this function returns true if the read was successful.
183
* @return this function returns true if the read was successful. */
170
184
bool getOptVal(const QString &optname, QString &value);
172
186
/** This function writes one parameter value into a string.
173
187
* @param optname is the name of the parameter to write.
174
188
* @param value is the string representation of the value.
175
* @return this function returns true if the write was successful.
189
* @return this function returns true if the write was successful. */
177
190
bool setOptVal(const QString &optname, const QString &value);
179
192
/** This function sets the label on the final scan button
180
* @param scanLabel is the new label for the button.
193
* @param scanLabel is the new label for the button. */
182
194
void setScanButtonText(const QString &scanLabel);
184
196
/** This function sets the label on the preview button
185
* @param scanLabel is the new label for the button.
197
* @param previewLabel is the new label for the button. */
187
198
void setPreviewButtonText(const QString &previewLabel);
189
200
/** This function can be used to enable/disable automatic selections on previews.
190
201
* The default state is enabled.
191
* @param enable specifies if the auto selection should be turned on or off.
202
* @param enable specifies if the auto selection should be turned on or off. */
193
203
void enableAutoSelect(bool enable);
205
/** This function is used to programatically collapse/restore the options.
206
* @param collapse defines the state to set. */
207
void setOptionsCollapsed(bool collapse);
209
/** This function is used hide/show the final scan button.
210
* @param hidden defines the state to set. */
211
void setScanButtonHidden(bool hidden);
196
214
/** This method can be used to cancel a scan or prevent an automatic new scan. */
197
215
void scanCancel();
220
236
* This signal is emitted when the scanning has ended.
221
237
* @param status contains a ScanStatus status code.
222
238
* @param strStatus If an error has occurred this string will contain an error message.
223
* otherwise the string is empty.
239
* otherwise the string is empty. */
225
240
void scanDone(int status, const QString &strStatus);
228
243
* This Signal is emitted for progress information during a scan.
229
244
* The GUI already has a progress bar, but if the GUI is hidden,
230
245
* this can be used to display a progress bar.
231
* @param percent is the percentage of the scan progress (0-100).
246
* @param percent is the percentage of the scan progress (0-100). */
233
247
void scanProgress(int percent);