001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
020 */
021
022package org.nuxeo.ecm.platform.picture.web;
023
024import java.io.IOException;
025import java.util.ArrayList;
026
027import org.nuxeo.ecm.core.api.Blob;
028import org.nuxeo.ecm.platform.url.api.DocumentView;
029
030/**
031 * Provides picture-related actions.
032 *
033 * @author <a href="mailto:ldoguin@nuxeo.com">Laurent Doguin</a>
034 */
035public interface PictureManager {
036
037    String crop() throws IOException;
038
039    /**
040     * Turns every view of a picture 90 degrees to the left.
041     */
042    String rotate90left() throws IOException;
043
044    /**
045     * Turns every view of a picture 90 degrees to the right.
046     */
047    String rotate90right() throws IOException;
048
049    void download(DocumentView docView);
050
051    /**
052     * Gets the content of the Picture. It's the uploaded file.
053     *
054     * @return a Blob holding the uploaded file
055     */
056    Blob getFileContent();
057
058    /**
059     * Sets the content of the Picture. It's the uploaded file.
060     *
061     * @param fileContent a Blob holding the uploaded file
062     */
063    void setFileContent(Blob fileContent);
064
065    /**
066     * Gets the filename of the uploaded file.
067     *
068     * @return a String holding the filename.
069     */
070    String getFilename();
071
072    /**
073     * Sets the filename of the uploaded file.
074     *
075     * @param filename a String holding the filename.
076     */
077    void setFilename(String filename);
078
079    /**
080     * Gets the fileurl. FileUrl is used to create valid link expression for the download function from the index of the
081     * picture's views.
082     *
083     * @return a String holding the fileurl.
084     */
085    String getFileurlPicture();
086
087    /**
088     * Sets the fileurl. FileUrl is used to create valid link expression for the download function from the index of the
089     * picture's views.
090     *
091     * @param fileurlPicture a String holding the fileurl.
092     */
093    void setFileurlPicture(String fileurlPicture);
094
095    /**
096     * Gets the index. This index is used to display the selected picture in view_picture.
097     *
098     * @return an Integer holding the index.
099     */
100    Integer getIndex();
101
102    /**
103     * Sets the index. This index is used to display the selected picture in view_picture.
104     *
105     * @param index an Integer holding the index.
106     */
107    void setIndex(Integer index);
108
109    /**
110     * Sets the selectedItems. This array contains an index and the title of each picture's view. It's used to
111     * dynamically the selected view.
112     *
113     * @param selectItems an Array holding the selectItems.
114     */
115    void setSelectItems(ArrayList selectItems);
116
117    /**
118     * Gets the selectedItems. This array contains an index and the title of each picture's view. It's used to
119     * dynamically the selected view.
120     *
121     * @return an Array holding the selectItems.
122     */
123    ArrayList getSelectItems();
124
125    String getCropCoords();
126
127    void setCropCoords(String cropCoords);
128
129    /**
130     * Listener reinitializing values at every Document changes.
131     */
132    void resetFields();
133
134    void initialize();
135
136    void destroy();
137
138}