# MediaType

# MediaType

Artifact:[androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/content/MediaType.+class:androidx.compose.foundation.content.MediaType)  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  @ExperimentalFoundationApi
  class MediaType
  ```
  - android  

  ```
  class MediaType
  ```

*** ** * ** ***

Type identifier for contents that are transferable between applications or processes. Although mime type format was standardized, each platform is free to choose how they define media types. Therefore, this class has an expect modifier for different platforms to specify how they define certain common media types like Text, and Image.

## Summary

|                                      ### Public companion properties                                      |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| [MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType) | [All](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#All()) Matches all content types.                                                                                        | Cmn android |
| [MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType) | [HtmlText](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#HtmlText()) Text that represents an HTML content.                                                                   | Cmn android |
| [MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType) | [Image](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#Image()) Any type of image like PNG, JPEG, or GIFs.                                                                    | Cmn android |
| [MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType) | [PlainText](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#PlainText()) Plain text that's only decoded from its raw representation, does not define or carry any annotations. | Cmn android |
| [MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType) | [Text](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#Text()) Any type of text, html, stylized, or plain.                                                                     | Cmn android |

|                                                                                                          ### Public constructors                                                                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| [MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#MediaType(kotlin.String))`(representation: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` | Cmn android |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` | android |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#hashCode())`()`                                                                                            | android |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#toString())`()`                                                                                            | android |

|                               ### Public properties                               |
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [representation](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType#representation()) How this[MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType)is represented in a specific platform. | Cmn android |

## Public companion properties

### All

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
val All: MediaType
```

Matches all content types.  

### HtmlText

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
val HtmlText: MediaType
```

Text that represents an HTML content.  

### Image

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
val Image: MediaType
```

Any type of image like PNG, JPEG, or GIFs.  

### PlainText

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
val PlainText: MediaType
```

Plain text that's only decoded from its raw representation, does not define or carry any annotations.  

### Text

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
val Text: MediaType
```

Any type of text, html, stylized, or plain.

## Public constructors

### MediaType

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
MediaType(representation: String)
```

## Public functions

### equals

android  

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

android  

```
open fun hashCode(): Int
```  

### toString

android  

```
open fun toString(): String
```

## Public properties

### representation

Cmnandroid  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0)  

```
val representation: String
```

How this[MediaType](https://developer.android.com/reference/kotlin/androidx/compose/foundation/content/MediaType)is represented in a specific platform.