/*************************************************************************
 *
 *  $RCSfile: XRmPrinter.idl,v $
 *
 *  $Revision: 1.1 $
 *
 *  last change: $Author: mh $ $Date: 2003/02/12 13:59:16 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2002
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2002 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2002 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#ifndef __com_sun_star_portal_client_XRmPrinter_idl__
#define __com_sun_star_portal_client_XRmPrinter_idl__

#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif

#ifndef __com_sun_star_portal_client_RmQueueInfo_idl__
#include <com/sun/star/portal/client/RmQueueInfo.idl>
#endif

#ifndef __com_sun_star_portal_client_RmJobSetup_idl__
#include <com/sun/star/portal/client/RmJobSetup.idl>
#endif

#ifndef __com_sun_star_portal_client_XRmFrameWindow_idl__
#include <com/sun/star/portal/client/XRmFrameWindow.idl>
#endif

#ifndef __com_sun_star_portal_client_XRmPageRequestor_idl__
#include <com/sun/star/portal/client/XRmPageRequestor.idl>
#endif

#ifndef __com_sun_star_lang_XMultiServiceFactory_idl__
#include <com/sun/star/lang/XMultiServiceFactory.idl>
#endif

module com
{
module sun
{
module star
{
module portal
{
module client
{

/**	Interface to use a printer
*/
interface XRmPrinter : com::sun::star::uno::XInterface
{
	//-------------------------------------------------------------------------
	/** Initialize an info printer instance 

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param aRmQueueInfo [in]: an initialized RmQueueInfo
		@param rRmJobSetup  [out]: an intialized RmJobSetup
	*/ 
	void			CreateInfoInstance( [in] RmQueueInfo aRmQueueInfo, [out] RmJobSetup rRmJobSetup );

	//-------------------------------------------------------------------------
	/** Create a printing instance

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param jobSetup    [in]: an initialized RmJobSetup struct
	*/
	void			CreatePrintInstance( [in] RmJobSetup jobSetup );

	//-------------------------------------------------------------------------
	/** Set a new JobSetup

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param rRmJobSetup  [inout]: an intialized RmJobSetup
		@return <code>TRUE</code> if setup was accepted otherwise <code>FALSE</code>
	*/ 
	boolean 		SetJobSetup( [inout] RmJobSetup rRmJobSetup );

	//-------------------------------------------------------------------------
	/** Set the paper orientation of the current jobsetup

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param nOrientation [in]: orientation of the paper
		<BR>PORTRAIT = 0
		<BR>LANDSCAPE = 1
		<BR>
		@param rRmJobSetup  [inout]: a changed RmJobSetup
		@return <code>TRUE</code> if paper orientation could be set otherwise <code>FALSE</code>
	*/ 
	boolean 		SetOrientation( [in] unsigned short nOrientation, [inout] RmJobSetup rRmJobSetup );

	//-------------------------------------------------------------------------
	/** Set the paper bin of the current jobsetup

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param nPaperBin    [in]: a paper bin index
		@param rRmJobSetup  [inout]: a changed RmJobSetup
		@return <code>TRUE</code> if paper bin could be set otherwise <code>FALSE</code>
	*/ 
	boolean 		SetPaperBin( [in] unsigned short nPaperBin, [inout] RmJobSetup rRmJobSetup );

	//-------------------------------------------------------------------------
	/** Set the paper format of the current jobsetup

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param nPaper [in]: a paper format 
		<BR>DIN A3=0
		<BR>DIN A4=1
		<BR>DIN A5=2
		<BR>DIN B4=3
		<BR>DIN B5=4
		<BR>LETTER=5
		<BR>LEGAL=6
		<BR>TABLOID=7
		<BR>USER=8
		<BR>
		@param rRmJobSetup  [inout]: a changed RmJobSetup
		@return <code>TRUE</code> if paper could be set otherwise <code>FALSE</code>
	*/ 
	boolean 		SetPaper( [in] unsigned short nPaper, [inout] RmJobSetup rRmJobSetup );

