Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unity::scopes::Annotation Class Referencefinal

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 &&)
 
Annotationoperator= (Annotation const &other)
 
Annotationoperator= (Annotation &&)
 

Detailed Description

Query link(s) that result in a new search query when clicked by the user.

Member Enumeration Documentation

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

Member Function Documentation

Annotation::Type unity::scopes::Annotation::annotation_type ( ) const

Returns the type of this annotation.

Returns
The type of the annotation.
std::string unity::scopes::Annotation::icon ( ) const

Returns icon assigned to this annotation. This currently only makes sense for Type::Link.

Returns
The icon associated with this annotation.
std::string unity::scopes::Annotation::label ( ) const

Returns label assigned to this annotation. This currently makes sense for Type::GroupedLink only.

Returns
label The label associated with this annotation.
std::list< Link::SCPtr > unity::scopes::Annotation::links ( ) const

Returns all links assigned to given position of this annotation.

Returns
The link at the given position.

The documentation for this class was generated from the following files: