001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
018 */
019
020package org.nuxeo.ecm.platform.picture.web;
021
022import java.io.IOException;
023import java.util.ArrayList;
024
025import org.nuxeo.ecm.core.api.Blob;
026import org.nuxeo.ecm.platform.url.api.DocumentView;
027
028/**
029 * Provides picture-related actions.
030 *
031 * @author <a href="mailto:ldoguin@nuxeo.com">Laurent Doguin</a>
032 */
033public interface PictureManager {
034
035    /**
036     * Creates and saves a picture document.
037     *
038     * @deprecated since 5.5
039     */
040    @Deprecated
041    String addPicture();
042
043    String crop() throws IOException;
044
045    /**
046     * Turns every view of a picture 90 degrees to the left.
047     */
048    String rotate90left() throws IOException;
049
050    /**
051     * Turns every view of a picture 90 degrees to the right.
052     */
053    String rotate90right() throws IOException;
054
055    void download(DocumentView docView);
056
057    /**
058     * Gets the content of the Picture. It's the uploaded file.
059     *
060     * @return a Blob holding the uploaded file
061     */
062    Blob getFileContent();
063
064    /**
065     * Sets the content of the Picture. It's the uploaded file.
066     *
067     * @param fileContent a Blob holding the uploaded file
068     */
069    void setFileContent(Blob fileContent);
070
071    /**
072     * Gets the filename of the uploaded file.
073     *
074     * @return a String holding the filename.
075     */
076    String getFilename();
077
078    /**
079     * Sets the filename of the uploaded file.
080     *
081     * @param filename a String holding the filename.
082     */
083    void setFilename(String filename);
084
085    /**
086     * Gets the fileurl. FileUrl is used to create valid link expression for the download function from the index of the
087     * picture's views.
088     *
089     * @return a String holding the fileurl.
090     */
091    String getFileurlPicture();
092
093    /**
094     * Sets the fileurl. FileUrl is used to create valid link expression for the download function from the index of the
095     * picture's views.
096     *
097     * @param fileurlPicture a String holding the fileurl.
098     */
099    void setFileurlPicture(String fileurlPicture);
100
101    /**
102     * Gets the index. This index is used to display the selected picture in view_picture.
103     *
104     * @return an Integer holding the index.
105     */
106    Integer getIndex();
107
108    /**
109     * Sets the index. This index is used to display the selected picture in view_picture.
110     *
111     * @param index an Integer holding the index.
112     */
113    void setIndex(Integer index);
114
115    /**
116     * Sets the selectedItems. This array contains an index and the title of each picture's view. It's used to
117     * dynamically the selected view.
118     *
119     * @param selectItems an Array holding the selectItems.
120     */
121    void setSelectItems(ArrayList selectItems);
122
123    /**
124     * Gets the selectedItems. This array contains an index and the title of each picture's view. It's used to
125     * dynamically the selected view.
126     *
127     * @return an Array holding the selectItems.
128     */
129    ArrayList getSelectItems();
130
131    String getCropCoords();
132
133    void setCropCoords(String cropCoords);
134
135    /**
136     * Listener reinitializing values at every Document changes.
137     */
138    void resetFields();
139
140    void initialize();
141
142    void destroy();
143
144}