15c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez/*
25c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * Copyright (C) 2017 The Android Open Source Project
35c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez *
45c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * Licensed under the Apache License, Version 2.0 (the "License");
55c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * you may not use this file except in compliance with the License.
65c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * You may obtain a copy of the License at
75c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez *
85c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez *      http://www.apache.org/licenses/LICENSE-2.0
95c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez *
105c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * Unless required by applicable law or agreed to in writing, software
115c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * distributed under the License is distributed on an "AS IS" BASIS,
125c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * See the License for the specific language governing permissions and
145c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * limitations under the License.
155c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez */
165c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
175c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezpackage com.android.layout.remote.api;
185c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
195c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport com.android.layout.remote.util.RemoteInputStream;
205c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
215c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport org.xmlpull.v1.XmlPullParser;
225c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport org.xmlpull.v1.XmlPullParserException;
235c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
245c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport java.io.IOException;
255c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport java.io.Reader;
265c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport java.rmi.Remote;
275c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezimport java.rmi.RemoteException;
285c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
295c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez/**
305c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez * Remote version of the {@link XmlPullParser} interface
315c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez */
325c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perezpublic interface RemoteXmlPullParser extends Remote {
335c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    void setFeature(String name, boolean state) throws XmlPullParserException, RemoteException;
345c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
355c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    boolean getFeature(String name) throws RemoteException;
365c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
375c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    void setProperty(String name, Object value) throws XmlPullParserException, RemoteException;
385c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
395c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    Object getProperty(String name) throws RemoteException;
405c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
415c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    void setInput(Reader in) throws XmlPullParserException, RemoteException;
425c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
435c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    void setInput(RemoteInputStream inputStream, String inputEncoding)
445c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez            throws XmlPullParserException, RemoteException;
455c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
465c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getInputEncoding() throws RemoteException;
475c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
485c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    void defineEntityReplacementText(String entityName, String replacementText)
495c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez            throws XmlPullParserException, RemoteException;
505c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
515c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int getNamespaceCount(int depth) throws XmlPullParserException, RemoteException;
525c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
535c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getNamespacePrefix(int pos) throws XmlPullParserException, RemoteException;
545c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
555c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getNamespaceUri(int pos) throws XmlPullParserException, RemoteException;
565c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
575c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getNamespace(String prefix) throws RemoteException;
585c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
595c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int getDepth() throws RemoteException;
605c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
615c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getPositionDescription() throws RemoteException;
625c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
635c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int getLineNumber() throws RemoteException;
645c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
655c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int getColumnNumber() throws RemoteException;
665c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
675c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    boolean isWhitespace() throws XmlPullParserException, RemoteException;
685c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
695c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getText() throws RemoteException;
705c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
715c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    char[] getTextCharacters(int[] holderForStartAndLength) throws RemoteException;
725c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
735c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getNamespace() throws RemoteException;
745c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
755c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getName() throws RemoteException;
765c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
775c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getPrefix() throws RemoteException;
785c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
795c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    boolean isEmptyElementTag() throws XmlPullParserException, RemoteException;
805c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
815c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int getAttributeCount() throws RemoteException;
825c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
835c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getAttributeNamespace(int index) throws RemoteException;
845c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
855c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getAttributeName(int index) throws RemoteException;
865c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
875c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getAttributePrefix(int index) throws RemoteException;
885c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
895c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getAttributeType(int index) throws RemoteException;
905c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
915c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    boolean isAttributeDefault(int index) throws RemoteException;
925c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
935c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getAttributeValue(int index) throws RemoteException;
945c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
955c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String getAttributeValue(String namespace, String name) throws RemoteException;
965c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
975c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int getEventType() throws XmlPullParserException, RemoteException;
985c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
995c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int next() throws XmlPullParserException, IOException, RemoteException;
1005c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
1015c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int nextToken() throws XmlPullParserException, IOException, RemoteException;
1025c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
1035c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    void require(int type, String namespace, String name)
1045c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez            throws XmlPullParserException, IOException, RemoteException;
1055c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
1065c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    String nextText() throws XmlPullParserException, IOException, RemoteException;
1075c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez
1085c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez    int nextTag() throws XmlPullParserException, IOException, RemoteException;
1095c5efc433eb4cc81f59bcfaf28f5e72b38f7a829Diego Perez}
110