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