aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2020-02-17 22:29:29 +0000
committerAndreas Beeker <kiwiwings@apache.org>2020-02-17 22:29:29 +0000
commitbc969fe4aa27bfb7d044e2ae4588f74754d45f6d (patch)
tree07d7ade1d24ba5be04c0ab5d50bfe845b7b52c7d /src/ooxml/java/org/apache/poi
parent221f840adb4039b92ada2a40e9da543d6d0c7d27 (diff)
downloadpoi-bc969fe4aa27bfb7d044e2ae4588f74754d45f6d.tar.gz
poi-bc969fe4aa27bfb7d044e2ae4588f74754d45f6d.zip
PPTX2PNG - fix SVG gradients
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1874150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi')
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/draw/SVGPOIGraphics2D.java72
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/draw/SVGRenderExtension.java185
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/util/OutputFormat.java109
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java81
4 files changed, 369 insertions, 78 deletions
diff --git a/src/ooxml/java/org/apache/poi/xslf/draw/SVGPOIGraphics2D.java b/src/ooxml/java/org/apache/poi/xslf/draw/SVGPOIGraphics2D.java
new file mode 100644
index 0000000000..a057d6db7d
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xslf/draw/SVGPOIGraphics2D.java
@@ -0,0 +1,72 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.apache.poi.xslf.draw;
+
+import java.awt.RenderingHints;
+import java.util.Map;
+
+import org.apache.batik.svggen.SVGGeneratorContext;
+import org.apache.batik.svggen.SVGGeneratorContext.GraphicContextDefaults;
+import org.apache.batik.svggen.SVGGraphics2D;
+import org.apache.poi.util.Internal;
+import org.w3c.dom.Document;
+
+/**
+ * Wrapper class to pass changes to rendering hints down to the svg graphics context defaults
+ * which can be read by the extension handlers
+ */
+@Internal
+public class SVGPOIGraphics2D extends SVGGraphics2D {
+
+ private final RenderingHints hints;
+
+ public SVGPOIGraphics2D(Document document) {
+ super(getCtx(document), false);
+ hints = getGeneratorContext().getGraphicContextDefaults().getRenderingHints();
+ }
+
+ private static SVGGeneratorContext getCtx(Document document) {
+ SVGGeneratorContext context = SVGGeneratorContext.createDefault(document);
+ context.setExtensionHandler(new SVGRenderExtension());
+ GraphicContextDefaults defs = new GraphicContextDefaults();
+ defs.setRenderingHints(new RenderingHints(null));
+ context.setGraphicContextDefaults(defs);
+ return context;
+ }
+
+ @Override
+ public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue) {
+ hints.put(hintKey, hintValue);
+ super.setRenderingHint(hintKey, hintValue);
+ }
+
+ @Override
+ public void setRenderingHints(Map hints) {
+ this.hints.clear();
+ this.hints.putAll(hints);
+ super.setRenderingHints(hints);
+ }
+
+ @Override
+ public void addRenderingHints(Map hints) {
+ this.hints.putAll(hints);
+ super.addRenderingHints(hints);
+ }
+}
diff --git a/src/ooxml/java/org/apache/poi/xslf/draw/SVGRenderExtension.java b/src/ooxml/java/org/apache/poi/xslf/draw/SVGRenderExtension.java
new file mode 100644
index 0000000000..35536714ed
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xslf/draw/SVGRenderExtension.java
@@ -0,0 +1,185 @@
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.xslf.draw;
+
+import static java.awt.MultipleGradientPaint.ColorSpaceType.LINEAR_RGB;
+import static org.apache.batik.util.SVGConstants.*;
+
+import java.awt.Color;
+import java.awt.LinearGradientPaint;
+import java.awt.MultipleGradientPaint;
+import java.awt.Paint;
+import java.awt.RadialGradientPaint;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.TexturePaint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.WritableRaster;
+
+import org.apache.batik.svggen.DefaultExtensionHandler;
+import org.apache.batik.svggen.SVGColor;
+import org.apache.batik.svggen.SVGGeneratorContext;
+import org.apache.batik.svggen.SVGPaintDescriptor;
+import org.apache.batik.svggen.SVGTexturePaint;
+import org.apache.poi.sl.draw.Drawable;
+import org.apache.poi.sl.draw.PathGradientPaint;
+import org.apache.poi.sl.draw.PathGradientPaint.PathGradientContext;
+import org.apache.poi.util.Internal;
+import org.w3c.dom.Element;
+
+
+/**
+ * Extension of Batik's DefaultExtensionHandler which handles different kinds of Paint objects
+ * <p>
+ * Taken (with permission) from https://gist.github.com/msteiger/4509119,
+ * including the fixes that are discussed in the comments
+ *
+ * @author Martin Steiger
+ *
+ * @see <a href="https://stackoverflow.com/questions/14258206/">Gradient paints not working in Apache Batik's svggen</a>
+ * @see <a href="https://issues.apache.org/jira/browse/BATIK-1032">BATIK-1032</a>
+ */
+@Internal
+public class SVGRenderExtension extends DefaultExtensionHandler {
+ @Override
+ public SVGPaintDescriptor handlePaint(Paint paint, SVGGeneratorContext generatorContext) {
+ if (paint instanceof LinearGradientPaint) {
+ return getLgpDescriptor((LinearGradientPaint)paint, generatorContext);
+ }
+
+ if (paint instanceof RadialGradientPaint) {
+ return getRgpDescriptor((RadialGradientPaint)paint, generatorContext);
+ }
+
+ if (paint instanceof PathGradientPaint) {
+ return getPathDescriptor((PathGradientPaint)paint, generatorContext);
+ }
+
+ return super.handlePaint(paint, generatorContext);
+ }
+
+ private SVGPaintDescriptor getPathDescriptor(PathGradientPaint gradient, SVGGeneratorContext genCtx) {
+ RenderingHints hints = genCtx.getGraphicContextDefaults().getRenderingHints();
+ Shape shape = (Shape)hints.get(Drawable.GRADIENT_SHAPE);
+ if (shape == null) {
+ return null;
+ }
+
+ PathGradientContext context = gradient.createContext(ColorModel.getRGBdefault(), shape.getBounds(), shape.getBounds2D(), new AffineTransform(), hints);
+ WritableRaster raster = context.createRaster();
+ BufferedImage img = new BufferedImage(context.getColorModel(), raster, false, null);
+
+ SVGTexturePaint texturePaint = new SVGTexturePaint(genCtx);
+ TexturePaint tp = new TexturePaint(img, shape.getBounds2D());
+ return texturePaint.toSVG(tp);
+ }
+
+
+ private SVGPaintDescriptor getRgpDescriptor(RadialGradientPaint gradient, SVGGeneratorContext genCtx) {
+ Element gradElem = genCtx.getDOMFactory().createElementNS(SVG_NAMESPACE_URI, SVG_RADIAL_GRADIENT_TAG);
+
+ // Create and set unique XML id
+ String id = genCtx.getIDGenerator().generateID("gradient");
+ gradElem.setAttribute(SVG_ID_ATTRIBUTE, id);
+
+ // Set x,y pairs
+ setPoint(gradElem, gradient.getCenterPoint(), "cx", "cy");
+ setPoint(gradElem, gradient.getFocusPoint(), "fx", "fy");
+
+ gradElem.setAttribute("r", String.valueOf(gradient.getRadius()));
+
+ addMgpAttributes(gradElem, genCtx, gradient);
+
+ return new SVGPaintDescriptor("url(#" + id + ")", SVG_OPAQUE_VALUE, gradElem);
+ }
+
+ private SVGPaintDescriptor getLgpDescriptor(LinearGradientPaint gradient, SVGGeneratorContext genCtx) {
+ Element gradElem = genCtx.getDOMFactory().createElementNS(SVG_NAMESPACE_URI, SVG_LINEAR_GRADIENT_TAG);
+
+ // Create and set unique XML id
+ String id = genCtx.getIDGenerator().generateID("gradient");
+ gradElem.setAttribute(SVG_ID_ATTRIBUTE, id);
+
+ // Set x,y pairs
+ setPoint(gradElem, gradient.getStartPoint(), "x1", "y1");
+ setPoint(gradElem, gradient.getEndPoint(), "x2", "y2");
+
+ addMgpAttributes(gradElem, genCtx, gradient);
+
+ return new SVGPaintDescriptor("url(#" + id + ")", SVG_OPAQUE_VALUE, gradElem);
+ }
+
+ private void addMgpAttributes(Element gradElem, SVGGeneratorContext genCtx, MultipleGradientPaint gradient) {
+ gradElem.setAttribute(SVG_GRADIENT_UNITS_ATTRIBUTE, SVG_USER_SPACE_ON_USE_VALUE);
+
+ // Set cycle method
+ final String cycleVal;
+ switch (gradient.getCycleMethod()) {
+ case REFLECT:
+ cycleVal = SVG_REFLECT_VALUE;
+ break;
+ case REPEAT:
+ cycleVal = SVG_REPEAT_VALUE;
+ break;
+ case NO_CYCLE:
+ default:
+ cycleVal = SVG_PAD_VALUE;
+ break;
+ }
+ gradElem.setAttribute(SVG_SPREAD_METHOD_ATTRIBUTE, cycleVal);
+
+ // Set color space
+ final String colorSpace = (gradient.getColorSpace() == LINEAR_RGB) ? SVG_LINEAR_RGB_VALUE : SVG_SRGB_VALUE;
+ gradElem.setAttribute(SVG_COLOR_INTERPOLATION_ATTRIBUTE, colorSpace);
+
+ // Set transform matrix if not identity
+ AffineTransform tf = gradient.getTransform();
+ if (!tf.isIdentity()) {
+ String matrix = "matrix(" + tf.getScaleX() + " " + tf.getShearY()
+ + " " + tf.getShearX() + " " + tf.getScaleY() + " "
+ + tf.getTranslateX() + " " + tf.getTranslateY() + ")";
+ gradElem.setAttribute(SVG_GRADIENT_TRANSFORM_ATTRIBUTE, matrix);
+ }
+
+ // Convert gradient stops
+ Color[] colors = gradient.getColors();
+ float[] fracs = gradient.getFractions();
+
+ for (int i = 0; i < colors.length; i++) {
+ Element stop = genCtx.getDOMFactory().createElementNS(SVG_NAMESPACE_URI, SVG_STOP_TAG);
+ SVGPaintDescriptor pd = SVGColor.toSVG(colors[i], genCtx);
+
+ stop.setAttribute(SVG_OFFSET_ATTRIBUTE, (int) (fracs[i] * 100.0f) + "%");
+ stop.setAttribute(SVG_STOP_COLOR_ATTRIBUTE, pd.getPaintValue());
+
+ if (colors[i].getAlpha() != 255) {
+ stop.setAttribute(SVG_STOP_OPACITY_ATTRIBUTE, pd.getOpacityValue());
+ }
+
+ gradElem.appendChild(stop);
+ }
+ }
+
+ private static void setPoint(Element gradElem, Point2D point, String x, String y) {
+ gradElem.setAttribute(x, Double.toString(point.getX()));
+ gradElem.setAttribute(y, Double.toString(point.getY()));
+ }
+}
diff --git a/src/ooxml/java/org/apache/poi/xslf/util/OutputFormat.java b/src/ooxml/java/org/apache/poi/xslf/util/OutputFormat.java
new file mode 100644
index 0000000000..9f0a6f7742
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xslf/util/OutputFormat.java
@@ -0,0 +1,109 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.apache.poi.xslf.util;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.Closeable;
+import java.io.File;
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+
+import javax.imageio.ImageIO;
+
+import org.apache.batik.dom.GenericDOMImplementation;
+import org.apache.batik.svggen.SVGGraphics2D;
+import org.apache.poi.sl.draw.Drawable;
+import org.apache.poi.util.Internal;
+import org.apache.poi.xslf.draw.SVGPOIGraphics2D;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * Output formats for PPTX2PNG
+ */
+@Internal
+interface OutputFormat extends Closeable {
+
+ Graphics2D getGraphics2D(double width, double height);
+
+ void writeOut(MFProxy proxy, File outFile) throws IOException;
+
+ class SVGFormat implements OutputFormat {
+ static final String svgNS = "http://www.w3.org/2000/svg";
+ private SVGGraphics2D svgGenerator;
+
+ @Override
+ public Graphics2D getGraphics2D(double width, double height) {
+ // Get a DOMImplementation.
+ DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
+
+ // Create an instance of org.w3c.dom.Document.
+ Document document = domImpl.createDocument(svgNS, "svg", null);
+ svgGenerator = new SVGPOIGraphics2D(document);
+ svgGenerator.setSVGCanvasSize(new Dimension((int)width, (int)height));
+ return svgGenerator;
+ }
+
+ @Override
+ public void writeOut(MFProxy proxy, File outFile) throws IOException {
+ svgGenerator.stream(outFile.getCanonicalPath(), true);
+ }
+
+ @Override
+ public void close() throws IOException {
+ svgGenerator.dispose();
+ }
+ }
+
+ class BitmapFormat implements OutputFormat {
+ private final String format;
+ private BufferedImage img;
+ private Graphics2D graphics;
+
+ BitmapFormat(String format) {
+ this.format = format;
+ }
+
+ @Override
+ public Graphics2D getGraphics2D(double width, double height) {
+ img = new BufferedImage((int)width, (int)height, BufferedImage.TYPE_INT_ARGB);
+ graphics = img.createGraphics();
+ graphics.setRenderingHint(Drawable.BUFFERED_IMAGE, new WeakReference<>(img));
+ return graphics;
+ }
+
+ @Override
+ public void writeOut(MFProxy proxy, File outFile) throws IOException {
+ if (!"null".equals(format)) {
+ ImageIO.write(img, format, outFile);
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (graphics != null) {
+ graphics.dispose();
+ img.flush();
+ }
+ }
+ }
+}
diff --git a/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java b/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
index bb01debd23..1e4c92a5b1 100644
--- a/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
+++ b/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
@@ -20,33 +20,24 @@
package org.apache.poi.xslf.util;
import java.awt.AlphaComposite;
-import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Dimension2D;
-import java.awt.image.BufferedImage;
-import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.ref.WeakReference;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Pattern;
-import javax.imageio.ImageIO;
-
-import org.apache.batik.dom.GenericDOMImplementation;
-import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.poi.common.usermodel.GenericRecord;
import org.apache.poi.poifs.filesystem.FileMagic;
-import org.apache.poi.sl.draw.Drawable;
import org.apache.poi.sl.draw.EmbeddedExtractor.EmbeddedPart;
import org.apache.poi.util.Dimension2DDouble;
import org.apache.poi.util.GenericRecordJsonWriter;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
+import org.apache.poi.xslf.util.OutputFormat.BitmapFormat;
+import org.apache.poi.xslf.util.OutputFormat.SVGFormat;
/**
* An utility to convert slides of a .pptx slide show to a PNG image
@@ -266,7 +257,7 @@ public final class PPTX2PNG {
// draw stuff
proxy.draw(graphics);
- outputFormat.writeOut(proxy, slideNo);
+ outputFormat.writeOut(proxy, new File(outdir, calcOutFile(proxy, slideNo)));
}
}
} catch (NoScratchpadException e) {
@@ -395,70 +386,4 @@ public final class PPTX2PNG {
super(cause);
}
}
-
- private interface OutputFormat extends Closeable {
- Graphics2D getGraphics2D(double width, double height);
- void writeOut(MFProxy proxy, int slideNo) throws IOException;
- }
-
- private class SVGFormat implements OutputFormat {
- static final String svgNS = "http://www.w3.org/2000/svg";
- private SVGGraphics2D svgGenerator;
-
- @Override
- public Graphics2D getGraphics2D(double width, double height) {
- // Get a DOMImplementation.
- DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
-
- // Create an instance of org.w3c.dom.Document.
- Document document = domImpl.createDocument(svgNS, "svg", null);
- svgGenerator = new SVGGraphics2D(document);
- svgGenerator.setSVGCanvasSize(new Dimension((int)width, (int)height));
- return svgGenerator;
- }
-
- @Override
- public void writeOut(MFProxy proxy, int slideNo) throws IOException {
- File outfile = new File(outdir, calcOutFile(proxy, slideNo));
- svgGenerator.stream(outfile.getCanonicalPath(), true);
- }
-
- @Override
- public void close() throws IOException {
- svgGenerator.dispose();
- }
- }
-
- private class BitmapFormat implements OutputFormat {
- private final String format;
- private BufferedImage img;
- private Graphics2D graphics;
-
- BitmapFormat(String format) {
- this.format = format;
- }
-
- @Override
- public Graphics2D getGraphics2D(double width, double height) {
- img = new BufferedImage((int)width, (int)height, BufferedImage.TYPE_INT_ARGB);
- graphics = img.createGraphics();
- graphics.setRenderingHint(Drawable.BUFFERED_IMAGE, new WeakReference<>(img));
- return graphics;
- }
-
- @Override
- public void writeOut(MFProxy proxy, int slideNo) throws IOException {
- if (!"null".equals(format)) {
- ImageIO.write(img, format, new File(outdir, calcOutFile(proxy, slideNo)));
- }
- }
-
- @Override
- public void close() throws IOException {
- if (graphics != null) {
- graphics.dispose();
- img.flush();
- }
- }
- }
}
on> Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/user/backend.php
blob: 1f3696593651c3dc7d32bc080fac3778104ecbda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
 * @author Aldo "xoen" Giambelluca <xoen@xoen.org>
 * @author Dominik Schmidt <dev@dominik-schmidt.de>
 * @author Jakob Sack <mail@jakobsack.de>
 * @author Joas Schilling <nickvergessen@owncloud.com>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Roeland Jago Douma <rullzer@owncloud.com>
 * @author Sam Tuke <mail@samtuke.com>
 * @author Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
 *
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

/**
 * error code for functions not provided by the user backend
 * @deprecated Use \OC_User_Backend::NOT_IMPLEMENTED instead
 */
define('OC_USER_BACKEND_NOT_IMPLEMENTED',   -501);

/**
 * actions that user backends can define
 */
/** @deprecated Use \OC_User_Backend::CREATE_USER instead */
define('OC_USER_BACKEND_CREATE_USER',       1 << 0);
/** @deprecated Use \OC_User_Backend::SET_PASSWORD instead */
define('OC_USER_BACKEND_SET_PASSWORD',      1 << 4);
/** @deprecated Use \OC_User_Backend::CHECK_PASSWORD instead */
define('OC_USER_BACKEND_CHECK_PASSWORD',    1 << 8);
/** @deprecated Use \OC_User_Backend::GET_HOME instead */
define('OC_USER_BACKEND_GET_HOME',          1 << 12);
/** @deprecated Use \OC_User_Backend::GET_DISPLAYNAME instead */
define('OC_USER_BACKEND_GET_DISPLAYNAME',   1 << 16);
/** @deprecated Use \OC_User_Backend::SET_DISPLAYNAME instead */
define('OC_USER_BACKEND_SET_DISPLAYNAME',   1 << 20);
/** @deprecated Use \OC_User_Backend::PROVIDE_AVATAR instead */
define('OC_USER_BACKEND_PROVIDE_AVATAR',    1 << 24);
/** @deprecated Use \OC_User_Backend::COUNT_USERS instead */
define('OC_USER_BACKEND_COUNT_USERS',       1 << 28);

/**
 * Abstract base class for user management. Provides methods for querying backend
 * capabilities.
 */
abstract class OC_User_Backend extends \OC\User\Backend implements \OCP\UserInterface {

}