|
@@ -10,6 +10,7 @@
|
|
package com.compdfkit.tools.common.views.pdfproperties.pdfstyle;
|
|
package com.compdfkit.tools.common.views.pdfproperties.pdfstyle;
|
|
|
|
|
|
|
|
|
|
|
|
+import android.graphics.Bitmap;
|
|
import android.graphics.Color;
|
|
import android.graphics.Color;
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
@@ -20,6 +21,7 @@ import androidx.annotation.IntRange;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
|
|
+import com.compdfkit.core.annotation.CPDFAnnotation;
|
|
import com.compdfkit.core.annotation.CPDFBorderStyle;
|
|
import com.compdfkit.core.annotation.CPDFBorderStyle;
|
|
import com.compdfkit.core.annotation.CPDFLineAnnotation;
|
|
import com.compdfkit.core.annotation.CPDFLineAnnotation;
|
|
import com.compdfkit.core.annotation.CPDFStampAnnotation;
|
|
import com.compdfkit.core.annotation.CPDFStampAnnotation;
|
|
@@ -101,6 +103,14 @@ public class CAnnotStyle implements Serializable {
|
|
|
|
|
|
private CPDFWidget.BorderStyle signFieldsBorderStyle = CPDFWidget.BorderStyle.BS_Solid;
|
|
private CPDFWidget.BorderStyle signFieldsBorderStyle = CPDFWidget.BorderStyle.BS_Solid;
|
|
|
|
|
|
|
|
+ private CPDFAnnotation.CPDFBorderEffectType bordEffectType = CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid;
|
|
|
|
+
|
|
|
|
+ private boolean editTextUnderLine = false;
|
|
|
|
+
|
|
|
|
+ private boolean editTextStrikeThrough = false;
|
|
|
|
+
|
|
|
|
+ private transient Bitmap editImageBitmap;
|
|
|
|
+
|
|
private List<OnAnnotStyleChangeListener> styleChangeListenerList = new ArrayList<>();
|
|
private List<OnAnnotStyleChangeListener> styleChangeListenerList = new ArrayList<>();
|
|
|
|
|
|
public CAnnotStyle(CStyleType type) {
|
|
public CAnnotStyle(CStyleType type) {
|
|
@@ -441,6 +451,26 @@ public class CAnnotStyle implements Serializable {
|
|
return checkStyle;
|
|
return checkStyle;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void setEditTextUnderLine(boolean editTextUnderLine) {
|
|
|
|
+ boolean update = this.editTextUnderLine != editTextUnderLine;
|
|
|
|
+ this.editTextUnderLine = editTextUnderLine;
|
|
|
|
+ updateEditTextUnderLine(editTextUnderLine, update);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isEditTextUnderLine() {
|
|
|
|
+ return editTextUnderLine;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setEditTextStrikeThrough(boolean editTextStrikeThrough) {
|
|
|
|
+ boolean update = this.editTextStrikeThrough != editTextStrikeThrough;
|
|
|
|
+ this.editTextStrikeThrough = editTextStrikeThrough;
|
|
|
|
+ updateEditTextStrikeThrough(editTextStrikeThrough, update);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isEditTextStrikeThrough() {
|
|
|
|
+ return editTextStrikeThrough;
|
|
|
|
+ }
|
|
|
|
+
|
|
public void setChecked(boolean checked) {
|
|
public void setChecked(boolean checked) {
|
|
boolean update = checked != this.isChecked;
|
|
boolean update = checked != this.isChecked;
|
|
isChecked = checked;
|
|
isChecked = checked;
|
|
@@ -472,6 +502,24 @@ public class CAnnotStyle implements Serializable {
|
|
return signFieldsBorderStyle;
|
|
return signFieldsBorderStyle;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public CPDFAnnotation.CPDFBorderEffectType getBordEffectType() {
|
|
|
|
+ return bordEffectType;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setBordEffectType(CPDFAnnotation.CPDFBorderEffectType bordEffectType) {
|
|
|
|
+ boolean update = this.bordEffectType != bordEffectType;
|
|
|
|
+ this.bordEffectType = bordEffectType;
|
|
|
|
+ updateShapeBordEffectType(bordEffectType, update);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Bitmap getEditImageBitmap() {
|
|
|
|
+ return editImageBitmap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setEditImageBitmap(Bitmap editImageBitmap) {
|
|
|
|
+ this.editImageBitmap = editImageBitmap;
|
|
|
|
+ }
|
|
|
|
+
|
|
@NonNull
|
|
@NonNull
|
|
@Override
|
|
@Override
|
|
public String toString() {
|
|
public String toString() {
|
|
@@ -502,8 +550,11 @@ public class CAnnotStyle implements Serializable {
|
|
"formDefaultValue" + formDefaultValue + "," +
|
|
"formDefaultValue" + formDefaultValue + "," +
|
|
"hideForm" + hideForm + "," +
|
|
"hideForm" + hideForm + "," +
|
|
"formMultiLine" + formMultiLine + "," +
|
|
"formMultiLine" + formMultiLine + "," +
|
|
- "customExtraMap" + customExtraMap.toString() +
|
|
|
|
- "signFieldsBorderStyle" + (signFieldsBorderStyle != null ? signFieldsBorderStyle.name() : "empty");
|
|
|
|
|
|
+ "customExtraMap" + customExtraMap.toString() + "," +
|
|
|
|
+ "signFieldsBorderStyle" + (signFieldsBorderStyle != null ? signFieldsBorderStyle.name() : "empty") + "," +
|
|
|
|
+ "bordEffectType" + bordEffectType + "," +
|
|
|
|
+ "editTextUnderLine" + editTextUnderLine + "," +
|
|
|
|
+ "editTextStrikeThrough" + editTextStrikeThrough+ "}";
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -532,6 +583,7 @@ public class CAnnotStyle implements Serializable {
|
|
result = 31 * result + (this.formDefaultValue != null ? this.formDefaultValue.hashCode() : 0);
|
|
result = 31 * result + (this.formDefaultValue != null ? this.formDefaultValue.hashCode() : 0);
|
|
result = 31 * result + (this.customExtraMap != null ? this.customExtraMap.hashCode() : 0);
|
|
result = 31 * result + (this.customExtraMap != null ? this.customExtraMap.hashCode() : 0);
|
|
result = 31 * result + (this.signFieldsBorderStyle != null ? this.signFieldsBorderStyle.hashCode() : 0);
|
|
result = 31 * result + (this.signFieldsBorderStyle != null ? this.signFieldsBorderStyle.hashCode() : 0);
|
|
|
|
+ result = 31 * result + (this.bordEffectType != null ? this.bordEffectType.hashCode() : 0);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -883,6 +935,30 @@ public class CAnnotStyle implements Serializable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void updateShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType bordEffectType, boolean update){
|
|
|
|
+ if (styleChangeListenerList != null && update) {
|
|
|
|
+ for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
|
|
|
|
+ onAnnotStyleChangeListener.onChangeShapeBordEffectType(bordEffectType);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void updateEditTextUnderLine(boolean addUnderLine, boolean update) {
|
|
|
|
+ if (styleChangeListenerList != null && update) {
|
|
|
|
+ for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
|
|
|
|
+ onAnnotStyleChangeListener.onChangeEditTextUnderline(addUnderLine);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void updateEditTextStrikeThrough(boolean addStrikeThrough, boolean update) {
|
|
|
|
+ if (styleChangeListenerList != null && update) {
|
|
|
|
+ for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
|
|
|
|
+ onAnnotStyleChangeListener.onChangeEditTextStrikeThrough(addStrikeThrough);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void addStyleChangeListener(OnAnnotStyleChangeListener styleChangeListener) {
|
|
public void addStyleChangeListener(OnAnnotStyleChangeListener styleChangeListener) {
|
|
this.styleChangeListenerList.add(styleChangeListener);
|
|
this.styleChangeListenerList.add(styleChangeListener);
|
|
}
|
|
}
|
|
@@ -965,6 +1041,12 @@ public class CAnnotStyle implements Serializable {
|
|
void onChangeExtraMap(Map<String, Object> extraMap);
|
|
void onChangeExtraMap(Map<String, Object> extraMap);
|
|
|
|
|
|
void onChangeSignFieldsBorderStyle(CPDFWidget.BorderStyle borderStyle);
|
|
void onChangeSignFieldsBorderStyle(CPDFWidget.BorderStyle borderStyle);
|
|
|
|
+
|
|
|
|
+ void onChangeShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType type);
|
|
|
|
+
|
|
|
|
+ void onChangeEditTextUnderline(boolean addUnderline);
|
|
|
|
+
|
|
|
|
+ void onChangeEditTextStrikeThrough(boolean addStrikeThrough);
|
|
}
|
|
}
|
|
|
|
|
|
public void setUpdatePropertyType(EditUpdatePropertyType type) {
|
|
public void setUpdatePropertyType(EditUpdatePropertyType type) {
|
|
@@ -993,7 +1075,9 @@ public class CAnnotStyle implements Serializable {
|
|
Mirror,
|
|
Mirror,
|
|
ReplaceImage,
|
|
ReplaceImage,
|
|
Export,
|
|
Export,
|
|
- Crop
|
|
|
|
|
|
+ Crop,
|
|
|
|
+ UnderLine,
|
|
|
|
+ StrikeThrough
|
|
}
|
|
}
|
|
|
|
|
|
public enum Mirror{
|
|
public enum Mirror{
|