14b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio/*
24b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * Copyright (C) 2011 The Android Open Source Project
34b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio *
44b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * Licensed under the Apache License, Version 2.0 (the "License");
54b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * you may not use this file except in compliance with the License.
64b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * You may obtain a copy of the License at
74b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio *
84b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio *      http://www.apache.org/licenses/LICENSE-2.0
94b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio *
104b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * Unless required by applicable law or agreed to in writing, software
114b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * distributed under the License is distributed on an "AS IS" BASIS,
124b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * See the License for the specific language governing permissions and
144b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio * limitations under the License.
154b60c30838fbd635964f1e79c057de5048dcc66fFabrice Di Meglio */
16cb379120456d8065d742021fc5c66748fc8a11a8Doug Felt
17cb379120456d8065d742021fc5c66748fc8a11a8Doug Feltpackage android.text;
18cb379120456d8065d742021fc5c66748fc8a11a8Doug Felt
19cb379120456d8065d742021fc5c66748fc8a11a8Doug Felt/**
2057a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio * Interface for objects that use a heuristic for guessing at the paragraph direction by examining text.
21cb379120456d8065d742021fc5c66748fc8a11a8Doug Felt */
22cb379120456d8065d742021fc5c66748fc8a11a8Doug Feltpublic interface TextDirectionHeuristic {
2357a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio    /**
2457a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * Guess if a chars array is in the RTL direction or not.
2557a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     *
2657a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @param array the char array.
2757a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @param start start index, inclusive.
2857a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @param count the length to check, must not be negative and not greater than
2957a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     *          {@code array.length - start}.
3057a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @return true if all chars in the range are to be considered in a RTL direction,
3157a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     *          false otherwise.
3257a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     */
3357a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio    boolean isRtl(char[] array, int start, int count);
3457a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio
3557a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio    /**
3657a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * Guess if a {@code CharSequence} is in the RTL direction or not.
3757a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     *
3857a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @param cs the CharSequence.
3957a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @param start start index, inclusive.
4057a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @param count the length to check, must not be negative and not greater than
4157a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     *            {@code CharSequence.length() - start}.
4257a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     * @return true if all chars in the range are to be considered in a RTL direction,
4357a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     *          false otherwise.
4457a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio     */
4557a85740d721caf8dcd94a545b2dd920e8e84e01Fabrice Di Meglio    boolean isRtl(CharSequence cs, int start, int count);
46cb379120456d8065d742021fc5c66748fc8a11a8Doug Felt}
47