1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.inputmethod.latin.inputlogic; 18 19 import android.os.Bundle; 20 21 /** 22 * Provides an interface matching 23 * {@link android.view.inputmethod.InputConnection#performPrivateCommand(String,Bundle)}. 24 */ 25 public interface PrivateCommandPerformer { 26 /** 27 * API to send private commands from an input method to its connected 28 * editor. This can be used to provide domain-specific features that are 29 * only known between certain input methods and their clients. 30 * 31 * @param action Name of the command to be performed. This must be a scoped 32 * name, i.e. prefixed with a package name you own, so that 33 * different developers will not create conflicting commands. 34 * @param data Any data to include with the command. 35 * @return true if the command was sent (regardless of whether the 36 * associated editor understood it), false if the input connection is no 37 * longer valid. 38 */ performPrivateCommand(String action, Bundle data)39 boolean performPrivateCommand(String action, Bundle data); 40 } 41