	//-------------------------------------------------------------------------
	/** Set the paper size of the current jobsetup

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param nWidth	[in]: a new paper width in 1/100 mm units
		@param nHeight	[in]: a new paper height in 1/100 mm units
		@param rRmJobSetup  [inout]: a changed RmJobSetup
		@return <code>TRUE</code> if paper size could be set otherwise <code>FALSE</code>
	*/ 
	boolean 		SetPaperSizeUser( [in] long nWidth, [in] long nHeight, [inout] RmJobSetup rRmJobSetup );

	//-------------------------------------------------------------------------
	/** Get the page info

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param rOutWidth 	[out]: printable width in pixel
		@param rOutHeight	[out]: printable height in pixel
		@param rPageOffX 	[out]: nonprintable X offset in pixel 
		@param rPageOffY 	[out]: nonprintable Y offset in pixel
		@param rPageWidth 	[out]: current paper size in pixel 
		@param rPageHeight	[out]: current paper size in pixel
	*/ 
	void			GetPageInfo( [out] long rOutWidth, [out] long rOutHeight, [out] long rPageOffX, [out] long rPageOffY, [out] long rPageWidth, [out] long rPageHeight );

	//-------------------------------------------------------------------------

    /** Retrieves the available paper bins
        The order of the returned sequence implies the index to use
        to set the respective bin.

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

        @return the paper bin names
    */

    sequence<string> GetPaperBins();

	//-------------------------------------------------------------------------
	/** Query the printer for its capabilities
	    (mainly to decide wether it is possible to bring up a printer setup dialog )

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param nType [in]: a capability type
		<BR>SUPPORTDIALOG=1
		<BR>COPIES=2
		<BR>COLLATECOPIES=3
		<BR>SETORIENTATION=4
		<BR>SETPAPERBIN=5
		<BR>SETPAPERSIZE=6
		<BR>SETPAPER=7
		<BR>FAX=8
		<BR>
		@return 0 = not supported otherwise supported
	*/
	unsigned long	GetCapabilities( [in] unsigned short nType );

	//-------------------------------------------------------------------------
	/** Brings up a UI to setup the current jobsetup
	  	
        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param xParent [in]: a reference to XRmFrameWindow (return is delivered as a UserEvent on the EventListener of xParent)
		@param EventID [in]: a event ID that is used to deliver the setup result	  
	
		@return the modified (and still current ) jobsetup if successful. If not successful (e.g. user cancel) the return is empty.
	 */
	[oneway] void UserSetup( [in] XRmFrameWindow xParent, [in] unsigned long EventID );

	//-------------------------------------------------------------------------
	/** start a print job on a printing instance

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

		@param nCopies		[in]: number of copies
		@param bCollate		[in]: set <code>TRUE</code> to order the pages otherwise <code>FALSE</code>
		@param aJobName		[in]: a string to define the job name
		@param sFileName	[in]: the file name if you use bPrintFile 
		@param bPrintFile	[in]: set <code>TRUE</code> to print to a file otherwise <code>FALSE</code>
		@return <code>TRUE</code>if successful otherwise <code>FALSE</code>
	*/
	boolean	 		StartJob( [in] unsigned short nCopies,
                              [in] boolean bCollate,
                              [in] string aJobName,
                              [in] string sFileName,
                              [in] boolean bPrintFile,
                              [in] unsigned long nPages,
                              [in] XRmPageRequestor aRequestor
                              );
	
	//-------------------------------------------------------------------------
	/** Start a new page

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>
	*/
	[oneway] void	StartPage();

	//-------------------------------------------------------------------------
	/** End the current page

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>
	*/
	[oneway] void	EndPage();

	//-------------------------------------------------------------------------
	/** Abort the current print job

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>
	*/
	[oneway] void	AbortJob();

	//-------------------------------------------------------------------------
	/** End the current print job 

        <p>Calls to this method are synchronized via <type>XRmSync</type>.</p>

	   @param factory	[in]:
	   Contains a multiservice factory that provides the service
	   UniversalContentProvider. This is only used if printing
	   to a file. May be empty otherwise.

       This method needs to be synchronous since the return indicates that
       e.g. print to file has finished and the file is complete.
	*/
	void			EndJob( [in] com::sun::star::lang::XMultiServiceFactory factory );

};

}; // module client
}; // module portal
}; // module star
}; // module sun
}; // module com

#endif
