Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TooltipManager Class Reference

#include <tooltip.h>

Classes

class  Private
 

Public Member Functions

void clearTooltips ()
 
void addTooltip (Definition *d)
 
void writeTooltips (CodeOutputInterface &ol)
 

Static Public Member Functions

static TooltipManagerinstance ()
 

Private Member Functions

 TooltipManager ()
 
 ~TooltipManager ()
 

Private Attributes

Privatep
 

Static Private Attributes

static TooltipManagers_theInstance = 0
 

Detailed Description

Definition at line 21 of file tooltip.h.

Constructor & Destructor Documentation

TooltipManager::TooltipManager ( )
private

Definition at line 35 of file tooltip.cpp.

36 {
37  p = new Private;
38 }
Definition: types.h:26
Private * p
Definition: tooltip.h:30
TooltipManager::~TooltipManager ( )
private

Definition at line 40 of file tooltip.cpp.

41 {
42  delete p;
43 }
Private * p
Definition: tooltip.h:30

Member Function Documentation

void TooltipManager::addTooltip ( Definition d)

Definition at line 71 of file tooltip.cpp.

72 {
73  static bool sourceTooltips = Config_getBool("SOURCE_TOOLTIPS");
74  if (!sourceTooltips) return;
75  QCString id = d->getOutputFileBase();
76  int i=id.findRev('/');
77  if (i!=-1)
78  {
79  id = id.right(id.length()-i-1); // strip path (for CREATE_SUBDIRS=YES)
80  }
82  QCString anc = d->anchor();
83  if (!anc.isEmpty())
84  {
85  id+="_"+anc;
86  }
87  if (p->tooltipInfo.find(id)==0)
88  {
89  p->tooltipInfo.insert(id,d);
90  }
91 }
bool isEmpty() const
Definition: qcstring.h:189
static QCString htmlFileExtension
Definition: doxygen.h:130
Private * p
Definition: tooltip.h:30
virtual QCString getOutputFileBase() const =0
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
static QCString escapeId(const char *s)
Definition: tooltip.cpp:59
#define Config_getBool(val)
Definition: config.cpp:664
QDict< Definition > tooltipInfo
Definition: tooltip.cpp:30
virtual QCString anchor() const =0
void TooltipManager::clearTooltips ( )

Definition at line 54 of file tooltip.cpp.

55 {
56  p->tooltipInfo.clear();
57 }
Private * p
Definition: tooltip.h:30
QDict< Definition > tooltipInfo
Definition: tooltip.cpp:30
TooltipManager * TooltipManager::instance ( )
static

Definition at line 45 of file tooltip.cpp.

46 {
47  if (!s_theInstance)
48  {
50  }
51  return s_theInstance;
52 }
static TooltipManager * s_theInstance
Definition: tooltip.h:34
void TooltipManager::writeTooltips ( CodeOutputInterface ol)

Definition at line 93 of file tooltip.cpp.

94 {
95  QDictIterator<Definition> di(p->tooltipInfo);
96  Definition *d;
97  for (di.toFirst();(d=di.current());++di)
98  {
99  DocLinkInfo docInfo;
100  docInfo.name = d->qualifiedName();
101  docInfo.ref = d->getReference();
102  docInfo.url = d->getOutputFileBase();
103  docInfo.anchor = d->anchor();
104  SourceLinkInfo defInfo;
105  if (d->getBodyDef() && d->getStartBodyLine()!=-1)
106  {
107  defInfo.file = d->getBodyDef()->name();
108  defInfo.line = d->getStartBodyLine();
109  defInfo.url = d->getSourceFileBase();
110  defInfo.anchor = d->getSourceAnchor();
111  }
112  SourceLinkInfo declInfo; // TODO: fill in...
113  QCString decl;
115  {
116  MemberDef *md = (MemberDef*)d;
117  decl = md->declaration();
118  if (!decl.isEmpty() && decl.at(0)=='@') // hide enum values
119  {
120  decl.resize(0);
121  }
122  }
123  ol.writeTooltip(di.currentKey(), // id
124  docInfo, // symName
125  decl, // decl
126  d->briefDescriptionAsTooltip(), // desc
127  defInfo,
128  declInfo
129  );
130  }
131 }
bool resize(uint newlen)
Definition: qcstring.h:225
QCString ref
Definition: outputgen.h:43
QCString file
Definition: outputgen.h:50
virtual QCString getReference() const
bool isEmpty() const
Definition: qcstring.h:189
QCString url
Definition: outputgen.h:53
char & at(uint i) const
Definition: qcstring.h:326
FileDef * getBodyDef() const
QCString anchor
Definition: outputgen.h:54
Private * p
Definition: tooltip.h:30
virtual QCString getOutputFileBase() const =0
virtual DefType definitionType() const =0
virtual void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl, const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo)=0
QCString name() const
Definition: filedef.cpp:1193
virtual QCString getSourceFileBase() const
Definition: definition.cpp:885
virtual QCString getSourceAnchor() const
Definition: definition.cpp:898
QCString name
Definition: outputgen.h:42
virtual QCString qualifiedName() const
const char * declaration() const
Definition: memberdef.cpp:4020
QCString anchor
Definition: outputgen.h:45
int getStartBodyLine() const
QCString url
Definition: outputgen.h:44
QDict< Definition > tooltipInfo
Definition: tooltip.cpp:30
QCString briefDescriptionAsTooltip() const
virtual QCString anchor() const =0

Member Data Documentation

Private* TooltipManager::p
private

Definition at line 30 of file tooltip.h.

TooltipManager * TooltipManager::s_theInstance = 0
staticprivate

Definition at line 34 of file tooltip.h.


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