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 *     troger
016 *
017 * $Id$
018 */
019
020package org.nuxeo.ecm.webapp.note;
021
022import java.util.List;
023import java.util.Map;
024
025import javax.servlet.http.Part;
026
027import org.nuxeo.ecm.core.api.DocumentModel;
028
029/**
030 * Provides actions related to inserting an image for Note documents.
031 *
032 * @author <a href="mailto:troger@nuxeo.com">Thomas Roger</a>
033 */
034public interface EditorImageActions {
035
036    String getSelectedTab();
037
038    /**
039     * @since 7.1
040     */
041    void setUploadedImage(Part uploadedImage);
042
043    /**
044     * @since 7.1
045     */
046    Part getUploadedImage();
047
048    /**
049     * @deprecated since 7.1, Part already holds a filename
050     */
051    @Deprecated
052    void setUploadedImageName(String uploadedImageName);
053
054    /**
055     * @deprecated since 7.1, Part already holds a filename
056     */
057    @Deprecated
058    String getUploadedImageName();
059
060    String uploadImage();
061
062    boolean getIsImageUploaded();
063
064    boolean getInCreationMode();
065
066    String getUrlForImage();
067
068    // image searching related methods
069    String searchImages();
070
071    String searchVideos();
072
073    List<DocumentModel> getSearchImageResults();
074
075    /**
076     * List of result of the searched the videos.
077     *
078     * @return The list of results.
079     * @since 5.9.5
080     */
081    List<DocumentModel> getSearchVideosResults();
082
083    boolean getHasSearchResults();
084
085    /**
086     * Return true if the search has results.
087     *
088     * @return If the search has results.
089     * @since 5.9.5
090     */
091    boolean getHasSearchVideosResults();
092
093    String getSearchKeywords();
094
095    void setSearchKeywords(final String searchKeywords);
096
097    List<Map<String, String>> getSizes();
098
099    void setSelectedSize(final String selectedSize);
100
101    String getSelectedSize();
102
103    String getImageProperty();
104
105    /**
106     * Get the URL of a transcoded video for a specific format.
107     *
108     * @param video The video document.
109     * @param type The type of video.
110     * @return The URL of the selected video.
111     * @since 5.9.5
112     */
113    String getURLVideo(DocumentModel video, String type);
114}