# URIAction Class

> A text string, typically a hyperlink.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.2.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/URIAction
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/llms.txt

```cpp
class URIAction : Action
```

**Namespace:** `datalogics_interface`

**Inherits from:** [`Action`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/Action.md)

## Description

A Uniform Resource Identifier (URI) is a text string that identifies a resource on the Internet, typically a hyperlink to a web page.

A URI Action within a PDF file allows a reader to click on a hyperlink and open a separate web page or another PDF or other kind of file accessed through a web link.

**Uses types:** [`PDFDict`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/PDFDict.md)

## Constructors

### URIAction

```cpp
datalogics_interface::URIAction::URIAction(const std::string &uri, bool use_map)
```

*constructor*

**Parameters**

- `uri` (`const std::string &`): String for the URI
- `use_map` (`bool`): Send mouse position with the URI

General constructor

### URIAction

```cpp
datalogics_interface::URIAction::URIAction(URIAction &&) noexcept=default
```

*constructor*

**Parameters**

- (unnamed) ([`URIAction &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/URIAction.md))

### ~URIAction

```cpp
datalogics_interface::URIAction::~URIAction() override
```

*destructor*

## Methods

### get_is_map

```cpp
bool datalogics_interface::URIAction::get_is_map() const
```

**Returns:** `bool`

true if mouse coordinates will be sent with the URI, false otherwise.

When true, the position of the mouse click that triggered the action is appended to the URI as a query parameter.

### get_pdf_dict

```cpp
PDFDict datalogics_interface::Action::get_pdf_dict()
```

**Returns:** [`PDFDict`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/PDFDict.md)

The underlying PDF dictionary for this Action.

Retrieve the PDFObject representation of this object.

### get_subtype

```cpp
std::string datalogics_interface::Action::get_subtype() const
```

**Returns:** `std::string`

The subtype string for this action, such as "GoTo", "URI", "Launch", or "GoToR".

The action's subtype.

### get_uri

```cpp
std::string datalogics_interface::URIAction::get_uri() const
```

**Returns:** `std::string`

The Uniform Resource Identifier string for this action.

The URI string for this action.

### operator=

```cpp
URIAction & datalogics_interface::URIAction::operator=(URIAction &&) noexcept=default
```

**Parameters**

- (unnamed) ([`URIAction &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/URIAction.md))

**Returns:** [`URIAction &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/URIAction.md)

### operator==

```cpp
bool datalogics_interface::Action::operator==(const Action &other) const
```

**Parameters**

- `other` ([`const Action &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.2.0/class/Action.md))

**Returns:** `bool`

true if the two objects refer to the same action, false otherwise.

Two Actions are considered equal if they refer to the same underlying PDF action object.

### set_is_map

```cpp
void datalogics_interface::URIAction::set_is_map(bool use_map)
```

**Parameters**

- `use_map` (`bool`): true to send mouse coordinates with the URI, false otherwise.

**Returns:** `void`

Set whether to include mouse coordinates with the URI.

### set_uri

```cpp
void datalogics_interface::URIAction::set_uri(const std::string &uri)
```

**Parameters**

- `uri` (`const std::string &`): The Uniform Resource Identifier string to set.

**Returns:** `void`

Set the URI string for this action.

### to_string

```cpp
std::string datalogics_interface::Action::to_string() const
```

**Returns:** `std::string`

A string describing this Action.

The string includes the action's subtype.

### try_as

```cpp
T * datalogics_interface::Action::try_as()
```

**Parameters**

- (unnamed) (`typename T`)

**Returns:** `T *`

Attempt to downcast this action to a derived type. Returns a pointer to the derived type, or nullptr if the type doesn't match.

### try_as

```cpp
const T * datalogics_interface::Action::try_as() const
```

**Parameters**

- (unnamed) (`typename T`)

**Returns:** `const T *`

Const overload of try_as(). Returns a const pointer, or nullptr.
