1 /* 2 * Copyright (C) 2010 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.layoutlib.api; 18 19 /** 20 * 21 * @deprecated 22 * 23 */ 24 public interface IProjectCallback { 25 26 /** 27 * Loads a custom view with the given constructor signature and arguments. 28 * @param name The fully qualified name of the class. 29 * @param constructorSignature The signature of the class to use 30 * @param constructorArgs The arguments to use on the constructor 31 * @return A newly instantiated android.view.View object. 32 * @throws ClassNotFoundException 33 * @throws Exception 34 */ 35 @SuppressWarnings("unchecked") 36 Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs) 37 throws ClassNotFoundException, Exception; 38 39 /** 40 * Returns the namespace of the application. 41 * <p/>This lets the Layout Lib load custom attributes for custom views. 42 */ 43 String getNamespace(); 44 45 /** 46 * Resolves the id of a resource Id. 47 * <p/>The resource id is the value of a <code>R.<type>.<name></code>, and 48 * this method will return both the type and name of the resource. 49 * @param id the Id to resolve. 50 * @return an array of 2 strings containing the resource name and type, or null if the id 51 * does not match any resource. 52 */ 53 String[] resolveResourceValue(int id); 54 55 /** 56 * Resolves the id of a resource Id of type int[] 57 * <p/>The resource id is the value of a R.styleable.<name>, and this method will 58 * return the name of the resource. 59 * @param id the Id to resolve. 60 * @return the name of the resource or <code>null</code> if not found. 61 */ 62 String resolveResourceValue(int[] id); 63 64 /** 65 * Returns the id of a resource. 66 * <p/>The provided type and name must match an existing constant defined as 67 * <code>R.<type>.<name></code>. 68 * @param type the type of the resource 69 * @param name the name of the resource 70 * @return an Integer containing the resource Id, or <code>null</code> if not found. 71 */ 72 Integer getResourceValue(String type, String name); 73 } 74