177f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio/* 277f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * Copyright (C) 2013 The Android Open Source Project 377f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * 477f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * Licensed under the Apache License, Version 2.0 (the "License"); 577f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * you may not use this file except in compliance with the License. 677f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * You may obtain a copy of the License at 777f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * 877f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * http://www.apache.org/licenses/LICENSE-2.0 977f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * 1077f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * Unless required by applicable law or agreed to in writing, software 1177f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * distributed under the License is distributed on an "AS IS" BASIS, 1277f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1377f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * See the License for the specific language governing permissions and 1477f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * limitations under the License. 1577f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio */ 1677f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio 1777f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Megliopackage android.support.v4.text; 1877f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio 1977f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio/** 2077f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * Interface for objects that use a heuristic for guessing at the paragraph direction by examining text. 2177f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio */ 2277f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Megliopublic interface TextDirectionHeuristicCompat { 2377f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio /** 2477f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * Guess if a chars array is in the RTL direction or not. 2577f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * 2677f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @param array the char array. 2777f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @param start start index, inclusive. 2877f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @param count the length to check, must not be negative and not greater than 2977f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * {@code array.length - start}. 3077f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @return true if all chars in the range are to be considered in a RTL direction, 3177f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * false otherwise. 3277f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio */ 3377f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio boolean isRtl(char[] array, int start, int count); 3477f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio 3577f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio /** 3677f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * Guess if a {@code CharSequence} is in the RTL direction or not. 3777f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * 3877f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @param cs the CharSequence. 3977f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @param start start index, inclusive. 4077f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @param count the length to check, must not be negative and not greater than 4177f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * {@code CharSequence.length() - start}. 4277f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * @return true if all chars in the range are to be considered in a RTL direction, 4377f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio * false otherwise. 4477f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio */ 4577f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio boolean isRtl(CharSequence cs, int start, int count); 4677f6bada6f88acea9025afce3eb0127d45411798Fabrice Di Meglio} 47