Unity Scopes API
|
Query link(s) that result in a new search query when clicked by the user. More...
#include <unity/scopes/Annotation.h>
Public Types | |
enum | Type { Link, GroupedLink } |
Enumeration of supported Annotation types. More... | |
Public Member Functions | |
Annotation (Type atype) | |
Creates annotation of given type. The Type imposes attributes that are supported or required by that annotation. | |
void | set_label (std::string const &label) |
Sets a label for an annotation. This currently makes sense for Type::GroupedLink only. | |
void | set_icon (std::string const &icon) |
Sets an icon for an annotation. This currently makes sense for Type::Link. | |
void | add_link (std::string const &label, CannedQuery const &query) |
Adds a link to the annotation. There needs to be exactly one link added for the annotations of type Type::Link and at least one for Type::GroupedLink. This method throws InvalidArgumentException if these constraints are violated. | |
std::string | label () const |
Returns label assigned to this annotation. This currently makes sense for Type::GroupedLink only. More... | |
std::string | icon () const |
Returns icon assigned to this annotation. This currently only makes sense for Type::Link. More... | |
std::list< Link::SCPtr > | links () const |
Returns all links assigned to given position of this annotation. More... | |
Type | annotation_type () const |
Returns the type of this annotation. More... | |
Copy and assignment | |
Copy and assignment operators (move and non-move versions) have the usual value semantics. | |
Annotation (Annotation const &other) | |
Annotation (Annotation &&) | |
Annotation & | operator= (Annotation const &other) |
Annotation & | operator= (Annotation &&) |
Query link(s) that result in a new search query when clicked by the user.
Enumeration of supported Annotation types.
Enumerator | |
---|---|
Link |
A simple link with just a label and/or an icon |
GroupedLink |
A group of links, with a label for the group name and labels for all links inside it |
Annotation::Type unity::scopes::Annotation::annotation_type | ( | ) | const |
Returns the type of this annotation.
std::string unity::scopes::Annotation::icon | ( | ) | const |
Returns icon assigned to this annotation. This currently only makes sense for Type::Link.
std::string unity::scopes::Annotation::label | ( | ) | const |
Returns label assigned to this annotation. This currently makes sense for Type::GroupedLink only.
std::list< Link::SCPtr > unity::scopes::Annotation::links | ( | ) | const |
Returns all links assigned to given position of this annotation.