1 /* 2 * StatusBar.java 3 * 4 * Copyright (C) 2021 by RStudio, PBC 5 * 6 * Unless you have received this program directly from RStudio pursuant 7 * to the terms of a commercial license agreement with RStudio, then 8 * this program is licensed to you under the terms of version 3 of the 9 * GNU Affero General Public License. This program is distributed WITHOUT 10 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, 11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the 12 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. 13 * 14 */ 15 package org.rstudio.studio.client.workbench.views.source.editors.text.status; 16 17 import com.google.gwt.event.dom.client.ClickHandler; 18 import com.google.gwt.event.shared.HandlerRegistration; 19 import com.google.gwt.user.client.Command; 20 import com.google.gwt.user.client.Event.NativePreviewEvent; 21 22 public interface StatusBar 23 { 24 interface HideMessageHandler 25 { 26 // return 'true' to indicate message should be hidden onNativePreviewEvent(NativePreviewEvent preview)27 boolean onNativePreviewEvent(NativePreviewEvent preview); 28 } 29 30 int SCOPE_FUNCTION = 1; 31 int SCOPE_CHUNK = 2; 32 int SCOPE_SECTION = 3; 33 int SCOPE_SLIDE = 4; 34 int SCOPE_CLASS = 5; 35 int SCOPE_NAMESPACE = 6; 36 int SCOPE_LAMBDA = 7; 37 int SCOPE_ANON = 8; 38 int SCOPE_TOP_LEVEL = 9; 39 getPosition()40 StatusBarElement getPosition(); getScope()41 StatusBarElement getScope(); getLanguage()42 StatusBarElement getLanguage(); setPositionVisible(boolean visible)43 void setPositionVisible(boolean visible); setScopeVisible(boolean visible)44 void setScopeVisible(boolean visible); setScopeType(int type)45 void setScopeType(int type); 46 showMessage(String message)47 void showMessage(String message); showMessage(String message, int timeMs)48 void showMessage(String message, int timeMs); showMessage(String message, HideMessageHandler handler)49 void showMessage(String message, HideMessageHandler handler); hideMessage()50 void hideMessage(); 51 showNotebookProgress(String label)52 void showNotebookProgress(String label); updateNotebookProgress(int percent)53 void updateNotebookProgress(int percent); hideNotebookProgress(boolean immediately)54 void hideNotebookProgress(boolean immediately); addProgressClickHandler(ClickHandler handler)55 HandlerRegistration addProgressClickHandler(ClickHandler handler); addProgressCancelHandler(Command onCanceled)56 HandlerRegistration addProgressCancelHandler(Command onCanceled); 57 } 58