Home | History | Annotate | Download | only in resources
      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.resources;
     18 
     19 /**
     20  * An enum representing a resource qualifier value.
     21  */
     22 public interface ResourceEnum {
     23 
     24     /**
     25      * Returns the resource string. This is to be used in resource folder names.
     26      */
     27     String getResourceValue();
     28 
     29     /**
     30      * Whether the value actually used on device. This returns true only if a device can report
     31      * this value, false if it's just used to qualify resources.
     32      */
     33     boolean isValidValueForDevice();
     34 
     35     /**
     36      * Whether the value is neither used for device nor resources. This returns false when
     37      * the value is only used for internal usage in the custom editors.
     38      */
     39     boolean isFakeValue();
     40 
     41     /**
     42      * Returns a short string for display value. The string does not need to show the context.
     43      * <p/>For instance "exposed", which can be the value for the keyboard state or the navigation
     44      * state, would be valid since something else in the UI is expected to show if this is about the
     45      * keyboard or the navigation state.
     46      *
     47      * @see #getLongDisplayValue()
     48      */
     49     String getShortDisplayValue();
     50 
     51     /**
     52      * Returns a long string for display value. This must not only include the enum value but
     53      * context (qualifier) about what the value represents.
     54      * <p/>For instance "Exposed keyboard", and "Export navigation", as "exposed" would not be
     55      * enough to know what qualifier the value is about.
     56      *
     57      * @see #getShortDisplayValue()
     58      */
     59     String getLongDisplayValue();
     60 }
     61