summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java196
1 files changed, 0 insertions, 196 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java
deleted file mode 100644
index adf03913..00000000
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationDataInMemory.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright 2012 by A-SIT, Secure Information Technology Center Austria
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://joinup.ec.europa.eu/software/page/eupl
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- */
-package at.asit.pdfover.gui.workflow.config;
-
-// Imports
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.util.Locale;
-import java.util.Objects;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-
-import at.asit.pdfover.commons.Profile;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import at.asit.pdfover.commons.BKUs;
-import at.asit.pdfover.commons.Constants;
-import at.asit.pdfover.gui.bku.mobile.MobileBKUValidator;
-import at.asit.pdfover.gui.exceptions.InvalidEmblemFile;
-import at.asit.pdfover.gui.exceptions.InvalidPortException;
-
-import static at.asit.pdfover.commons.Constants.ISNOTNULL;
-
-/**
- * Implementation of the configuration container
- */
-public class ConfigurationDataInMemory {
- /**
- * SLF4J Logger instance
- **/
- @SuppressWarnings("unused")
- private static final Logger log = LoggerFactory.getLogger(ConfigurationDataInMemory.class);
-
- /** the emblem size (in mm) for logo only signatures */
- public double logoOnlyTargetSize = Constants.DEFAULT_LOGO_ONLY_SIZE;
-
- /** the emblem File */
- protected String emblemFile = null;
- public String getEmblemPath() { return this.emblemFile; }
- public void setEmblem(String emblemFile) throws InvalidEmblemFile {
- if (emblemFile == null || emblemFile.trim().isEmpty()) {
- // Ok to set no file ...
- } else {
- File imageFile = new File(emblemFile);
- if (!imageFile.exists()) {
- throw new InvalidEmblemFile(imageFile,
- new FileNotFoundException(emblemFile));
- }
-
- try {
- Image img = new Image(Display.getDefault(), new ImageData(
- emblemFile));
-
- img.dispose();
- } catch (Exception ex) {
- throw new InvalidEmblemFile(imageFile, ex);
- }
- }
-
- this.emblemFile = emblemFile;
- }
-
- /** The mobile phone number */
- protected @CheckForNull String mobileNumber = null;
- public @CheckForNull String getMobileNumber() { return this.mobileNumber; }
- public void setMobileNumber(String number) {
- if(number == null || number.trim().isEmpty()) {
- this.mobileNumber = null;
- return;
- }
- this.mobileNumber = MobileBKUValidator.normalizeMobileNumber(number);
- }
-
- /** The mobile phone password */
- public @CheckForNull String mobilePassword = null;
-
- public boolean rememberPassword = false;
-
- /** Holds the proxy host */
- public @CheckForNull String proxyHost = null;
-
- /** Holds the proxy port number */
- protected int proxyPort = -1;
- public int getProxyPort() { return this.proxyPort; }
- public void setProxyPort(int port) throws InvalidPortException {
- if(port > 0 && port <= 0xFFFF) {
- this.proxyPort = port;
- return;
- }
- if(port == -1) {
- this.proxyPort = -1;
- return;
- }
- throw new InvalidPortException(port);
- }
-
- /** Holds the proxy username */
- public @CheckForNull String proxyUser = null;
-
- /** Holds the proxy password */
- public @CheckForNull String proxyPass = null;
-
- /** Holds the default BKU to use */
- public @Nonnull BKUs defaultBKU = BKUs.NONE;
-
- /** Holds the output folder */
- public @CheckForNull String outputFolder = null;
-
- /** Holds the signatureNote */
- public @CheckForNull String signatureNote = null;
-
- /** Holds the locale */
- public @CheckForNull Locale interfaceLocale = null;
-
- /** Holds the signature locale */
- public @CheckForNull Locale signatureLocale = null;
-
- /** Holds the PDF/A compatibility setting */
- public boolean signaturePDFACompat = false;
-
- /** Holds the default signature position */
- public boolean autoPositionSignature = false;
-
- /** Keystore signing options */
- public enum KeyStorePassStorageType { MEMORY, DISK };
- public @CheckForNull Boolean keystoreEnabled = null;
- public @CheckForNull String keystoreFile = null;
- public @CheckForNull String keystoreType = null;
- public @CheckForNull String keystoreAlias = null;
- public @CheckForNull KeyStorePassStorageType keystorePassStorageType = null;
- public @CheckForNull String keystoreStorePass = null;
- public @CheckForNull String keystoreKeyPass = null;
-
- /** Whether to automatically check for updates */
- public boolean updateCheck = true;
-
- /** Holds the main window size
- *
- * @IMPORTANT this must always be valid and non-null, even if configuration failed to load for whatever reason (it is used by error handlers!)
- */
- public @Nonnull Point mainWindowSize = new Point(Constants.DEFAULT_MAINWINDOW_WIDTH, Constants.DEFAULT_MAINWINDOW_HEIGHT);
-
- /** Whether to skip the output state */
- public boolean skipFinish = false;
-
- /** Whether to use an existing signature marker. */
- protected boolean useMarker = false;
- public boolean getUseMarker() { return this.useMarker; }
- public void setUseMarker(boolean useMarker) {
- this.useMarker = useMarker;
- if (useMarker) setUseSignatureFields(false);
- }
-
- /** Either QR-Code or signature fields as marker */
- protected boolean useSignatureFields = false;
- public boolean getUseSignatureFields() { return this.useSignatureFields; }
- public void setUseSignatureFields(boolean useFields) {
- this.useSignatureFields = useFields;
- if (useFields) setUseMarker(false);
- }
-
- /** describes if the placeholder search is enabled */
- public boolean enabledPlaceholderUsage = false;
-
- /** The Signature Profile */
- protected @CheckForNull Profile signatureProfile = null;
- public @Nonnull Profile getSignatureProfile() {
- return ISNOTNULL(Objects.requireNonNullElse(this.signatureProfile, Profile.SIGNATURBLOCK_SMALL));
- }
- public void setSignatureProfile(Profile profile) { this.signatureProfile = profile; }
-
- public @Nonnull String saveFilePostFix = Constants.DEFAULT_POSTFIX;
-
- /** whether fido2 authentication should be selected by default */
- public boolean fido2ByDefault = false;
-
-}