summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/fax
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/com/sun/star/wizards/fax')
-rw-r--r--wizards/com/sun/star/wizards/fax/CGFax.java60
-rw-r--r--wizards/com/sun/star/wizards/fax/CGFaxWizard.java38
-rw-r--r--wizards/com/sun/star/wizards/fax/CallWizard.java257
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxDocument.java212
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialog.java628
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.java115
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java873
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.java182
-rw-r--r--wizards/com/sun/star/wizards/fax/MANIFEST.MF2
-rw-r--r--wizards/com/sun/star/wizards/fax/makefile.mk62
10 files changed, 2429 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/fax/CGFax.java b/wizards/com/sun/star/wizards/fax/CGFax.java
new file mode 100644
index 000000000000..067c4dce09f1
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/CGFax.java
@@ -0,0 +1,60 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import com.sun.star.wizards.common.ConfigGroup;
+
+public class CGFax extends ConfigGroup
+{
+
+ public int cp_Style;
+ public boolean cp_PrintCompanyLogo;
+ public boolean cp_PrintDate;
+ public boolean cp_PrintSubjectLine;
+ public boolean cp_PrintSalutation;
+ public boolean cp_PrintCommunicationType;
+ public boolean cp_PrintGreeting;
+ public boolean cp_PrintFooter;
+ public String cp_CommunicationType;
+ public String cp_Salutation;
+ public String cp_Greeting;
+ public int cp_SenderAddressType;
+ public String cp_SenderCompanyName;
+ public String cp_SenderStreet;
+ public String cp_SenderPostCode;
+ public String cp_SenderState;
+ public String cp_SenderCity;
+ public String cp_SenderFax;
+ public int cp_ReceiverAddressType;
+ public String cp_Footer;
+ public boolean cp_FooterOnlySecondPage;
+ public boolean cp_FooterPageNumbers;
+ public int cp_CreationType;
+ public String cp_TemplateName;
+ public String cp_TemplatePath;
+}
diff --git a/wizards/com/sun/star/wizards/fax/CGFaxWizard.java b/wizards/com/sun/star/wizards/fax/CGFaxWizard.java
new file mode 100644
index 000000000000..232d4ee8c163
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/CGFaxWizard.java
@@ -0,0 +1,38 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import com.sun.star.wizards.common.ConfigGroup;
+
+public class CGFaxWizard extends ConfigGroup
+{
+
+ public int cp_FaxType;
+ public CGFax cp_BusinessFax = new CGFax();
+ public CGFax cp_PrivateFax = new CGFax();
+}
diff --git a/wizards/com/sun/star/wizards/fax/CallWizard.java b/wizards/com/sun/star/wizards/fax/CallWizard.java
new file mode 100644
index 000000000000..b20dc0890e56
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/CallWizard.java
@@ -0,0 +1,257 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import com.sun.star.beans.XPropertyAccess;
+import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.lang.XTypeProvider;
+import com.sun.star.registry.XRegistryKey;
+import com.sun.star.task.XJob;
+import com.sun.star.task.XJobExecutor;
+import com.sun.star.uno.Type;
+
+/**
+ * This class capsulates the class, that implements the minimal component, a factory for
+ * creating the service (<CODE>__getServiceFactory</CODE>) and a method, that writes the
+ * information into the given registry key (<CODE>__writeRegistryServiceInfo</CODE>).
+ *
+ * @author $author$
+ * @version $Revision: 1.3.192.1 $
+ */
+public class CallWizard
+{
+
+ /**
+ * Gives a factory for creating the service. This method is called by the
+ * <code>JavaLoader</code>
+ *
+ * <p></p>
+ *
+ * @param stringImplementationName The implementation name of the component.
+ * @param xMSF The service manager, who gives access to every known service.
+ * @param xregistrykey Makes structural information (except regarding tree
+ * structures) of a single registry key accessible.
+ *
+ * @return Returns a <code>XSingleServiceFactory</code> for creating the component.
+ *
+ * @see com.sun.star.comp.loader.JavaLoader#
+ */
+ public static XSingleServiceFactory __getServiceFactory(String stringImplementationName, XMultiServiceFactory xMSF, XRegistryKey xregistrykey)
+ {
+ XSingleServiceFactory xsingleservicefactory = null;
+
+ if (stringImplementationName.equals(WizardImplementation.class.getName()))
+ {
+ xsingleservicefactory = FactoryHelper.getServiceFactory(WizardImplementation.class, WizardImplementation.__serviceName, xMSF, xregistrykey);
+ }
+
+ return xsingleservicefactory;
+ }
+
+ /**
+ * Writes the service information into the given registry key. This method is called
+ * by the <code>JavaLoader</code>.
+ *
+ * @param xregistrykey Makes structural information (except regarding tree
+ * structures) of a single registry key accessible.
+ *
+ * @return returns true if the operation succeeded
+ *
+ * @see com.sun.star.comp.loader.JavaLoader#
+ */
+ public static boolean __writeRegistryServiceInfo(XRegistryKey xregistrykey)
+ {
+ return FactoryHelper.writeRegistryServiceInfo(WizardImplementation.class.getName(), WizardImplementation.__serviceName, xregistrykey);
+ }
+
+ /**
+ * This class implements the component. At least the interfaces XServiceInfo,
+ * XTypeProvider, and XInitialization should be provided by the service.
+ */
+ public static class WizardImplementation implements XInitialization, XTypeProvider, XServiceInfo, XJobExecutor
+ {
+
+ /**
+ * The constructor of the inner class has a XMultiServiceFactory parameter.
+ *
+ * @param xmultiservicefactoryInitialization A special service factory could be
+ * introduced while initializing.
+ */
+ public WizardImplementation(XMultiServiceFactory xmultiservicefactoryInitialization)
+ {
+ xmultiservicefactory = xmultiservicefactoryInitialization;
+
+ if (xmultiservicefactory != null)
+ {
+ }
+ }
+
+ /**
+ * Execute Wizard
+ *
+ * @param str only valid parameter is 'start' at the moment.
+ */
+ public void trigger(String str)
+ {
+ if (str.equalsIgnoreCase("start"))
+ {
+ FaxWizardDialogImpl lw = new FaxWizardDialogImpl(xmultiservicefactory);
+ if (!FaxWizardDialogImpl.running)
+ {
+ lw.startWizard(xmultiservicefactory, null);
+ }
+ }
+ } //*******************************************
+ /**
+ * The service name, that must be used to get an instance of this service.
+ */
+ private static final String __serviceName = "com.sun.star.wizards.fax.CallWizard";
+ /**
+ * The service manager, that gives access to all registered services.
+ */
+ private XMultiServiceFactory xmultiservicefactory;
+
+ /**
+ * This method is a member of the interface for initializing an object directly
+ * after its creation.
+ *
+ * @param object This array of arbitrary objects will be passed to the component
+ * after its creation.
+ *
+ * @throws com.sun.star.uno.Exception Every exception will not be handled, but
+ * will be passed to the caller.
+ */
+ public void initialize(Object[] object) throws com.sun.star.uno.Exception
+ {
+ }
+
+ /**
+ * This method returns an array of all supported service names.
+ *
+ * @return Array of supported service names.
+ */
+ public java.lang.String[] getSupportedServiceNames()
+ {
+ String[] stringSupportedServiceNames = new String[1];
+ stringSupportedServiceNames[0] = __serviceName;
+
+ return (stringSupportedServiceNames);
+ }
+
+ /**
+ * This method returns true, if the given service will be supported by the
+ * component.
+ *
+ * @param stringService Service name.
+ *
+ * @return True, if the given service name will be supported.
+ */
+ public boolean supportsService(String stringService)
+ {
+ boolean booleanSupportsService = false;
+
+ if (stringService.equals(__serviceName))
+ {
+ booleanSupportsService = true;
+ }
+
+ return (booleanSupportsService);
+ }
+
+ /**
+ * This method returns an array of bytes, that can be used to unambiguously
+ * distinguish between two sets of types, e.g. to realise hashing functionality
+ * when the object is introspected. Two objects that return the same ID also
+ * have to return the same set of types in getTypes(). If an unique
+ * implementation Id cannot be provided this method has to return an empty
+ * sequence. Important: If the object aggregates other objects the ID has to be
+ * unique for the whole combination of objects.
+ *
+ * @return Array of bytes, in order to distinguish between two sets.
+ */
+ public byte[] getImplementationId()
+ {
+ byte[] byteReturn =
+ {
+ };
+
+ try
+ {
+ byteReturn = ("" + this.hashCode()).getBytes();
+ }
+ catch (Exception exception)
+ {
+ System.err.println(exception);
+ }
+
+ return (byteReturn);
+ }
+
+ /**
+ * Return the class name of the component.
+ *
+ * @return Class name of the component.
+ */
+ public java.lang.String getImplementationName()
+ {
+ return (WizardImplementation.class.getName());
+ }
+
+ /**
+ * Provides a sequence of all types (usually interface types) provided by the
+ * object.
+ *
+ * @return Sequence of all types (usually interface types) provided by the
+ * service.
+ */
+ public com.sun.star.uno.Type[] getTypes()
+ {
+ Type[] typeReturn =
+ {
+ };
+
+ try
+ {
+ typeReturn = new Type[]
+ {
+ new Type(XPropertyAccess.class), new Type(XJob.class), new Type(XJobExecutor.class), new Type(XTypeProvider.class), new Type(XServiceInfo.class), new Type(XInitialization.class)
+ };
+ }
+ catch (Exception exception)
+ {
+ System.err.println(exception);
+ }
+
+ return (typeReturn);
+ }
+ }
+}
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.java b/wizards/com/sun/star/wizards/fax/FaxDocument.java
new file mode 100644
index 000000000000..8eafbed257d1
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/FaxDocument.java
@@ -0,0 +1,212 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import com.sun.star.wizards.common.*;
+import com.sun.star.wizards.text.*;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XTerminateListener;
+import com.sun.star.text.*;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.style.NumberingType;
+import com.sun.star.style.ParagraphAdjust;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.style.XStyle;
+
+public class FaxDocument extends TextDocument
+{
+
+ XDesktop xDesktop;
+ boolean keepLogoFrame = true;
+ boolean keepTypeFrame = true;
+
+ public FaxDocument(XMultiServiceFactory xMSF, XTerminateListener listener)
+ {
+ super(xMSF, listener, "WIZARD_LIVE_PREVIEW");
+ }
+
+ public XWindowPeer getWindowPeer()
+ {
+ XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xTextDocument);
+ return xWindowPeer;
+ }
+
+ public void switchElement(String sElement, boolean bState)
+ {
+ try
+ {
+ TextSectionHandler mySectionHandler = new TextSectionHandler(xMSF, xTextDocument);
+ Object oSection = mySectionHandler.xTextSectionsSupplier.getTextSections().getByName(sElement);
+ Helper.setUnoPropertyValue(oSection, "IsVisible", new Boolean(bState));
+
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace(System.out);
+ }
+ }
+
+ public void updateDateFields()
+ {
+ TextFieldHandler FH = new TextFieldHandler(xMSFDoc, xTextDocument);
+ FH.updateDateFields();
+ }
+
+ public void switchFooter(String sPageStyle, boolean bState, boolean bPageNumber, String sText)
+ {
+ if (xTextDocument != null)
+ {
+ xTextDocument.lockControllers();
+ try
+ {
+ XStyleFamiliesSupplier xStyleFamiliesSupplier = (XStyleFamiliesSupplier) com.sun.star.uno.UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument);
+ com.sun.star.container.XNameAccess xNameAccess = null;
+ xNameAccess = xStyleFamiliesSupplier.getStyleFamilies();
+
+ com.sun.star.container.XNameContainer xPageStyleCollection = null;
+ xPageStyleCollection = (com.sun.star.container.XNameContainer) UnoRuntime.queryInterface(com.sun.star.container.XNameContainer.class, xNameAccess.getByName("PageStyles"));
+
+ XText xFooterText;
+ XStyle xPageStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class, xPageStyleCollection.getByName(sPageStyle));
+
+ if (bState)
+ {
+ Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", new Boolean(true));
+ xFooterText = (XText) UnoRuntime.queryInterface(XText.class, Helper.getUnoPropertyValue(xPageStyle, "FooterText"));
+ xFooterText.setString(sText);
+ if (bPageNumber)
+ {
+ //Adding the Page Number
+ XTextCursor myCursor = xFooterText.createTextCursor();
+ myCursor.gotoEnd(false);
+ xFooterText.insertControlCharacter(myCursor, ControlCharacter.PARAGRAPH_BREAK, false);
+ XPropertySet xCursorPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, myCursor);
+ xCursorPSet.setPropertyValue("ParaAdjust", ParagraphAdjust.CENTER);
+ XTextField xPageNumberField = (XTextField) UnoRuntime.queryInterface(XTextField.class, xMSFDoc.createInstance("com.sun.star.text.TextField.PageNumber"));
+ XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPageNumberField);
+ xPSet.setPropertyValue("SubType", PageNumberType.CURRENT);
+ xPSet.setPropertyValue("NumberingType", new Short(NumberingType.ARABIC));
+ xFooterText.insertTextContent(xFooterText.getEnd(), xPageNumberField, false);
+ }
+ }
+ else
+ {
+ Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", new Boolean(false));
+ }
+ xTextDocument.unlockControllers();
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace(System.out);
+ }
+ }
+ }
+
+ public boolean hasElement(String sElement)
+ {
+ if (xTextDocument != null)
+ {
+ TextSectionHandler mySectionHandler = new TextSectionHandler(xMSF, xTextDocument);
+ return mySectionHandler.hasTextSectionByName(sElement);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public void switchUserField(String sFieldName, String sNewContent, boolean bState)
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(xMSF, xTextDocument);
+ if (bState)
+ {
+ myFieldHandler.changeUserFieldContent(sFieldName, sNewContent);
+ }
+ else
+ {
+ myFieldHandler.changeUserFieldContent(sFieldName, "");
+ }
+ }
+
+ public void fillSenderWithUserData()
+ {
+ try
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(xMSFDoc, xTextDocument);
+ Object oUserDataAccess = Configuration.getConfigurationRoot(xMSF, "org.openoffice.UserProfile/Data", false);
+ myFieldHandler.changeUserFieldContent("Company", (String) Helper.getUnoObjectbyName(oUserDataAccess, "o"));
+ myFieldHandler.changeUserFieldContent("Street", (String) Helper.getUnoObjectbyName(oUserDataAccess, "street"));
+ myFieldHandler.changeUserFieldContent("PostCode", (String) Helper.getUnoObjectbyName(oUserDataAccess, "postalcode"));
+ myFieldHandler.changeUserFieldContent("State", (String) Helper.getUnoObjectbyName(oUserDataAccess, "st"));
+ myFieldHandler.changeUserFieldContent("City", (String) Helper.getUnoObjectbyName(oUserDataAccess, "l"));
+ myFieldHandler.changeUserFieldContent("Fax", (String) Helper.getUnoObjectbyName(oUserDataAccess, "facsimiletelephonenumber"));
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace(System.out);
+ }
+ }
+
+ public void killEmptyUserFields()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(xMSF, xTextDocument);
+ myFieldHandler.removeUserFieldByContent("");
+ }
+
+ public void killEmptyFrames()
+ {
+ try
+ {
+ if (!keepLogoFrame)
+ {
+ XTextFrame xTF = TextFrameHandler.getFrameByName("Company Logo", xTextDocument);
+ if (xTF != null)
+ {
+ xTF.dispose();
+ }
+ }
+ if (!keepTypeFrame)
+ {
+ XTextFrame xTF = TextFrameHandler.getFrameByName("Communication Type", xTextDocument);
+ if (xTF != null)
+ {
+ xTF.dispose();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+}
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java
new file mode 100644
index 000000000000..8c81ba5e5fec
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.java
@@ -0,0 +1,628 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import com.sun.star.awt.*;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.wizards.common.*;
+import com.sun.star.wizards.ui.*;
+
+public abstract class FaxWizardDialog extends WizardDialog implements FaxWizardDialogConst, UIConsts
+{
+
+ XRadioButton optBusinessFax;
+ XListBox lstBusinessStyle;
+ XRadioButton optPrivateFax;
+ XListBox lstPrivateStyle;
+ XFixedText lblBusinessStyle;
+ XFixedText lblTitle1;
+ XFixedText lblPrivateStyle;
+ XFixedText lblIntroduction;
+ //Image Control
+ XControl ImageControl3;
+ XCheckBox chkUseLogo;
+ XCheckBox chkUseDate;
+ XCheckBox chkUseCommunicationType;
+ XComboBox lstCommunicationType;
+ XCheckBox chkUseSubject;
+ XCheckBox chkUseSalutation;
+ XComboBox lstSalutation;
+ XCheckBox chkUseGreeting;
+ XComboBox lstGreeting;
+ XCheckBox chkUseFooter;
+ XFixedText lblTitle3;
+ XRadioButton optSenderPlaceholder;
+ XRadioButton optSenderDefine;
+ XTextComponent txtSenderName;
+ XTextComponent txtSenderStreet;
+ XTextComponent txtSenderPostCode;
+ XTextComponent txtSenderState;
+ XTextComponent txtSenderCity;
+ XTextComponent txtSenderFax;
+ XRadioButton optReceiverDatabase;
+ XRadioButton optReceiverPlaceholder;
+ XFixedText lblSenderAddress;
+ //Fixed Line
+ XControl FixedLine2;
+ XFixedText lblSenderName;
+ XFixedText lblSenderStreet;
+ XFixedText lblPostCodeCity;
+ XFixedText lblTitle4;
+ XFixedText Label1;
+ XFixedText Label2;
+ XTextComponent txtFooter;
+ XCheckBox chkFooterNextPages;
+ XCheckBox chkFooterPageNumbers;
+ XFixedText lblFooter;
+ XFixedText lblTitle5;
+ XTextComponent txtTemplateName;
+ //File Control
+ XControl fileTemplatePath;
+ XRadioButton optCreateFax;
+ XRadioButton optMakeChanges;
+ XFixedText lblFinalExplanation1;
+ XFixedText lblProceed;
+ XFixedText lblFinalExplanation2;
+ //Image Control
+ XControl ImageControl2;
+ XFixedText lblTemplateName;
+ XFixedText lblTemplatePath;
+ XFixedText lblTitle6;
+ XFixedText Label9;
+ //Font Descriptors as Class members.
+ FontDescriptor fontDescriptor1 = new FontDescriptor();
+ FontDescriptor fontDescriptor2 = new FontDescriptor();
+ FontDescriptor fontDescriptor4 = new FontDescriptor();
+ FontDescriptor fontDescriptor5 = new FontDescriptor(); //Resources Object
+ FaxWizardDialogResources resources;
+
+ public FaxWizardDialog(XMultiServiceFactory xmsf)
+ {
+ super(xmsf, HIDMAIN);
+ //Load Resources
+ resources = new FaxWizardDialogResources(xmsf);
+
+
+ //set dialog properties...
+ Helper.setUnoPropertyValues(xDialogModel,
+ new String[]
+ {
+ "Closeable", "Height", "Moveable", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width"
+ },
+ new Object[]
+ {
+ Boolean.TRUE, new Integer(210), Boolean.TRUE, new Integer(104), new Integer(52), INTEGERS[1], new Short((short) 1), resources.resFaxWizardDialog_title, new Integer(310)
+ });
+
+
+
+ //Set member- FontDescriptors...
+ fontDescriptor1.Weight = 150;
+ fontDescriptor1.Underline = com.sun.star.awt.FontUnderline.SINGLE;
+ fontDescriptor2.Weight = 100;
+ fontDescriptor4.Weight = 100;
+ fontDescriptor5.Weight = 150;
+ }
+ //build components
+ public void buildStep1()
+ {
+ optBusinessFax = insertRadioButton("optBusinessFax", OPTBUSINESSFAX_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTBUSINESSFAX_HID, resources.resoptBusinessFax_value, new Integer(97), new Integer(28), INTEGERS[1], new Short((short) 1), new Integer(184)
+ });
+ lstBusinessStyle = insertListBox("lstBusinessStyle", LSTBUSINESSSTYLE_ACTION_PERFORMED, LSTBUSINESSSTYLE_ITEM_CHANGED,
+ new String[]
+ {
+ "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ Boolean.TRUE, INTEGER_12, LSTBUSINESSSTYLE_HID, new Integer(180), INTEGER_40, INTEGERS[1], new Short((short) 3), new Integer(74)
+ });
+ optPrivateFax = insertRadioButton("optPrivateFax", OPTPRIVATEFAX_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTPRIVATEFAX_HID, resources.resoptPrivateFax_value, new Integer(97), new Integer(81), INTEGERS[1], new Short((short) 2), new Integer(184)
+ });
+ lstPrivateStyle = insertListBox("lstPrivateStyle", LSTPRIVATESTYLE_ACTION_PERFORMED, LSTPRIVATESTYLE_ITEM_CHANGED,
+ new String[]
+ {
+ "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ Boolean.TRUE, INTEGER_12, LSTPRIVATESTYLE_HID, new Integer(180), new Integer(95), INTEGERS[1], new Short((short) 4), new Integer(74)
+ });
+ lblBusinessStyle = insertLabel("lblBusinessStyle",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblBusinessStyle_value, new Integer(110), new Integer(42), INTEGERS[1], new Short((short) 32), new Integer(60)
+ });
+ lblTitle1 = insertLabel("lblTitle1",
+ new String[]
+ {
+ "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ fontDescriptor5, INTEGER_16, resources.reslblTitle1_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[1], new Short((short) 37), new Integer(212)
+ });
+ lblPrivateStyle = insertLabel("lblPrivateStyle",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblPrivateStyle_value, new Integer(110), new Integer(95), INTEGERS[1], new Short((short) 50), new Integer(60)
+ });
+ lblIntroduction = insertLabel("lblIntroduction",
+ new String[]
+ {
+ "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ new Integer(39), resources.reslblIntroduction_value, Boolean.TRUE, new Integer(104), new Integer(145), INTEGERS[1], new Short((short) 55), new Integer(199)
+ });
+ ImageControl3 = insertInfoImage(92, 145, 1);
+// ImageControl3 = insertImage("ImageControl3",
+// new String[] {"Border", "Height", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"},
+// new Object[] { new Short((short)0),INTEGERS[10],"private:resource/dbu/image/19205",new Integer(92),new Integer(145),Boolean.FALSE,INTEGERS[1],new Short((short)56),INTEGERS[10]}
+// );
+ }
+
+ public void buildStep2()
+ {
+ chkUseLogo = insertCheckBox("chkUseLogo", CHKUSELOGO_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSELOGO_HID, resources.reschkUseLogo_value, new Integer(97), new Integer(28), new Short((short) 0), INTEGERS[2], new Short((short) 5), new Integer(212)
+ });
+ chkUseDate = insertCheckBox("chkUseDate", CHKUSEDATE_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSEDATE_HID, resources.reschkUseDate_value, new Integer(97), new Integer(43), new Short((short) 0), INTEGERS[2], new Short((short) 6), new Integer(212)
+ });
+ chkUseCommunicationType = insertCheckBox("chkUseCommunicationType", CHKUSECOMMUNICATIONTYPE_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSECOMMUNICATIONTYPE_HID, resources.reschkUseCommunicationType_value, new Integer(97), new Integer(57), new Short((short) 0), INTEGERS[2], new Short((short) 7), new Integer(100)
+ });
+ lstCommunicationType = insertComboBox("lstCommunicationType", LSTCOMMUNICATIONTYPE_ACTION_PERFORMED, LSTCOMMUNICATIONTYPE_ITEM_CHANGED, LSTCOMMUNICATIONTYPE_TEXT_CHANGED,
+ new String[]
+ {
+ "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ Boolean.TRUE, INTEGER_12, LSTCOMMUNICATIONTYPE_HID, new Integer(105), new Integer(68), INTEGERS[2], new Short((short) 8), new Integer(174)
+ });
+ chkUseSubject = insertCheckBox("chkUseSubject", CHKUSESUBJECT_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSESUBJECT_HID, resources.reschkUseSubject_value, new Integer(97), new Integer(87), new Short((short) 0), INTEGERS[2], new Short((short) 9), new Integer(212)
+ });
+ chkUseSalutation = insertCheckBox("chkUseSalutation", CHKUSESALUTATION_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSESALUTATION_HID, resources.reschkUseSalutation_value, new Integer(97), new Integer(102), new Short((short) 0), INTEGERS[2], new Short((short) 10), new Integer(100)
+ });
+ lstSalutation = insertComboBox("lstSalutation", LSTSALUTATION_ACTION_PERFORMED, LSTSALUTATION_ITEM_CHANGED, LSTSALUTATION_TEXT_CHANGED,
+ new String[]
+ {
+ "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ Boolean.TRUE, INTEGER_12, LSTSALUTATION_HID, new Integer(105), new Integer(113), INTEGERS[2], new Short((short) 11), new Integer(174)
+ });
+ chkUseGreeting = insertCheckBox("chkUseGreeting", CHKUSEGREETING_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSEGREETING_HID, resources.reschkUseGreeting_value, new Integer(97), new Integer(132), new Short((short) 0), INTEGERS[2], new Short((short) 12), new Integer(100)
+ });
+ lstGreeting = insertComboBox("lstGreeting", LSTGREETING_ACTION_PERFORMED, LSTGREETING_ITEM_CHANGED, LSTGREETING_TEXT_CHANGED,
+ new String[]
+ {
+ "Dropdown", "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ Boolean.TRUE, INTEGER_12, LSTGREETING_HID, new Integer(105), new Integer(143), INTEGERS[2], new Short((short) 13), new Integer(174)
+ });
+ chkUseFooter = insertCheckBox("chkUseFooter", CHKUSEFOOTER_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKUSEFOOTER_HID, resources.reschkUseFooter_value, new Integer(97), new Integer(163), new Short((short) 0), INTEGERS[2], new Short((short) 14), new Integer(212)
+ });
+ lblTitle3 = insertLabel("lblTitle3",
+ new String[]
+ {
+ "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ fontDescriptor5, INTEGER_16, resources.reslblTitle3_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[2], new Short((short) 59), new Integer(212)
+ });
+ }
+
+ public void buildStep3()
+ {
+ optSenderPlaceholder = insertRadioButton("optSenderPlaceholder", OPTSENDERPLACEHOLDER_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTSENDERPLACEHOLDER_HID, resources.resoptSenderPlaceholder_value, new Integer(104), new Integer(42), INTEGERS[3], new Short((short) 15), new Integer(149)
+ });
+ optSenderDefine = insertRadioButton("optSenderDefine", OPTSENDERDEFINE_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTSENDERDEFINE_HID, resources.resoptSenderDefine_value, new Integer(104), new Integer(54), INTEGERS[3], new Short((short) 16), new Integer(149)
+ });
+ txtSenderName = insertTextField("txtSenderName", TXTSENDERNAME_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTSENDERNAME_HID, new Integer(182), new Integer(67), INTEGERS[3], new Short((short) 17), new Integer(119)
+ });
+ txtSenderStreet = insertTextField("txtSenderStreet", TXTSENDERSTREET_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTSENDERSTREET_HID, new Integer(182), new Integer(81), INTEGERS[3], new Short((short) 18), new Integer(119)
+ });
+ txtSenderPostCode = insertTextField("txtSenderPostCode", TXTSENDERPOSTCODE_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTSENDERPOSTCODE_HID, new Integer(182), new Integer(95), INTEGERS[3], new Short((short) 19), new Integer(25)
+ });
+ txtSenderState = insertTextField("txtSenderState", TXTSENDERSTATE_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTSENDERSTATE_HID, new Integer(211), new Integer(95), INTEGERS[3], new Short((short) 20), new Integer(21)
+ });
+ txtSenderCity = insertTextField("txtSenderCity", TXTSENDERCITY_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTSENDERCITY_HID, new Integer(236), new Integer(95), INTEGERS[3], new Short((short) 21), new Integer(65)
+ });
+ txtSenderFax = insertTextField("txtSenderFax", TXTSENDERFAX_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTSENDERFAX_HID, new Integer(182), new Integer(109), INTEGERS[3], new Short((short) 22), new Integer(119)
+ });
+ optReceiverPlaceholder = insertRadioButton("optReceiverPlaceholder", OPTRECEIVERPLACEHOLDER_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTRECEIVERPLACEHOLDER_HID, resources.resoptReceiverPlaceholder_value, new Integer(104), new Integer(148), INTEGERS[3], new Short((short) 23), new Integer(200)
+ });
+ optReceiverDatabase = insertRadioButton("optReceiverDatabase", OPTRECEIVERDATABASE_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTRECEIVERDATABASE_HID, resources.resoptReceiverDatabase_value, new Integer(104), new Integer(160), INTEGERS[3], new Short((short) 24), new Integer(200)
+ });
+ lblSenderAddress = insertLabel("lblSenderAddress",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblSenderAddress_value, new Integer(97), new Integer(28), INTEGERS[3], new Short((short) 46), new Integer(136)
+ });
+ FixedLine2 = insertFixedLine("FixedLine2",
+ new String[]
+ {
+ "Height", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[5], new Integer(90), new Integer(126), INTEGERS[3], new Short((short) 51), new Integer(212)
+ });
+ lblSenderName = insertLabel("lblSenderName",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblSenderName_value, new Integer(113), new Integer(69), INTEGERS[3], new Short((short) 52), new Integer(68)
+ });
+ lblSenderStreet = insertLabel("lblSenderStreet",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblSenderStreet_value, new Integer(113), new Integer(82), INTEGERS[3], new Short((short) 53), new Integer(68)
+ });
+ lblPostCodeCity = insertLabel("lblPostCodeCity",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblPostCodeCity_value, new Integer(113), new Integer(97), INTEGERS[3], new Short((short) 54), new Integer(68)
+ });
+ lblTitle4 = insertLabel("lblTitle4",
+ new String[]
+ {
+ "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ fontDescriptor5, INTEGER_16, resources.reslblTitle4_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[3], new Short((short) 60), new Integer(212)
+ });
+ Label1 = insertLabel("lblSenderFax",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.resLabel1_value, new Integer(113), new Integer(111), INTEGERS[3], new Short((short) 68), new Integer(68)
+ });
+ Label2 = insertLabel("Label2",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.resLabel2_value, new Integer(97), new Integer(137), INTEGERS[3], new Short((short) 69), new Integer(136)
+ });
+ }
+
+ public void buildStep4()
+ {
+ txtFooter = insertTextField("txtFooter", TXTFOOTER_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ new Integer(47), TXTFOOTER_HID, Boolean.TRUE, new Integer(97), INTEGER_40, INTEGERS[4], new Short((short) 25), new Integer(203)
+ });
+ chkFooterNextPages = insertCheckBox("chkFooterNextPages", CHKFOOTERNEXTPAGES_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKFOOTERNEXTPAGES_HID, resources.reschkFooterNextPages_value, new Integer(97), new Integer(92), new Short((short) 0), INTEGERS[4], new Short((short) 26), new Integer(202)
+ });
+ chkFooterPageNumbers = insertCheckBox("chkFooterPageNumbers", CHKFOOTERPAGENUMBERS_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "State", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], CHKFOOTERPAGENUMBERS_HID, resources.reschkFooterPageNumbers_value, new Integer(97), new Integer(106), new Short((short) 0), INTEGERS[4], new Short((short) 27), new Integer(201)
+ });
+ lblFooter = insertLabel("lblFooter",
+ new String[]
+ {
+ "FontDescriptor", "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ fontDescriptor4, INTEGERS[8], resources.reslblFooter_value, new Integer(97), new Integer(28), INTEGERS[4], new Short((short) 33), new Integer(116)
+ });
+ lblTitle5 = insertLabel("lblTitle5",
+ new String[]
+ {
+ "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ fontDescriptor5, INTEGER_16, resources.reslblTitle5_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[4], new Short((short) 61), new Integer(212)
+ });
+ }
+
+ public void buildStep5()
+ {
+ txtTemplateName = insertTextField("txtTemplateName", TXTTEMPLATENAME_TEXT_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Text", "Width"
+ },
+ new Object[]
+ {
+ INTEGER_12, TXTTEMPLATENAME_HID, new Integer(202), new Integer(56), INTEGERS[5], new Short((short) 28), resources.restxtTemplateName_value, new Integer(100)
+ });
+ /*
+ fileTemplatePath = insertFileControl("fileTemplatePath", FILETEMPLATEPATH_TEXT_CHANGED,
+ new String[] {"Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"},
+ new Object[] { INTEGER_12,FILETEMPLATEPATH_HID,new Integer(172),new Integer(74),INTEGERS[5],new Short((short)29),new Integer(130)}
+ );
+ */
+ optCreateFax = insertRadioButton("optCreateFax", OPTCREATEFAX_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTCREATEFAX_HID, resources.resoptCreateFax_value, new Integer(104), new Integer(111), INTEGERS[5], new Short((short) 30), new Integer(198)
+ });
+ optMakeChanges = insertRadioButton("optMakeChanges", OPTMAKECHANGES_ITEM_CHANGED,
+ new String[]
+ {
+ "Height", "HelpURL", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], OPTMAKECHANGES_HID, resources.resoptMakeChanges_value, new Integer(104), new Integer(123), INTEGERS[5], new Short((short) 31), new Integer(198)
+ });
+ lblFinalExplanation1 = insertLabel("lblFinalExplanation1",
+ new String[]
+ {
+ "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ new Integer(28), resources.reslblFinalExplanation1_value, Boolean.TRUE, new Integer(97), new Integer(28), INTEGERS[5], new Short((short) 34), new Integer(205)
+ });
+ lblProceed = insertLabel("lblProceed",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblProceed_value, new Integer(97), new Integer(100), INTEGERS[5], new Short((short) 35), new Integer(204)
+ });
+ lblFinalExplanation2 = insertLabel("lblFinalExplanation2",
+ new String[]
+ {
+ "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ new Integer(33), resources.reslblFinalExplanation2_value, Boolean.TRUE, new Integer(104), new Integer(145), INTEGERS[5], new Short((short) 36), new Integer(199)
+ });
+ ImageControl2 = insertImage("ImageControl2",
+ new String[]
+ {
+ "Border", "Height", "ImageURL", "PositionX", "PositionY", "ScaleImage", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ new Short((short) 0), INTEGERS[10], "private:resource/dbu/image/19205", new Integer(92), new Integer(145), Boolean.FALSE, INTEGERS[5], new Short((short) 47), INTEGERS[10]
+ });
+ lblTemplateName = insertLabel("lblTemplateName",
+ new String[]
+ {
+ "Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ INTEGERS[8], resources.reslblTemplateName_value, new Integer(97), new Integer(58), INTEGERS[5], new Short((short) 57), new Integer(101)
+ });
+ /*
+ lblTemplatePath = insertLabel("lblTemplatePath",
+ new String[] {"Height", "Label", "PositionX", "PositionY", "Step", "TabIndex", "Width"},
+ new Object[] { INTEGERS[8],resources.reslblTemplatePath_value,new Integer(97),new Integer(77),INTEGERS[5],new Short((short)58),new Integer(71)}
+ );
+ */
+ lblTitle6 = insertLabel("lblTitle6",
+ new String[]
+ {
+ "FontDescriptor", "Height", "Label", "MultiLine", "PositionX", "PositionY", "Step", "TabIndex", "Width"
+ },
+ new Object[]
+ {
+ fontDescriptor5, INTEGER_16, resources.reslblTitle6_value, Boolean.TRUE, new Integer(91), INTEGERS[8], INTEGERS[5], new Short((short) 62), new Integer(212)
+ });
+
+ }
+} \ No newline at end of file
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.java
new file mode 100644
index 000000000000..743173373b54
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.java
@@ -0,0 +1,115 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+public interface FaxWizardDialogConst
+{
+
+ public static final String OPTBUSINESSFAX_ITEM_CHANGED = "optBusinessFaxItemChanged";
+ public static final String LSTBUSINESSSTYLE_ACTION_PERFORMED = null; // "lstBusinessStyleActionPerformed";
+ public static final String LSTBUSINESSSTYLE_ITEM_CHANGED = "lstBusinessStyleItemChanged";
+ public static final String OPTPRIVATEFAX_ITEM_CHANGED = "optPrivateFaxItemChanged";
+ public static final String LSTPRIVATESTYLE_ACTION_PERFORMED = null; // "lstPrivateStyleActionPerformed";
+ public static final String LSTPRIVATESTYLE_ITEM_CHANGED = "lstPrivateStyleItemChanged";
+ public static final String CHKUSELOGO_ITEM_CHANGED = "chkUseLogoItemChanged";
+ public static final String CHKUSEDATE_ITEM_CHANGED = "chkUseDateItemChanged";
+ public static final String CHKUSECOMMUNICATIONTYPE_ITEM_CHANGED = "chkUseCommunicationItemChanged";
+ public static final String LSTCOMMUNICATIONTYPE_ACTION_PERFORMED = null; // "lstCommunicationActionPerformed";
+ public static final String LSTCOMMUNICATIONTYPE_ITEM_CHANGED = "lstCommunicationItemChanged";
+ public static final String LSTCOMMUNICATIONTYPE_TEXT_CHANGED = "lstCommunicationTextChanged";
+ public static final String CHKUSESUBJECT_ITEM_CHANGED = "chkUseSubjectItemChanged";
+ public static final String CHKUSESALUTATION_ITEM_CHANGED = "chkUseSalutationItemChanged";
+ public static final String LSTSALUTATION_ACTION_PERFORMED = null; // "lstSalutationActionPerformed";
+ public static final String LSTSALUTATION_ITEM_CHANGED = "lstSalutationItemChanged";
+ public static final String LSTSALUTATION_TEXT_CHANGED = "lstSalutationTextChanged";
+ public static final String CHKUSEGREETING_ITEM_CHANGED = "chkUseGreetingItemChanged";
+ public static final String LSTGREETING_ACTION_PERFORMED = null; // "lstGreetingActionPerformed";
+ public static final String LSTGREETING_ITEM_CHANGED = "lstGreetingItemChanged";
+ public static final String LSTGREETING_TEXT_CHANGED = "lstGreetingTextChanged";
+ public static final String CHKUSEFOOTER_ITEM_CHANGED = "chkUseFooterItemChanged";
+ public static final String OPTSENDERPLACEHOLDER_ITEM_CHANGED = "optSenderPlaceholderItemChanged";
+ public static final String OPTSENDERDEFINE_ITEM_CHANGED = "optSenderDefineItemChanged";
+ public static final String TXTSENDERNAME_TEXT_CHANGED = "txtSenderNameTextChanged";
+ public static final String TXTSENDERSTREET_TEXT_CHANGED = "txtSenderStreetTextChanged";
+ public static final String TXTSENDERPOSTCODE_TEXT_CHANGED = "txtSenderPostCodeTextChanged";
+ public static final String TXTSENDERSTATE_TEXT_CHANGED = "txtSenderStateTextChanged";
+ public static final String TXTSENDERCITY_TEXT_CHANGED = "txtSenderCityTextChanged";
+ public static final String TXTSENDERFAX_TEXT_CHANGED = "txtSenderFaxTextChanged";
+ public static final String OPTRECEIVERPLACEHOLDER_ITEM_CHANGED = "optReceiverPlaceholderItemChanged";
+ public static final String OPTRECEIVERDATABASE_ITEM_CHANGED = "optReceiverDatabaseItemChanged";
+ public static final String TXTFOOTER_TEXT_CHANGED = "txtFooterTextChanged";
+ public static final String CHKFOOTERNEXTPAGES_ITEM_CHANGED = "chkFooterNextPagesItemChanged";
+ public static final String CHKFOOTERPAGENUMBERS_ITEM_CHANGED = "chkFooterPageNumbersItemChanged";
+ public static final String TXTTEMPLATENAME_TEXT_CHANGED = "txtTemplateNameTextChanged";
+ public static final String FILETEMPLATEPATH_TEXT_CHANGED = null; // "fileTemplatePathTextChanged";
+ public static final String OPTCREATEFAX_ITEM_CHANGED = "optCreateFaxItemChanged";
+ public static final String OPTMAKECHANGES_ITEM_CHANGED = "optMakeChangesItemChanged";
+ public static final String imageURLImageControl2 = null; //"images/ImageControl2";
+ public static final String imageURLImageControl3 = null; //"images/ImageControl3";
+
+ /* ====================================
+ * Help IDs
+ * ====================================
+ */
+ public final static int HID = 41119; //TODO enter first hid here
+ public static final int HIDMAIN = 41180;
+ public final String OPTBUSINESSFAX_HID = "HID:" + (HID + 1);
+ public final String LSTBUSINESSSTYLE_HID = "HID:" + (HID + 2);
+ public final String OPTPRIVATEFAX_HID = "HID:" + (HID + 3);
+ public final String LSTPRIVATESTYLE_HID = "HID:" + (HID + 4);
+ public final String IMAGECONTROL3_HID = "HID:" + (HID + 5);
+ public final String CHKUSELOGO_HID = "HID:" + (HID + 6);
+ public final String CHKUSEDATE_HID = "HID:" + (HID + 7);
+ public final String CHKUSECOMMUNICATIONTYPE_HID = "HID:" + (HID + 8);
+ public final String LSTCOMMUNICATIONTYPE_HID = "HID:" + (HID + 9);
+ public final String CHKUSESUBJECT_HID = "HID:" + (HID + 10);
+ public final String CHKUSESALUTATION_HID = "HID:" + (HID + 11);
+ public final String LSTSALUTATION_HID = "HID:" + (HID + 12);
+ public final String CHKUSEGREETING_HID = "HID:" + (HID + 13);
+ public final String LSTGREETING_HID = "HID:" + (HID + 14);
+ public final String CHKUSEFOOTER_HID = "HID:" + (HID + 15);
+ public final String OPTSENDERPLACEHOLDER_HID = "HID:" + (HID + 16);
+ public final String OPTSENDERDEFINE_HID = "HID:" + (HID + 17);
+ public final String TXTSENDERNAME_HID = "HID:" + (HID + 18);
+ public final String TXTSENDERSTREET_HID = "HID:" + (HID + 19);
+ public final String TXTSENDERPOSTCODE_HID = "HID:" + (HID + 20);
+ public final String TXTSENDERSTATE_HID = "HID:" + (HID + 21);
+ public final String TXTSENDERCITY_HID = "HID:" + (HID + 22);
+ public final String TXTSENDERFAX_HID = "HID:" + (HID + 23);
+ public final String OPTRECEIVERPLACEHOLDER_HID = "HID:" + (HID + 24);
+ public final String OPTRECEIVERDATABASE_HID = "HID:" + (HID + 25);
+ public final String TXTFOOTER_HID = "HID:" + (HID + 26);
+ public final String CHKFOOTERNEXTPAGES_HID = "HID:" + (HID + 27);
+ public final String CHKFOOTERPAGENUMBERS_HID = "HID:" + (HID + 28);
+ public final String TXTTEMPLATENAME_HID = "HID:" + (HID + 29);
+ public final String FILETEMPLATEPATH_HID = "HID:" + (HID + 30);
+ public final String OPTCREATEFAX_HID = "HID:" + (HID + 31);
+ public final String OPTMAKECHANGES_HID = "HID:" + (HID + 32);
+ public final String IMAGECONTROL2_HID = "HID:" + (HID + 33);
+}
+ \ No newline at end of file
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
new file mode 100644
index 000000000000..dac35cabc04a
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java
@@ -0,0 +1,873 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import java.util.Vector;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.wizards.common.Desktop;
+import com.sun.star.wizards.common.NoValidPathException;
+import com.sun.star.wizards.common.SystemDialog;
+import com.sun.star.awt.VclWindowPeerAttribute;
+import com.sun.star.awt.XTextComponent;
+import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.document.XDocumentProperties;
+import com.sun.star.document.XDocumentPropertiesSupplier;
+import com.sun.star.graphic.XGraphicProvider;
+import com.sun.star.graphic.XGraphic;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.RuntimeException;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.wizards.text.*;
+import com.sun.star.wizards.common.*;
+import com.sun.star.task.XInteractionHandler;
+import com.sun.star.text.XTextDocument;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.CloseVetoException;
+import com.sun.star.util.XCloseable;
+import com.sun.star.wizards.document.*;
+import com.sun.star.wizards.ui.*;
+import com.sun.star.wizards.ui.event.*;
+import com.sun.star.wizards.common.Helper;
+import com.sun.star.document.MacroExecMode;
+
+public class FaxWizardDialogImpl extends FaxWizardDialog
+{
+
+ protected void enterStep(int OldStep, int NewStep)
+ {
+ }
+
+ protected void leaveStep(int OldStep, int NewStep)
+ {
+ }
+ static FaxDocument myFaxDoc;
+ static boolean running;
+ XTextDocument xTextDocument;
+ PathSelection myPathSelection;
+ CGFaxWizard myConfig;
+ Vector mainDA = new Vector();
+ Vector faxDA = new Vector();
+ String[][] BusinessFiles;
+ String[][] PrivateFiles;
+ String sTemplatePath;
+ String sUserTemplatePath;
+ String sBitmapPath;
+ String sFaxPath;
+ String sWorkPath;
+ String sPath;
+ boolean bEditTemplate;
+ boolean bSaveSuccess = false;
+ private boolean filenameChanged = false;
+ final static int RM_TYPESTYLE = 1;
+ final static int RM_ELEMENTS = 2;
+ final static int RM_SENDERRECEIVER = 3;
+ final static int RM_FOOTER = 4;
+ final static int RM_FINALSETTINGS = 5;
+
+ public FaxWizardDialogImpl(XMultiServiceFactory xmsf)
+ {
+ super(xmsf);
+ }
+
+ public static void main(String args[])
+ {
+ //only being called when starting wizard remotely
+
+ try
+ {
+ String ConnectStr = "uno:socket,host=127.0.0.1,port=8100;urp,negotiate=0,forcesynchronous=1;StarOffice.ServiceManager";
+ XMultiServiceFactory xLocMSF = Desktop.connect(ConnectStr);
+ FaxWizardDialogImpl lw = new FaxWizardDialogImpl(xLocMSF);
+ lw.startWizard(xLocMSF, null);
+ }
+ catch (RuntimeException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (Exception e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (java.lang.Exception e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ public void startWizard(XMultiServiceFactory xMSF, Object[] CurPropertyValue)
+ {
+
+ running = true;
+ try
+ {
+ //Number of steps on WizardDialog:
+ setMaxStep(5);
+
+ //instatiate The Document Frame for the Preview
+ myFaxDoc = new FaxDocument(xMSF, this);
+
+ //create the dialog:
+ drawNaviBar();
+ buildStep1();
+ buildStep2();
+ buildStep3();
+ buildStep4();
+ buildStep5();
+
+ initializeSalutation();
+ initializeGreeting();
+ initializeCommunication();
+ initializePaths();
+
+ //special Control for setting the save Path:
+ insertPathSelectionControl();
+
+ //load the last used settings from the registry and apply listeners to the controls:
+ initConfiguration();
+
+ initializeTemplates(xMSF);
+
+ //update the dialog UI according to the loaded Configuration
+ updateUI();
+
+ if (myPathSelection.xSaveTextBox.getText().equalsIgnoreCase(""))
+ {
+ myPathSelection.initializePath();
+ }
+
+ XWindow xContainerWindow = myFaxDoc.xFrame.getContainerWindow();
+ XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow);
+ createWindowPeer(xWindowPeer);
+
+ //add the Roadmap to the dialog:
+ insertRoadmap();
+
+ //load the last used document and apply last used settings:
+ //TODO:
+ setConfiguration();
+
+ //If the configuration does not define Greeting/Salutation/CommunicationType yet choose a default
+ setDefaultForGreetingAndSalutationAndCommunication();
+
+ //disable funtionality that is not supported by the template:
+ initializeElements();
+
+ //disable the document, so that the user cannot change anything:
+ myFaxDoc.xFrame.getComponentWindow().setEnable(false);
+
+ executeDialog(myFaxDoc.xFrame);
+ removeTerminateListener();
+ closeDocument();
+ running = false;
+
+ }
+ catch (Exception exception)
+ {
+ removeTerminateListener();
+ exception.printStackTrace(System.out);
+ running = false;
+ return;
+ }
+ }
+
+ public void cancelWizard()
+ {
+ xDialog.endExecute();
+ running = false;
+ }
+
+ public boolean finishWizard()
+ {
+ switchToStep(getCurrentStep(), getMaxStep());
+ myFaxDoc.setWizardTemplateDocInfo(resources.resFaxWizardDialog_title, resources.resTemplateDescription);
+ try
+ {
+ //myFaxDoc.xTextDocument.lockControllers();
+ FileAccess fileAccess = new FileAccess(xMSF);
+ sPath = myPathSelection.getSelectedPath();
+ if (sPath.equals(""))
+ {
+ myPathSelection.triggerPathPicker();
+ sPath = myPathSelection.getSelectedPath();
+ }
+ sPath = fileAccess.getURL(sPath);
+
+ //first, if the filename was not changed, thus
+ //it is coming from a saved session, check if the
+ // file exists and warn the user.
+ if (!filenameChanged)
+ {
+ if (fileAccess.exists(sPath, true))
+ {
+
+ int answer = SystemDialog.showMessageBox(xMSF, xControl.getPeer(), "MessBox", VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO, resources.resOverwriteWarning);
+ if (answer == 3) // user said: no, do not overwrite....
+ {
+ return false;
+ }
+ }
+ }
+ myFaxDoc.setWizardTemplateDocInfo(resources.resFaxWizardDialog_title, resources.resTemplateDescription);
+ myFaxDoc.killEmptyUserFields();
+ myFaxDoc.keepLogoFrame = (chkUseLogo.getState() != 0);
+ myFaxDoc.keepTypeFrame = (chkUseCommunicationType.getState() != 0);
+ myFaxDoc.killEmptyFrames();
+
+
+ bSaveSuccess = OfficeDocument.store(xMSF, xTextDocument, sPath, "writer8_template", false, "Template could not be saved to" + sPath);
+ if (bSaveSuccess)
+ {
+ saveConfiguration();
+ XInteractionHandler xIH = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler"));
+ PropertyValue loadValues[] = new PropertyValue[4];
+ loadValues[0] = new PropertyValue();
+ loadValues[0].Name = "AsTemplate";
+ loadValues[1] = new PropertyValue();
+ loadValues[1].Name = "MacroExecutionMode";
+ loadValues[1].Value = new Short(MacroExecMode.ALWAYS_EXECUTE);
+ loadValues[2] = new PropertyValue();
+ loadValues[2].Name = "UpdateDocMode";
+ loadValues[2].Value = new Short(com.sun.star.document.UpdateDocMode.FULL_UPDATE);
+ loadValues[3] = new PropertyValue();
+ loadValues[3].Name = "InteractionHandler";
+ loadValues[3].Value = xIH;
+
+
+ if (bEditTemplate)
+ {
+ loadValues[0].Value = Boolean.FALSE;
+ }
+ else
+ {
+ loadValues[0].Value = Boolean.TRUE;
+ }
+ Object oDoc = OfficeDocument.load(Desktop.getDesktop(xMSF), sPath, "_default", loadValues);
+ XTextDocument xTextDocument = (com.sun.star.text.XTextDocument) oDoc;
+ XMultiServiceFactory xDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDocument);
+ ViewHandler myViewHandler = new ViewHandler(xDocMSF, xTextDocument);
+ myViewHandler.setViewSetting("ZoomType", new Short(com.sun.star.view.DocumentZoomType.OPTIMAL));
+ }
+ else
+ {
+ //TODO: Error Handling
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ xDialog.endExecute();
+ running = false;
+ }
+ return true;
+ }
+
+ public void closeDocument()
+ {
+ try
+ {
+ //xComponent.dispose();
+ XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, myFaxDoc.xFrame);
+ xCloseable.close(false);
+ }
+ catch (CloseVetoException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void insertRoadmap()
+ {
+ addRoadmap();
+ int i = 0;
+ i = insertRoadmapItem(0, true, resources.RoadmapLabels[RM_TYPESTYLE], RM_TYPESTYLE);
+ i = insertRoadmapItem(i, true, resources.RoadmapLabels[RM_ELEMENTS], RM_ELEMENTS);
+ i = insertRoadmapItem(i, true, resources.RoadmapLabels[RM_SENDERRECEIVER], RM_SENDERRECEIVER);
+ i = insertRoadmapItem(i, false, resources.RoadmapLabels[RM_FOOTER], RM_FOOTER);
+ i = insertRoadmapItem(i, true, resources.RoadmapLabels[RM_FINALSETTINGS], RM_FINALSETTINGS);
+ setRoadmapInteractive(true);
+ setRoadmapComplete(true);
+ setCurrentRoadmapItemID((short) 1);
+ }
+
+ private class myPathSelectionListener implements XPathSelectionListener
+ {
+
+ public void validatePath()
+ {
+ if (myPathSelection.usedPathPicker)
+ {
+ filenameChanged = true;
+ }
+ myPathSelection.usedPathPicker = false;
+ }
+ }
+
+ public void insertPathSelectionControl()
+ {
+ myPathSelection = new PathSelection(xMSF, this, PathSelection.TransferMode.SAVE, PathSelection.DialogTypes.FILE);
+ myPathSelection.insert(5, 97, 70, 205, (short) 45, resources.reslblTemplatePath_value, true, "HID:" + (HID + 34), "HID:" + (HID + 35));
+ myPathSelection.sDefaultDirectory = sUserTemplatePath;
+ myPathSelection.sDefaultName = "myFaxTemplate.ott";
+ myPathSelection.sDefaultFilter = "writer8_template";
+ myPathSelection.addSelectionListener(new myPathSelectionListener());
+ }
+
+ private void insertIcons()
+ {
+ try
+ {
+ Object oGS = xMSF.createInstance("com.sun.star.graphic.GraphicProvider");
+ XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGS);
+
+ PropertyValue GraphicValues[] = new PropertyValue[1];
+ GraphicValues[0] = new PropertyValue();
+ GraphicValues[0].Name = "URL";
+ GraphicValues[0].Value = "private:resource/svx/imagelist/18000/18022";
+ XGraphic xGraphic = xGraphicProvider.queryGraphic(GraphicValues);
+
+ }
+ catch (Exception e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ private void updateUI()
+ {
+ UnoDataAware.updateUI(mainDA);
+ UnoDataAware.updateUI(faxDA);
+ }
+
+ private void initializePaths()
+ {
+ try
+ {
+ sTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "share", "/wizard");
+ sUserTemplatePath = FileAccess.getOfficePath(xMSF, "Template", "user", "");
+ sBitmapPath = FileAccess.combinePaths(xMSF, sTemplatePath, "/wizard/bitmap");
+ }
+ catch (NoValidPathException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public boolean initializeTemplates(XMultiServiceFactory xMSF)
+ {
+ try
+ {
+ String sFaxSubPath = "/wizard/fax";
+ sFaxPath = FileAccess.combinePaths(xMSF, sTemplatePath, sFaxSubPath);
+ sWorkPath = FileAccess.getOfficePath(xMSF, "Work", "", "");
+
+ BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus", sFaxPath);
+ PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri", sFaxPath);
+
+ setControlProperty("lstBusinessStyle", "StringItemList", BusinessFiles[0]);
+ setControlProperty("lstPrivateStyle", "StringItemList", PrivateFiles[0]);
+
+ setControlProperty("lstBusinessStyle", "SelectedItems", new short[]
+ {
+ 0
+ });
+ setControlProperty("lstPrivateStyle", "SelectedItems", new short[]
+ {
+ 0
+ });
+
+ return true;
+ }
+ catch (NoValidPathException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ public void initializeElements()
+ {
+ setControlProperty("chkUseLogo", "Enabled", new Boolean(myFaxDoc.hasElement("Company Logo")));
+ setControlProperty("chkUseSubject", "Enabled", new Boolean(myFaxDoc.hasElement("Subject Line")));
+ setControlProperty("chkUseDate", "Enabled", new Boolean(myFaxDoc.hasElement("Date")));
+ myFaxDoc.updateDateFields();
+ }
+
+ public void initializeSalutation()
+ {
+ setControlProperty("lstSalutation", "StringItemList", resources.SalutationLabels);
+ }
+
+ public void initializeGreeting()
+ {
+ setControlProperty("lstGreeting", "StringItemList", resources.GreetingLabels);
+ }
+
+ public void initializeCommunication()
+ {
+ setControlProperty("lstCommunicationType", "StringItemList", resources.CommunicationLabels);
+ }
+
+ private void setDefaultForGreetingAndSalutationAndCommunication()
+ {
+ XTextComponent xTextComponent;
+ xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation);
+ if (xTextComponent.getText().equals(""))
+ {
+ xTextComponent.setText(resources.SalutationLabels[0]);
+ }
+ xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting);
+ if (xTextComponent.getText().equals(""))
+ {
+ xTextComponent.setText(resources.GreetingLabels[0]);
+ }
+ xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType);
+ if (xTextComponent.getText().equals(""))
+ {
+ xTextComponent.setText(resources.CommunicationLabels[0]);
+ }
+ }
+
+ public void initConfiguration()
+ {
+ try
+ {
+ myConfig = new CGFaxWizard();
+ Object root = Configuration.getConfigurationRoot(xMSF, "/org.openoffice.Office.Writer/Wizards/Fax", false);
+ myConfig.readConfiguration(root, "cp_");
+ mainDA.add(RadioDataAware.attachRadioButtons(myConfig, "cp_FaxType", new Object[]
+ {
+ optBusinessFax, optPrivateFax
+ }, null, true));
+ mainDA.add(UnoDataAware.attachListBox(myConfig.cp_BusinessFax, "cp_Style", lstBusinessStyle, null, true));
+ mainDA.add(UnoDataAware.attachListBox(myConfig.cp_PrivateFax, "cp_Style", lstPrivateStyle, null, true));
+
+ CGFax cgl = myConfig.cp_BusinessFax;
+
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintCompanyLogo", chkUseLogo, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintSubjectLine", chkUseSubject, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintSalutation", chkUseSalutation, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintDate", chkUseDate, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintCommunicationType", chkUseCommunicationType, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintGreeting", chkUseGreeting, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_PrintFooter", chkUseFooter, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_Salutation", lstSalutation, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_Greeting", lstGreeting, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_CommunicationType", lstCommunicationType, null, true));
+ faxDA.add(RadioDataAware.attachRadioButtons(cgl, "cp_SenderAddressType", new Object[]
+ {
+ optSenderDefine, optSenderPlaceholder
+ }, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_SenderCompanyName", txtSenderName, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_SenderStreet", txtSenderStreet, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_SenderPostCode", txtSenderPostCode, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_SenderState", txtSenderState, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_SenderCity", txtSenderCity, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_SenderFax", txtSenderFax, null, true));
+ faxDA.add(RadioDataAware.attachRadioButtons(cgl, "cp_ReceiverAddressType", new Object[]
+ {
+ optReceiverDatabase, optReceiverPlaceholder
+ }, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_Footer", txtFooter, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_FooterOnlySecondPage", chkFooterNextPages, null, true));
+ faxDA.add(UnoDataAware.attachCheckBox(cgl, "cp_FooterPageNumbers", chkFooterPageNumbers, null, true));
+ faxDA.add(RadioDataAware.attachRadioButtons(cgl, "cp_CreationType", new Object[]
+ {
+ optCreateFax, optMakeChanges
+ }, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_TemplateName", txtTemplateName, null, true));
+ faxDA.add(UnoDataAware.attachEditControl(cgl, "cp_TemplatePath", myPathSelection.xSaveTextBox, null, true));
+
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace();
+ }
+
+ }
+
+ public void saveConfiguration()
+ {
+ try
+ {
+ Object root = Configuration.getConfigurationRoot(xMSF, "/org.openoffice.Office.Writer/Wizards/Fax", true);
+ myConfig.writeConfiguration(root, "cp_");
+ Configuration.commit(root);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void setConfiguration()
+ {
+ //set correct Configuration tree:
+ if (optBusinessFax.getState())
+ {
+ optBusinessFaxItemChanged();
+ }
+ if (optPrivateFax.getState())
+ {
+ optPrivateFaxItemChanged();
+ }
+ }
+
+ public void optBusinessFaxItemChanged()
+ {
+ DataAware.setDataObject(faxDA, myConfig.cp_BusinessFax, true);
+ setControlProperty("lblBusinessStyle", "Enabled", Boolean.TRUE);
+ setControlProperty("lstBusinessStyle", "Enabled", Boolean.TRUE);
+ setControlProperty("lblPrivateStyle", "Enabled", Boolean.FALSE);
+ setControlProperty("lstPrivateStyle", "Enabled", Boolean.FALSE);
+ lstBusinessStyleItemChanged();
+ enableSenderReceiver();
+ setPossibleFooter(true);
+ }
+
+ public void lstBusinessStyleItemChanged()
+ {
+ xTextDocument = myFaxDoc.loadAsPreview(BusinessFiles[1][lstBusinessStyle.getSelectedItemPos()], false);
+ initializeElements();
+ setElements();
+ }
+
+ public void optPrivateFaxItemChanged()
+ {
+ DataAware.setDataObject(faxDA, myConfig.cp_PrivateFax, true);
+ setControlProperty("lblBusinessStyle", "Enabled", Boolean.FALSE);
+ setControlProperty("lstBusinessStyle", "Enabled", Boolean.FALSE);
+ setControlProperty("lblPrivateStyle", "Enabled", Boolean.TRUE);
+ setControlProperty("lstPrivateStyle", "Enabled", Boolean.TRUE);
+ lstPrivateStyleItemChanged();
+ disableSenderReceiver();
+ setPossibleFooter(false);
+ }
+
+ public void lstPrivateStyleItemChanged()
+ {
+ xTextDocument = myFaxDoc.loadAsPreview(PrivateFiles[1][lstPrivateStyle.getSelectedItemPos()], false);
+ initializeElements();
+ setElements();
+ }
+
+ public void txtTemplateNameTextChanged()
+ {
+ XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xTextDocument);
+ XDocumentProperties xDocProps = xDocPropsSuppl.getDocumentProperties();
+ String TitleName = txtTemplateName.getText();
+ xDocProps.setTitle(TitleName);
+ }
+
+ public void optSenderPlaceholderItemChanged()
+ {
+ setControlProperty("lblSenderName", "Enabled", Boolean.FALSE);
+ setControlProperty("lblSenderStreet", "Enabled", Boolean.FALSE);
+ setControlProperty("lblPostCodeCity", "Enabled", Boolean.FALSE);
+ setControlProperty("lblSenderFax", "Enabled", Boolean.FALSE);
+ setControlProperty("txtSenderName", "Enabled", Boolean.FALSE);
+ setControlProperty("txtSenderStreet", "Enabled", Boolean.FALSE);
+ setControlProperty("txtSenderPostCode", "Enabled", Boolean.FALSE);
+ setControlProperty("txtSenderState", "Enabled", Boolean.FALSE);
+ setControlProperty("txtSenderCity", "Enabled", Boolean.FALSE);
+ setControlProperty("txtSenderFax", "Enabled", Boolean.FALSE);
+ myFaxDoc.fillSenderWithUserData();
+ }
+
+ public void optSenderDefineItemChanged()
+ {
+ setControlProperty("lblSenderName", "Enabled", Boolean.TRUE);
+ setControlProperty("lblSenderStreet", "Enabled", Boolean.TRUE);
+ setControlProperty("lblPostCodeCity", "Enabled", Boolean.TRUE);
+ setControlProperty("lblSenderFax", "Enabled", Boolean.TRUE);
+ setControlProperty("txtSenderName", "Enabled", Boolean.TRUE);
+ setControlProperty("txtSenderStreet", "Enabled", Boolean.TRUE);
+ setControlProperty("txtSenderPostCode", "Enabled", Boolean.TRUE);
+ setControlProperty("txtSenderState", "Enabled", Boolean.TRUE);
+ setControlProperty("txtSenderCity", "Enabled", Boolean.TRUE);
+ setControlProperty("txtSenderFax", "Enabled", Boolean.TRUE);
+ txtSenderNameTextChanged();
+ txtSenderStreetTextChanged();
+ txtSenderPostCodeTextChanged();
+ txtSenderStateTextChanged();
+ txtSenderCityTextChanged();
+ txtSenderFaxTextChanged();
+ }
+
+ public void optReceiverPlaceholderItemChanged()
+ {
+ OfficeDocument.attachEventCall(xTextDocument, "OnNew", "StarBasic", "macro:///Template.Correspondence.Placeholder()");
+ }
+
+ public void optReceiverDatabaseItemChanged()
+ {
+ OfficeDocument.attachEventCall(xTextDocument, "OnNew", "StarBasic", "macro:///Template.Correspondence.Database()");
+ }
+
+ public void optCreateFaxItemChanged()
+ {
+ bEditTemplate = false;
+ }
+
+ public void optMakeChangesItemChanged()
+ {
+ bEditTemplate = true;
+ }
+
+ public void txtSenderNameTextChanged()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
+ myFieldHandler.changeUserFieldContent("Company", txtSenderName.getText());
+ }
+
+ public void txtSenderStreetTextChanged()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
+ myFieldHandler.changeUserFieldContent("Street", txtSenderStreet.getText());
+ }
+
+ public void txtSenderCityTextChanged()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
+ myFieldHandler.changeUserFieldContent("City", txtSenderCity.getText());
+ }
+
+ public void txtSenderPostCodeTextChanged()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
+ myFieldHandler.changeUserFieldContent("PostCode", txtSenderPostCode.getText());
+ }
+
+ public void txtSenderStateTextChanged()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
+ myFieldHandler.changeUserFieldContent("State", txtSenderState.getText());
+ }
+
+ public void txtSenderFaxTextChanged()
+ {
+ TextFieldHandler myFieldHandler = new TextFieldHandler(myFaxDoc.xMSF, xTextDocument);
+ myFieldHandler.changeUserFieldContent("Fax", txtSenderFax.getText());
+ }
+ //switch Elements on/off -------------------------------------------------------
+ public void setElements()
+ {
+ //UI relevant:
+ if (optSenderDefine.getState())
+ {
+ optSenderDefineItemChanged();
+ }
+ if (optSenderPlaceholder.getState())
+ {
+ optSenderPlaceholderItemChanged();
+ }
+ chkUseLogoItemChanged();
+ chkUseSubjectItemChanged();
+ chkUseSalutationItemChanged();
+ chkUseGreetingItemChanged();
+ chkUseCommunicationItemChanged();
+ chkUseDateItemChanged();
+ chkUseFooterItemChanged();
+ txtTemplateNameTextChanged();
+
+ //not UI relevant:
+ if (optReceiverDatabase.getState())
+ {
+ optReceiverDatabaseItemChanged();
+ }
+ if (optReceiverPlaceholder.getState())
+ {
+ optReceiverPlaceholderItemChanged();
+ }
+ if (optCreateFax.getState())
+ {
+ optCreateFaxItemChanged();
+ }
+ if (optMakeChanges.getState())
+ {
+ optMakeChangesItemChanged();
+ }
+ }
+
+ public void chkUseLogoItemChanged()
+ {
+ if (myFaxDoc.hasElement("Company Logo"))
+ {
+ myFaxDoc.switchElement("Company Logo", (chkUseLogo.getState() != 0));
+ }
+ }
+
+ public void chkUseSubjectItemChanged()
+ {
+ if (myFaxDoc.hasElement("Subject Line"))
+ {
+ myFaxDoc.switchElement("Subject Line", (chkUseSubject.getState() != 0));
+ }
+ }
+
+ public void chkUseDateItemChanged()
+ {
+ if (myFaxDoc.hasElement("Date"))
+ {
+ myFaxDoc.switchElement("Date", (chkUseDate.getState() != 0));
+ }
+ }
+
+ public void chkUseFooterItemChanged()
+ {
+ try
+ {
+ boolean bFooterPossible = (chkUseFooter.getState() != 0) && AnyConverter.toBoolean(getControlProperty("chkUseFooter", "Enabled"));
+
+ if (chkFooterNextPages.getState() != 0)
+ {
+ myFaxDoc.switchFooter("First Page", false, (chkFooterPageNumbers.getState() != 0), txtFooter.getText());
+ myFaxDoc.switchFooter("Standard", bFooterPossible, (chkFooterPageNumbers.getState() != 0), txtFooter.getText());
+ }
+ else
+ {
+ myFaxDoc.switchFooter("First Page", bFooterPossible, (chkFooterPageNumbers.getState() != 0), txtFooter.getText());
+ myFaxDoc.switchFooter("Standard", bFooterPossible, (chkFooterPageNumbers.getState() != 0), txtFooter.getText());
+ }
+
+ //enable/disable roadmap item for footer page
+ XInterface BPaperItem = getRoadmapItemByID(RM_FOOTER);
+ Helper.setUnoPropertyValue(BPaperItem, "Enabled", new Boolean(bFooterPossible));
+
+ }
+ catch (Exception exception)
+ {
+ exception.printStackTrace(System.out);
+ }
+ }
+
+ public void chkFooterNextPagesItemChanged()
+ {
+ chkUseFooterItemChanged();
+ }
+
+ public void chkFooterPageNumbersItemChanged()
+ {
+ chkUseFooterItemChanged();
+ }
+
+ public void txtFooterTextChanged()
+ {
+ chkUseFooterItemChanged();
+ }
+
+ public void chkUseSalutationItemChanged()
+ {
+ XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation);
+ myFaxDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0));
+ setControlProperty("lstSalutation", "Enabled", new Boolean(chkUseSalutation.getState() != 0));
+ }
+
+ public void lstSalutationItemChanged()
+ {
+ XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstSalutation);
+ myFaxDoc.switchUserField("Salutation", xTextComponent.getText(), (chkUseSalutation.getState() != 0));
+ }
+
+ public void lstSalutationTextChanged()
+ {
+ }
+
+ public void chkUseCommunicationItemChanged()
+ {
+ XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType);
+ myFaxDoc.switchUserField("CommunicationType", xTextComponent.getText(), (chkUseCommunicationType.getState() != 0));
+ setControlProperty("lstCommunicationType", "Enabled", new Boolean(chkUseCommunicationType.getState() != 0));
+ }
+
+ public void lstCommunicationItemChanged()
+ {
+ XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstCommunicationType);
+ myFaxDoc.switchUserField("CommunicationType", xTextComponent.getText(), (chkUseCommunicationType.getState() != 0));
+ }
+
+ public void lstCommunicationTextChanged()
+ {
+ }
+
+ public void chkUseGreetingItemChanged()
+ {
+ XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting);
+ myFaxDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0));
+ setControlProperty("lstGreeting", "Enabled", new Boolean(chkUseGreeting.getState() != 0));
+ }
+
+ public void lstGreetingItemChanged()
+ {
+ XTextComponent xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, lstGreeting);
+ myFaxDoc.switchUserField("Greeting", xTextComponent.getText(), (chkUseGreeting.getState() != 0));
+ }
+
+ public void lstGreetingTextChanged()
+ {
+ }
+
+ private void setPossibleFooter(boolean bState)
+ {
+ setControlProperty("chkUseFooter", "Enabled", new Boolean(bState));
+ if (!bState)
+ {
+ chkUseFooter.setState((short) 0);
+ }
+ chkUseFooterItemChanged();
+ }
+
+ private void enableSenderReceiver()
+ {
+ XInterface BPaperItem = getRoadmapItemByID(RM_SENDERRECEIVER);
+ Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.TRUE);
+ }
+
+ private void disableSenderReceiver()
+ {
+ XInterface BPaperItem = getRoadmapItemByID(RM_SENDERRECEIVER);
+ Helper.setUnoPropertyValue(BPaperItem, "Enabled", Boolean.FALSE);
+ }
+}
+
+
+
+
+
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.java
new file mode 100644
index 000000000000..0043d25590d8
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.java
@@ -0,0 +1,182 @@
+/*
+ ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package com.sun.star.wizards.fax;
+
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.wizards.common.Resource;
+
+public class FaxWizardDialogResources extends Resource
+{
+
+ final static String UNIT_NAME = "dbwizres";
+ final static String MODULE_NAME = "dbw";
+ final static int RID_FAXWIZARDDIALOG_START = 3200;
+ final static int RID_FAXWIZARDCOMMUNICATION_START = 3270;
+ final static int RID_FAXWIZARDGREETING_START = 3280;
+ final static int RID_FAXWIZARDSALUTATION_START = 3290;
+ final static int RID_FAXWIZARDROADMAP_START = 3300;
+ final static int RID_RID_COMMON_START = 500;
+ protected String[] RoadmapLabels = new String[7];
+ protected String[] SalutationLabels = new String[4];
+ protected String[] GreetingLabels = new String[4];
+ protected String[] CommunicationLabels = new String[3];
+ String resOverwriteWarning;
+ String resTemplateDescription;
+ String resFaxWizardDialog_title;
+ String resLabel9_value;
+ String resoptBusinessFax_value;
+ String resoptPrivateFax_value;
+ String reschkUseLogo_value;
+ String reschkUseSubject_value;
+ String reschkUseSalutation_value;
+ String reschkUseGreeting_value;
+ String reschkUseFooter_value;
+ String resoptSenderPlaceholder_value;
+ String resoptSenderDefine_value;
+ String restxtTemplateName_value;
+ String resoptCreateFax_value;
+ String resoptMakeChanges_value;
+ String reslblBusinessStyle_value;
+ String reslblPrivateStyle_value;
+ String reslblIntroduction_value;
+ String reslblSenderAddress_value;
+ String reslblSenderName_value;
+ String reslblSenderStreet_value;
+ String reslblPostCodeCity_value;
+ String reslblFooter_value;
+ String reslblFinalExplanation1_value;
+ String reslblFinalExplanation2_value;
+ String reslblTemplateName_value;
+ String reslblTemplatePath_value;
+ String reslblProceed_value;
+ String reslblTitle1_value;
+ String reslblTitle3_value;
+ String reslblTitle4_value;
+ String reslblTitle5_value;
+ String reslblTitle6_value;
+ String reschkFooterNextPages_value;
+ String reschkFooterPageNumbers_value;
+ String reschkUseDate_value;
+ String reschkUseCommunicationType_value;
+ String resLabel1_value;
+ String resoptReceiverPlaceholder_value;
+ String resoptReceiverDatabase_value;
+ String resLabel2_value;
+
+ public FaxWizardDialogResources(XMultiServiceFactory xmsf)
+ {
+ super(xmsf, UNIT_NAME, MODULE_NAME);
+ /**
+ * Delete the String, uncomment the getResText method
+ *
+ */
+ resFaxWizardDialog_title = getResText(RID_FAXWIZARDDIALOG_START + 1);
+ resLabel9_value = getResText(RID_FAXWIZARDDIALOG_START + 2);
+ resoptBusinessFax_value = getResText(RID_FAXWIZARDDIALOG_START + 3);
+ resoptPrivateFax_value = getResText(RID_FAXWIZARDDIALOG_START + 4);
+ reschkUseLogo_value = getResText(RID_FAXWIZARDDIALOG_START + 5);
+ reschkUseSubject_value = getResText(RID_FAXWIZARDDIALOG_START + 6);
+ reschkUseSalutation_value = getResText(RID_FAXWIZARDDIALOG_START + 7);
+ reschkUseGreeting_value = getResText(RID_FAXWIZARDDIALOG_START + 8);
+ reschkUseFooter_value = getResText(RID_FAXWIZARDDIALOG_START + 9);
+ resoptSenderPlaceholder_value = getResText(RID_FAXWIZARDDIALOG_START + 10);
+ resoptSenderDefine_value = getResText(RID_FAXWIZARDDIALOG_START + 11);
+ restxtTemplateName_value = getResText(RID_FAXWIZARDDIALOG_START + 12);
+ resoptCreateFax_value = getResText(RID_FAXWIZARDDIALOG_START + 13);
+ resoptMakeChanges_value = getResText(RID_FAXWIZARDDIALOG_START + 14);
+ reslblBusinessStyle_value = getResText(RID_FAXWIZARDDIALOG_START + 15);
+ reslblPrivateStyle_value = getResText(RID_FAXWIZARDDIALOG_START + 16);
+ reslblIntroduction_value = getResText(RID_FAXWIZARDDIALOG_START + 17);
+ reslblSenderAddress_value = getResText(RID_FAXWIZARDDIALOG_START + 18);
+ reslblSenderName_value = getResText(RID_FAXWIZARDDIALOG_START + 19);
+ reslblSenderStreet_value = getResText(RID_FAXWIZARDDIALOG_START + 20);
+ reslblPostCodeCity_value = getResText(RID_FAXWIZARDDIALOG_START + 21);
+ reslblFooter_value = getResText(RID_FAXWIZARDDIALOG_START + 22);
+ reslblFinalExplanation1_value = getResText(RID_FAXWIZARDDIALOG_START + 23);
+ reslblFinalExplanation2_value = getResText(RID_FAXWIZARDDIALOG_START + 24);
+ reslblTemplateName_value = getResText(RID_FAXWIZARDDIALOG_START + 25);
+ reslblTemplatePath_value = getResText(RID_FAXWIZARDDIALOG_START + 26);
+ reslblProceed_value = getResText(RID_FAXWIZARDDIALOG_START + 27);
+ reslblTitle1_value = getResText(RID_FAXWIZARDDIALOG_START + 28);
+ reslblTitle3_value = getResText(RID_FAXWIZARDDIALOG_START + 29);
+ reslblTitle4_value = getResText(RID_FAXWIZARDDIALOG_START + 30);
+ reslblTitle5_value = getResText(RID_FAXWIZARDDIALOG_START + 31);
+ reslblTitle6_value = getResText(RID_FAXWIZARDDIALOG_START + 32);
+ reschkFooterNextPages_value = getResText(RID_FAXWIZARDDIALOG_START + 33);
+ reschkFooterPageNumbers_value = getResText(RID_FAXWIZARDDIALOG_START + 34);
+ reschkUseDate_value = getResText(RID_FAXWIZARDDIALOG_START + 35);
+ reschkUseCommunicationType_value = getResText(RID_FAXWIZARDDIALOG_START + 36);
+ resLabel1_value = getResText(RID_FAXWIZARDDIALOG_START + 37);
+ resoptReceiverPlaceholder_value = getResText(RID_FAXWIZARDDIALOG_START + 38);
+ resoptReceiverDatabase_value = getResText(RID_FAXWIZARDDIALOG_START + 39);
+ resLabel2_value = getResText(RID_FAXWIZARDDIALOG_START + 40);
+ loadRoadmapResources();
+ loadSalutationResources();
+ loadGreetingResources();
+ loadCommunicationResources();
+ loadCommonResources();
+ }
+
+ private void loadCommonResources()
+ {
+ resOverwriteWarning = getResText(RID_RID_COMMON_START + 19);
+ resTemplateDescription = getResText(RID_RID_COMMON_START + 20);
+ }
+
+ private void loadRoadmapResources()
+ {
+ for (int i = 1; i < 6; i++)
+ {
+ RoadmapLabels[i] = getResText(RID_FAXWIZARDROADMAP_START + i);
+ }
+ }
+
+ private void loadSalutationResources()
+ {
+ for (int i = 1; i < 5; i++)
+ {
+ SalutationLabels[i - 1] = getResText(RID_FAXWIZARDSALUTATION_START + i);
+ }
+ }
+
+ private void loadGreetingResources()
+ {
+ for (int i = 1; i < 5; i++)
+ {
+ GreetingLabels[i - 1] = getResText(RID_FAXWIZARDGREETING_START + i);
+ }
+ }
+
+ private void loadCommunicationResources()
+ {
+ for (int i = 1; i < 4; i++)
+ {
+ CommunicationLabels[i - 1] = getResText(RID_FAXWIZARDCOMMUNICATION_START + i);
+ }
+ }
+} \ No newline at end of file
diff --git a/wizards/com/sun/star/wizards/fax/MANIFEST.MF b/wizards/com/sun/star/wizards/fax/MANIFEST.MF
new file mode 100644
index 000000000000..4e699ee9073b
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/MANIFEST.MF
@@ -0,0 +1,2 @@
+RegistrationClassName: com.sun.star.wizards.fax.CallWizard
+UNO-Type-Path:
diff --git a/wizards/com/sun/star/wizards/fax/makefile.mk b/wizards/com/sun/star/wizards/fax/makefile.mk
new file mode 100644
index 000000000000..247aaf063529
--- /dev/null
+++ b/wizards/com/sun/star/wizards/fax/makefile.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..
+PRJNAME = wizards
+TARGET = fax
+PACKAGE = com$/sun$/star$/wizards$/fax
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+#.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+JARFILES= unoil.jar jurt.jar ridl.jar juh.jar java_uno.jar java_uno_accessbridge commonwizards.jar
+
+CUSTOMMANIFESTFILE= MANIFEST.MF
+
+JARCLASSDIRS = com$/sun$/star$/wizards$/fax
+JARTARGET = $(TARGET).jar
+JARCLASSPATH = commonwizards.jar
+
+# --- Files --------------------------------------------------------
+
+JAVAFILES= \
+ CallWizard.java \
+ CGFax.java \
+ FaxDocument.java \
+ FaxWizardDialog.java \
+ CGFaxWizard.java \
+ FaxWizardDialogConst.java \
+ FaxWizardDialogResources.java \
+ FaxWizardDialogImpl.java
+
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk