NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ITooltipFormatter Class Referenceabstract

Search Toolkit Book for ITooltipFormatter

primitive interface to arrange tabular data in the tooltips More...

#include <gui/objutils/tooltip.hpp>

+ Inheritance diagram for ITooltipFormatter:

Public Types

enum  ETooltipFormatters { eTooltipFormatter_CSSTable , eTooltipFormatter_Html , eTooltipFormatter_Text }
 supported types of formatters More...
 

Public Member Functions

virtual CIRef< ITooltipFormatterCreateInstance ()=0
 creates another instance of the same tooltip formatter More...
 
virtual void StartRow ()=0
 start a new table row More...
 
virtual void AddBulletCol (const string &sBulletSrc="")=0
 add a cell with an image More...
 
virtual void AddTagCol (const string &sContents="", const string &sBulletSrc="")=0
 adds a tag column to the row More...
 
virtual void AddValueCol (const string &sContents="", unsigned width=200, bool isNoWrap=false)=0
 adds a value column to the row More...
 
virtual void FinishRow ()=0
 finish the row (i.e. no other contents will be added to it) More...
 
virtual void AddDividerRow (unsigned colspan=2)=0
 add a horizontal divider between sections of the table More...
 
virtual void AddRow (const string &sContents="", unsigned colspan=2)=0
 add a row with a cell, spanning across all columns More...
 
virtual void AddRow (const string &sTag, const string &sValue, unsigned valueColWidth=200, bool noSpaceInsert=false)=0
 add a row with two columns More...
 
virtual void AddLinkRow (const string &sTag, const string &sValue, unsigned valueColWidth=200)=0
 add a row with two columns More...
 
virtual void AddLinkRow (const string &sTag, const string &sText, const string &sUrl, unsigned valueColWidth=200)=0
 add a row with two columns, the second containing a link More...
 
virtual void AddLinksTitle (const string &sTitle)=0
 add a row with the links title More...
 
virtual void AddSectionRow (const string &sContents)=0
 add a section row More...
 
virtual string Render ()=0
 returns the formatted tooltip text and resets the formatter for reuse More...
 
virtual bool IsEmpty () const =0
 Indicates if the tooltip is empty. More...
 
virtual string CreateLink (const string &sLabel, const string &sUrl) const =0
 construct the HTML code for a link from the displayed text label and supplied URL More...
 
virtual string CreateNcbiLink (const string &sText, const string &sUrl) const =0
 construct the HTML code for a link from the displayed text label and supplied NCBI URL path More...
 
virtual string CreateGenomicLink (const string &sText, const string &sUrl) const
 
virtual void AddPubmedLinksRow (const string &pmids, bool &isGoToPresent, bool isBulletColPresent)=0
 add a row containing all links to specified Pubmed IDs More...
 
virtual void MaybeAddGoToRow (bool &isGoToPresent, bool isBulletColPresent)=0
 conditionally add a Go To row More...
 
virtual void Append (const ITooltipFormatter &tooltip)=0
 appends another formatter to this one More...
 
virtual void SetTrustedData (bool trusted_data)
 indicates whether the data is coming from a trusted source More...
 
virtual bool IsTrustedData ()
 indicates whether the data is coming from a trusted source More...
 
virtual ~ITooltipFormatter ()
 

Static Public Member Functions

static CIRef< ITooltipFormatterCreateTooltipFormatter (ETooltipFormatters)
 factory for requested tooltip formatter creation More...
 

Protected Attributes

bool m_TrustedData = true
 

Detailed Description

primitive interface to arrange tabular data in the tooltips

does absolutely no checking that columns and rows are added and finished in a regular manner, so must be used with care, otherwise skewed tables may result generally, the table is supposed to have two or three columns: [bullet | ] tag | value rows can be grouped and divided with a horizontal line

Definition at line 54 of file tooltip.hpp.


The documentation for this class was generated from the following files:
Modified on Thu Feb 29 12:18:29 2024 by modify_doxy.py rev. 669887