Back to index

lightning-sunbird  0.9+nobinonly
nsSanePluginControl.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org Code.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 2001
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Rusty Lynch <rusty.lynch@intel.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 /* 
00040  * Defines scriptable interface to SANE plugin.
00041  */
00042 
00043 #include "nsISupports.idl"
00044 
00045 [scriptable, uuid(10982800-365e-11d3-a2bf-0004ac779ef3)]
00077 interface nsISanePluginInstance : nsISupports
00078 {
00080     // Plugin Status Interface
00081     
00082     // Read-Only: Contains completion status of last operation
00083     attribute boolean Success;
00084 
00085     // Read-Only: Contains the current state of the scanner (IDLE|BUSY)
00086     attribute string State;
00087 
00089     // Image Preview Interface
00090 
00091     // Move zoom box to a given geometry in one step
00092     void ZoomImage(in unsigned short x, in unsigned short y, 
00093                    in unsigned short width, in unsigned short height);
00094     void ZoomImageWithAttributes(in unsigned short x, 
00095                                  in unsigned short y, 
00096                                  in unsigned short width, 
00097                                  in unsigned short height,
00098                                  in long req_line_width, 
00099                                  in string req_line_style,
00100                                  in string req_cap_style, 
00101                                  in string req_join_style);
00102 
00103     // Undo all croping and reset zoom box for entire image
00104     void Restore ();
00105 
00106     // Zoom in on the image and reset the zoom box to contain 
00107     // the entire image.
00108     void Crop(in unsigned short x, in unsigned short y,
00109               in unsigned short width, in unsigned short height);
00110 
00111     // Read/Write zoom box geometry
00112     // (Each write will trigger a refresh!)
00113     attribute unsigned short ZoomX;
00114     attribute unsigned short ZoomY;
00115     attribute unsigned short ZoomWidth;
00116     attribute unsigned short ZoomHeight;
00117 
00118     // Read/Write zoom box line attributes
00119     // (Each write will trigger a refresh!)
00120     attribute long   ZoomLineWidth;
00121     attribute string ZoomLineStyle;
00122     attribute string ZoomCapStyle;
00123     attribute string ZoomJoinStyle;
00124 
00125     // Read-Only zoom box change indicators
00126     // (For SANE devices that support changing the scan area,
00127     //  this allows for the controling JavaScript to safely adjust
00128     //  the scan area in a device specific manner.)
00129     attribute float ZoomBR_XChange;  // % bottom right x change on last zoom
00130     attribute float ZoomBR_YChange;  // % bottom right y ...
00131     attribute float ZoomTL_XChange;  // % top left x ...
00132     attribute float ZoomTL_YChange;  // % top left y ...
00133 
00134     // Read/Write JPEG compression attributes
00135     attribute long Quality;
00136     attribute string Method;
00137 
00139     // Generic SANE Interface
00140 
00141     // READ_ONLY: returns a colon delimited list of option descriptions
00142     //            where each option description is a comma delimited
00143     //            list of values
00144     attribute string DeviceOptions;
00145 
00146     // Returns or sets the active device.
00147     attribute string ActiveDevice;
00148 
00149     // READ_ONLY: returns a comma delimited list of image parameters
00150     attribute string ImageParameters;
00151 
00152     // READ_ONLY: returns a comma delimited list of available devices
00153     attribute string AvailableDevices;
00154 
00155     // Pull image from device with current option settings.
00156     // As a side effect, the zoom box is set to contain the
00157     // entire image.
00158     void ScanImage();
00159     void SetOption(in string name, in string value);
00160 
00161     // Pop up a dialog to save current image to a file
00162     void SaveImage();
00163  };
00164 
00165 %{ C++
00166 //10982800-365e-11d3-a2bf-0004ac780ef3
00167 #define NS_SANE_PLUGIN_CONTROL_CID \
00168  { 0x10982800, 0x365e, 0x11d3, { 0xa2, 0xbf, 0x0, 0x04, 0xac, 0x78, 0x0e, 0xf3 }}
00169 
00170 %}