[gnome-db]New report IDL proposal



Well, here you have the new IDL proposal ;-)


I think that it only lacks on exception stuff for error handling, I will
work now on it, but please review the actual one and tell us what do you
think about it and which things do you think that needs to be
added/removed.


As you could see the IDL reflects the actual DTD, so if someone modifies
it, the IDL must also be updated.

Questions, ideas, help???

Thanks in advance.


-- 
Carlos Perelló Marín
mailto:carlos gnome-db org
mailto:carlos hispalinux es
http://www.gnome-db.org
http://www.Hispalinux.es
Valencia - España
/* GDA Report Engine
 * Copyright (C) 2000 Rodrigo Moya
 * Copyright (C) 2001 Carlos Perelló Marín <carlos gnome-db org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef __gda_report_idl__
#define __gda_report_idl__

module GDA {
	
	enum PositionFreq {
		FIRST,
		INSIDE,
		LAST,
		ALLBUTFIRST,
		ALLBUTLAST,
		FIRSTANDLAST,
		ALL
	};

	enum PageFreq {
		EVEN,
		ODD
/*		ALL*/
	};

	enum LineStyle {
		NONE,
		SOLID,
		DASH,
		DOT,
		DASHDOT,
		DASHDOTDOT
	};

	enum FontWeight {
		LIGHT,
		NORMAL,
		SEMIBOLD,
		BOLD,
		BLACK
	};

	enum HAlignment {
		STANDARD,
		LEFT,
		CENTER,
		RIGHT
	};

	enum VAlignment {
		TOP,
//		CENTER,
		BOTTOM
	};

	enum Size {
		CUT,
		SCALE
	};

	enum Ratio {
		FIXED,
		FLOAT
	};

	enum Source {
		INTERN,
		EXTERN
	};

	enum PageSize {
		A3,
		A4,
		A5,
		A6,
		B3,
		B4,
		B5,
		B6,
		LETTER,
		LEGAL,
		EXECUTIVE
	};

	enum Orientation {
		PORTRAIT,
		LANDSCAPE
	};

	enum Units {
		INCH,
		CM,
		PT
	};

	typedef octet Color[3];


	interface ReportElement;
	
	typedef sequence<ReportElement> ReportElementList;

	interface ReportSection {
		attribute boolean active;
		attribute boolean visible;
		attribute float height;
		attribute Color bgcolor;
		attribute Color fgcolor;
		attribute Color bordercolor;
		attribute float borderwidth;
		attribute LineStyle borderstyle;
		attribute string fontfamily;
		attribute short fontsize;
		attribute FontWeight fontweight;
		attribute boolean fontitalic;
		attribute HAlignment halignment;
		attribute VAlignment valignment;
		attribute boolean wordwrap;
		attribute Color negvaluecolor;
		attribute string dateformat;
		attribute unsigned short precision;
		attribute string currency;
		attribute boolean commaseparator;
		attribute float linewidth;
		attribute Color linecolor;
		attribute LineStyle linestyle;

		void			addChild	(in ReportElement child);
		void			removeChild	(in ReportElement child);
		ReportElementList	getChildren ();
		
	};
	
	interface ReportHeader : ReportSection {
		attribute boolean newpage;
	};
	
	interface ReportFooter : ReportSection {
		attribute boolean newpage;
	};
	
	interface PageHeader : ReportSection {
		attribute PositionFreq positionfreq;
		attribute PageFreq pagefreq;
	};
	
	interface PageFooter : ReportSection {
		attribute PositionFreq positionfreq;
		attribute PageFreq pagefreq;
	};
	
	interface DataHeader : ReportSection {
	};
	
	interface DataFooter : ReportSection {
	};
	
	interface GroupHeader : ReportSection {
		attribute string groupvar;
		attribute boolean newpage;
	};
	
	interface GroupFooter : ReportSection {
		attribute string groupvar;
		attribute boolean newpage;
	};

	interface Detail : ReportSection {
	};

	interface Data {
		attribute GroupHeader	gheader;
		attribute Detail	detail;
		attribute GroupFooter	gfooter;
	};
	
	typedef sequence<Data>	DataList;
	
	interface Page {
		attribute PageHeader	pheader;
		attribute DataHeader	dheader;
		attribute DataList	datalist;
		attribute DataFooter	dfooter;
		attribute PageFooter	pfooter;
	};

	typedef sequence<Page> PageList;
	
	typedef string ReportElementType;

	interface ReportElement {
		attribute string name;
		attribute boolean active;
		attribute boolean visible;
		
		ReportElementType getType ();
	};

	typedef sequence<octet> DataStream;
	
	interface Picture : ReportElement {
		attribute float x;
		attribute float y;
		attribute float width;
		attribute float height;
		attribute Size size;
		attribute Ratio aspectratio;
		attribute string format;
		attribute Source source;
		attribute DataStream data; /* Perhaps DataStram must be an union? */
		
	};
    		
	interface Line : ReportElement {
		attribute float x1;
		attribute float y1;
		attribute float x2;
		attribute float y2;
		attribute float linewidth;
		attribute Color linecolor;
		attribute LineStyle linestyle;
		
	};

	interface ReportObject : ReportElement {
		attribute float x;
		attribute float y;
		attribute float width;
		attribute float height;
		attribute Color bgcolor;
		attribute Color fgcolor;
		attribute Color bordercolor;
		attribute float borderwidth;
		attribute LineStyle borderStyle;


		void setGeometry (in float x, in float y, in float width, in float height);
		void move (in float x, in float y);
	};

	interface TextObject : ReportObject {
		attribute string fontfamily;
		attribute short fontsize;
		attribute FontWeight fontweight;
		attribute boolean fontitalic;
		attribute HAlignment halignment;
		attribute VAlignment valignment;
		attribute boolean wordwrap;
	};

	interface Label : TextObject {
		attribute string text;
	};

	interface Special : Label {
		attribute string dateformat;        
	};

	interface RepField : TextObject {
		attribute string query;
		attribute string value;
		attribute string datatype;
		attribute string dateformat;
		attribute unsigned short precision;
		attribute string currency;
		attribute Color negvaluecolor;
		attribute boolean commaseparator;
	};

	/*
	 * Report I/O operations
	 */
	typedef sequence<octet> ReportStreamChunk;
	interface ReportStream {
		ReportStreamChunk readChunk (in long start, in long size);
		long writeChunk (in ReportStreamChunk data, in long size);
		long getLength ();
	};

	interface ReportFormat {	
		ReportElement getRootElement ();
		ReportStream  getStream ();
	};
	
	/*
	 * Report output format
	 */
	interface ReportConverter {
		readonly attribute string format;
	};
	typedef sequence<ReportConverter> ReportConverterList;
	
	interface ReportOutput : ReportFormat {
		ReportStream convert (in string format, in long flags);
	};
	
	struct ReportParam {
		string name;
		any value;
	};
	
	typedef sequence<ReportParam> ReportParamList;
	
	interface Report {
		attribute string name;
		attribute string description;
		attribute PageSize pagesize;
		attribute Orientation orientation;
		attribute Units units;
		attribute float topmargin;
		attribute float bottommargin;
		attribute float leftmargin;
		attribute float rightmargin;
		attribute Color bgcolor;
		attribute Color fgcolor;
		attribute Color bordercolor;
		attribute float borderwidth;
		attribute LineStyle borderstyle;
		attribute string fontfamily;
		attribute short fontsize;
		attribute FontWeight fontweight;
		attribute boolean fontitalic;
		attribute HAlignment halignment;
		attribute VAlignment valignment;
		attribute boolean wordwrap;
		attribute Color negvaluecolor;
		attribute string dateformat;
		attribute unsigned short precision;
		attribute string currency;
		attribute boolean commaseparator;
		attribute float linewidth;
		attribute Color linecolor;
		attribute LineStyle linestyle;

		attribute ReportHeader		rheader;
		attribute PageList		plist;
		attribute ReportFooter		rfooter;
		
		readonly attribute ReportFormat format;
		readonly attribute boolean      isLocked;

		ReportOutput run (in ReportParamList params, in long flags);
		
		/* for shared I/O access */
		void lock   ();
		void unlock ();
	};

	typedef sequence<Report> ReportList;

	/*
	 * The report engine
	 */
	interface ReportEngine {
		readonly attribute ReportConverterList convlist;
		
		ReportList      queryReports (in string condition, in long flags);
		Report          openReport (in string repname);
		
		Report          addReport (in string repname, in string description);
		void            removeReport (in string repname);
		
		boolean         registerConverter (in string format, in ReportConverter converter);
		void            unregisterConverter (in ReportConverter converter);
		ReportConverter findConverter (in string format);
		
		ReportStream    createStream ();
	};

};

#endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]