1a1b4a26bSAndrew Rist /**************************************************************
2*e904c4c2Smseidel  *
3a1b4a26bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4a1b4a26bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5a1b4a26bSAndrew Rist  * distributed with this work for additional information
6a1b4a26bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7a1b4a26bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8a1b4a26bSAndrew Rist  * "License"); you may not use this file except in compliance
9a1b4a26bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e904c4c2Smseidel  *
11a1b4a26bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e904c4c2Smseidel  *
13a1b4a26bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14a1b4a26bSAndrew Rist  * software distributed under the License is distributed on an
15a1b4a26bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16a1b4a26bSAndrew Rist  * KIND, either express or implied.  See the License for the
17a1b4a26bSAndrew Rist  * specific language governing permissions and limitations
18a1b4a26bSAndrew Rist  * under the License.
19*e904c4c2Smseidel  *
20a1b4a26bSAndrew Rist  *************************************************************/
21a1b4a26bSAndrew Rist 
22a1b4a26bSAndrew Rist 
23*e904c4c2Smseidel 
24cdf0e10cSrcweir package com.sun.star.wizards.report;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import com.sun.star.beans.PropertyValue;
27cdf0e10cSrcweir import com.sun.star.lang.XComponent;
28cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory;
29cdf0e10cSrcweir import com.sun.star.sdb.application.XDatabaseDocumentUI;
30cdf0e10cSrcweir import com.sun.star.wizards.common.Resource;
31cdf0e10cSrcweir import java.util.ArrayList;
32cdf0e10cSrcweir import java.util.Vector;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir /**
35cdf0e10cSrcweir  * New Interface which gives us the possibility to switch on the fly between the old
36*e904c4c2Smseidel  * Wizard and the new Report Builder Wizard, which use the same UI.
37*e904c4c2Smseidel  *
38cdf0e10cSrcweir  * @author ll93751
39cdf0e10cSrcweir  */
40cdf0e10cSrcweir public interface IReportDocument
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     // -------------------------------------------------------------------------
43cdf0e10cSrcweir     // initialisation
44cdf0e10cSrcweir     // -------------------------------------------------------------------------
initialize( final XDatabaseDocumentUI i_documentUI, final Resource i_resource )45cdf0e10cSrcweir     public void initialize(
46cdf0e10cSrcweir             final XDatabaseDocumentUI i_documentUI,
47cdf0e10cSrcweir             final Resource i_resource
48cdf0e10cSrcweir         );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     // -------------------------------------------------------------------------
51cdf0e10cSrcweir     // Access Helper
52*e904c4c2Smseidel     // -------------------------------------------------------------------------
53cdf0e10cSrcweir     /**
54cdf0e10cSrcweir      * Gives access to the DB Values
55cdf0e10cSrcweir      * @return
56cdf0e10cSrcweir      */
getRecordParser()57cdf0e10cSrcweir     public com.sun.star.wizards.db.RecordParser getRecordParser();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     /**
60cdf0e10cSrcweir      * Give access to the parent document
61cdf0e10cSrcweir      * It is a document in the old Wizard
62cdf0e10cSrcweir      * It is a Report Builder in the new Wizard
63cdf0e10cSrcweir      * @return
64cdf0e10cSrcweir      */
getWizardParent()65cdf0e10cSrcweir     public com.sun.star.awt.XWindowPeer getWizardParent();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     /**
68*e904c4c2Smseidel      *
69cdf0e10cSrcweir      * @return the Frame of the document Window or Report Builder Window
70cdf0e10cSrcweir      */
getFrame()71cdf0e10cSrcweir     public com.sun.star.frame.XFrame getFrame();
72cdf0e10cSrcweir 
getComponent()73cdf0e10cSrcweir     public XComponent getComponent();
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     // -------------------------------------------------------------------------
76cdf0e10cSrcweir     // First step: After entering the table name, select fields
77*e904c4c2Smseidel     // -------------------------------------------------------------------------
78cdf0e10cSrcweir     /**
79cdf0e10cSrcweir      * Is called after first step, set Tablename and the fields, which should occur in the Report.
80*e904c4c2Smseidel      * @param _aType
81cdf0e10cSrcweir      * @param TableName
82cdf0e10cSrcweir      * @param FieldNames
83cdf0e10cSrcweir      */
initializeFieldColumns(final int _aType, final String TableName, final String[] FieldNames)84cdf0e10cSrcweir     public void initializeFieldColumns(final int _aType, final String TableName, final String[] FieldNames);
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     /**
87cdf0e10cSrcweir      * Empties the report document
88cdf0e10cSrcweir      */
clearDocument()89cdf0e10cSrcweir     public void clearDocument();
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     /**
92cdf0e10cSrcweir      * Empties the report document, if we called back, don't remove Grouping/Sorting
93cdf0e10cSrcweir      */
removeTextTableAndTextSection()94cdf0e10cSrcweir     public void removeTextTableAndTextSection();
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     // -------------------------------------------------------------------------
97cdf0e10cSrcweir     // Second step: Label field titles
98*e904c4c2Smseidel     // -------------------------------------------------------------------------
99cdf0e10cSrcweir     /**
100cdf0e10cSrcweir      * Set new names for the titles
101cdf0e10cSrcweir      * @param sFieldTitles
102cdf0e10cSrcweir      */
setFieldTitles(final String[] sFieldTitles)103cdf0e10cSrcweir     public void setFieldTitles(final String[] sFieldTitles);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     /**
106cdf0e10cSrcweir      * Change a the name of the 'title' of one field.
107cdf0e10cSrcweir      * It is possible to give all element names new names which are used as
108cdf0e10cSrcweir      * element title of a given element name.
109cdf0e10cSrcweir      * This is only used as a preview
110cdf0e10cSrcweir      * @param FieldName
111cdf0e10cSrcweir      * @param TitleName
112cdf0e10cSrcweir      */
liveupdate_changeUserFieldContent(final String FieldName, final String TitleName)113cdf0e10cSrcweir     public void liveupdate_changeUserFieldContent(final String FieldName, final String TitleName);
114cdf0e10cSrcweir     // -------------------------------------------------------------------------
115cdf0e10cSrcweir     // Third step: Grouping
116*e904c4c2Smseidel     // -------------------------------------------------------------------------
117cdf0e10cSrcweir     /* Grouping Page */
118cdf0e10cSrcweir     // Document should not hold the grouping information!
119cdf0e10cSrcweir     /**
120cdf0e10cSrcweir      * Called by press ('greater then') add a group to the group list
121cdf0e10cSrcweir      * @param GroupNames
122cdf0e10cSrcweir      * @param CurGroupTitle
123cdf0e10cSrcweir      * @param GroupFieldVector
124cdf0e10cSrcweir      * @param ReportPath
125cdf0e10cSrcweir      * @param iSelCount
126cdf0e10cSrcweir      * @return
127cdf0e10cSrcweir      */
liveupdate_addGroupNametoDocument(String[] GroupNames, String CurGroupTitle, Vector GroupFieldVector, ArrayList ReportPath, int iSelCount)128cdf0e10cSrcweir     public boolean liveupdate_addGroupNametoDocument(String[] GroupNames, String CurGroupTitle, Vector GroupFieldVector, ArrayList ReportPath, int iSelCount);
129cdf0e10cSrcweir 
refreshGroupFields(String[] _sNewNames)130cdf0e10cSrcweir     public void refreshGroupFields(String[] _sNewNames);
131cdf0e10cSrcweir     // public boolean isGroupField(String _FieldName);
132cdf0e10cSrcweir     /**
133cdf0e10cSrcweir      * Called by press ('less then') Removes an already set Groupname out of the list
134cdf0e10cSrcweir      * @param NewSelGroupNames
135cdf0e10cSrcweir      * @param CurGroupTitle
136cdf0e10cSrcweir      * @param GroupFieldVector
137cdf0e10cSrcweir      */
liveupdate_removeGroupName(String[] NewSelGroupNames, String CurGroupTitle, java.util.Vector GroupFieldVector)138cdf0e10cSrcweir     public void liveupdate_removeGroupName(String[] NewSelGroupNames, String CurGroupTitle, java.util.Vector GroupFieldVector);
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     /**
141cdf0e10cSrcweir      * set the list how to group
142cdf0e10cSrcweir      * @param aGroupList
143cdf0e10cSrcweir      */
setGrouping(String[] aGroupList)144cdf0e10cSrcweir     public void setGrouping(String[] aGroupList);
145cdf0e10cSrcweir     // -------------------------------------------------------------------------
146cdf0e10cSrcweir     // Fourth step: Sorting
147*e904c4c2Smseidel     // -------------------------------------------------------------------------
148cdf0e10cSrcweir     /**
149cdf0e10cSrcweir      * Set the list how to sort
150cdf0e10cSrcweir      * @param aSort
151cdf0e10cSrcweir      */
setSorting(String[][] aSort)152cdf0e10cSrcweir     public void setSorting(String[][] aSort);
153cdf0e10cSrcweir     // -------------------------------------------------------------------------
154cdf0e10cSrcweir     // Fivth step: Templates / Layout
155*e904c4c2Smseidel     // -------------------------------------------------------------------------
156cdf0e10cSrcweir     /* Template Page */
setPageOrientation(int nOrientation)157cdf0e10cSrcweir     public void setPageOrientation(int nOrientation) throws com.sun.star.lang.IllegalArgumentException;
158cdf0e10cSrcweir 
getDefaultPageOrientation()159cdf0e10cSrcweir     public int getDefaultPageOrientation();
160cdf0e10cSrcweir 
getReportPath()161cdf0e10cSrcweir     public ArrayList getReportPath();
162cdf0e10cSrcweir 
getLayoutPath()163cdf0e10cSrcweir     public String getLayoutPath();
164cdf0e10cSrcweir 
getContentPath()165cdf0e10cSrcweir     public String getContentPath();
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     /**
168cdf0e10cSrcweir      * Called if a new Layout is selected
169cdf0e10cSrcweir      * @param LayoutTemplatePath
170cdf0e10cSrcweir      */
liveupdate_changeLayoutTemplate(String LayoutTemplatePath )171cdf0e10cSrcweir     public void liveupdate_changeLayoutTemplate(String LayoutTemplatePath/*, String BitmapPath*/);
172cdf0e10cSrcweir 
173cdf0e10cSrcweir     /**
174cdf0e10cSrcweir      * Called if a new Template is selected
175cdf0e10cSrcweir      * @param ContentTemplatePath
176cdf0e10cSrcweir      */
liveupdate_changeContentTemplate(String ContentTemplatePath)177cdf0e10cSrcweir     public void liveupdate_changeContentTemplate(String ContentTemplatePath);
178cdf0e10cSrcweir 
179cdf0e10cSrcweir     //    public String[] getLayoutTemplates();
180cdf0e10cSrcweir     //    public String[] getContentTemplates();
layout_selectFirstPage()181cdf0e10cSrcweir     public void layout_selectFirstPage();
182cdf0e10cSrcweir 
layout_setupRecordSection(String TemplateName)183cdf0e10cSrcweir     public void layout_setupRecordSection(String TemplateName);
184cdf0e10cSrcweir     // -------------------------------------------------------------------------
185cdf0e10cSrcweir     // finishing
186*e904c4c2Smseidel     // -------------------------------------------------------------------------
187cdf0e10cSrcweir     // preview (update titlenames)
188cdf0e10cSrcweir     // addTextListener
189cdf0e10cSrcweir     /**
190cdf0e10cSrcweir      * Set the Title into the document from the 'Create Report Page'
191cdf0e10cSrcweir      * BUG: The Title is empty after create Report.
192cdf0e10cSrcweir      * @param _sTitleName
193cdf0e10cSrcweir      */
liveupdate_updateReportTitle(String _sTitleName)194cdf0e10cSrcweir     public void liveupdate_updateReportTitle(String _sTitleName);
195cdf0e10cSrcweir 
196cdf0e10cSrcweir     /**
197cdf0e10cSrcweir      * Store the document by the given name
198cdf0e10cSrcweir      * @param Name
199cdf0e10cSrcweir      * @param OpenMode
200cdf0e10cSrcweir      */
store(String Name, int OpenMode)201cdf0e10cSrcweir     public void store(String Name, int OpenMode) throws com.sun.star.uno.Exception;
202cdf0e10cSrcweir 
203cdf0e10cSrcweir     /**
204cdf0e10cSrcweir      * The current report is added to the DB View under the given name
205cdf0e10cSrcweir      *
206cdf0e10cSrcweir      * TODO: add Name to this functionality
207cdf0e10cSrcweir      */
addReportToDBView()208cdf0e10cSrcweir     public void addReportToDBView();
209cdf0e10cSrcweir 
importReportData(ReportWizard aWizard)210cdf0e10cSrcweir     public void importReportData(ReportWizard aWizard);
211cdf0e10cSrcweir 
212cdf0e10cSrcweir     /**
213cdf0e10cSrcweir      * Create the final Report document
214cdf0e10cSrcweir      * @param Name
215cdf0e10cSrcweir      * @param _bAsTemplate
216cdf0e10cSrcweir      * @param _bOpenInDesign
217cdf0e10cSrcweir      * @return
218cdf0e10cSrcweir      */
createAndOpenReportDocument( final String Name, final boolean _bAsTemplate, final boolean _bOpenInDesign )219cdf0e10cSrcweir     public void createAndOpenReportDocument(
220cdf0e10cSrcweir         final String Name,
221cdf0e10cSrcweir         final boolean _bAsTemplate,
222cdf0e10cSrcweir         final boolean _bOpenInDesign
223cdf0e10cSrcweir     );
224cdf0e10cSrcweir 
dispose()225cdf0e10cSrcweir     public void dispose();
226cdf0e10cSrcweir     // -------------------------------------------------------------------------
227cdf0e10cSrcweir     // Garbage dump
228*e904c4c2Smseidel     // -------------------------------------------------------------------------
229cdf0e10cSrcweir     /* DataImport */
230cdf0e10cSrcweir     // ???
231cdf0e10cSrcweir     // public void addTextSectionCopies();
232cdf0e10cSrcweir     // ???
reconnectToDatabase(XMultiServiceFactory xMSF, PropertyValue[] Properties)233cdf0e10cSrcweir     public boolean reconnectToDatabase(XMultiServiceFactory xMSF, PropertyValue[] Properties);
234cdf0e10cSrcweir     // ???
insertDatabaseDatatoReportDocument(XMultiServiceFactory xMSF)235cdf0e10cSrcweir     public void insertDatabaseDatatoReportDocument(XMultiServiceFactory xMSF);
236cdf0e10cSrcweir     // ???
237cdf0e10cSrcweir     // public com.sun.star.lang.XMultiServiceFactory getDocumentServiceFactory();
238cdf0e10cSrcweir     /**
239cdf0e10cSrcweir      * set a internal variable to stop a maybe longer DB access.
240cdf0e10cSrcweir      */
StopProcess()241cdf0e10cSrcweir     public void StopProcess(); // cancel
242cdf0e10cSrcweir 
243cdf0e10cSrcweir     /**
244cdf0e10cSrcweir      * Returns a string list of layouts.
245cdf0e10cSrcweir      * @return
246cdf0e10cSrcweir      */
getDataLayout()247cdf0e10cSrcweir     public String[][] getDataLayout();
248cdf0e10cSrcweir 
249cdf0e10cSrcweir     /**
250cdf0e10cSrcweir      * Returns a string list of header layouts
251cdf0e10cSrcweir      * @return
252cdf0e10cSrcweir      */
getHeaderLayout()253cdf0e10cSrcweir     public String[][] getHeaderLayout();
254cdf0e10cSrcweir 
setCommandType(int CommandType)255cdf0e10cSrcweir     public void setCommandType(int CommandType);
256cdf0e10cSrcweir 
setCommand(String Command)257cdf0e10cSrcweir     public void setCommand(String Command);
258cdf0e10cSrcweir 
259cdf0e10cSrcweir     /**
260cdf0e10cSrcweir      * check internal invariants
261*e904c4c2Smseidel      * @throws a
262cdf0e10cSrcweir      */
checkInvariants()263cdf0e10cSrcweir     public void checkInvariants() throws java.lang.Exception;
264cdf0e10cSrcweir }
265