Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PageContext::Private Class Reference
Inheritance diagram for PageContext::Private:
DefinitionContext< PageContext::Private >

Classes

struct  Cachable
 

Public Member Functions

 Private (PageDef *pd, bool isMainPage, bool isExample)
 
virtual ~Private ()
 
TemplateVariant get (const char *n) const
 
TemplateVariant title () const
 
TemplateVariant relPath () const
 
TemplateVariant highlight () const
 
TemplateVariant subHighlight () const
 
TemplateVariant example () const
 
- Public Member Functions inherited from DefinitionContext< PageContext::Private >
 DefinitionContext (Definition *d)
 
void addBaseProperties (PropertyMapper< PageContext::Private > &inst)
 
TemplateVariant fileName () const
 
TemplateVariant anchor () const
 
TemplateVariant sourceFileName () const
 
TemplateVariant isLinkable () const
 
TemplateVariant isLinkableInProject () const
 
TemplateVariant name () const
 
TemplateVariant bareName () const
 
QCString relPathAsString () const
 
TemplateVariant details () const
 
TemplateVariant brief () const
 
TemplateVariant inbodyDocs () const
 
TemplateVariant dynSectionId () const
 
TemplateVariant language () const
 
TemplateVariant compoundKind () const
 
TemplateVariant sourceDef () const
 
void fillPath (Definition *def, TemplateList *list) const
 
TemplateVariant navigationPath () const
 
TemplateVariant isReference () const
 
TemplateVariant externalReference () const
 

Private Member Functions

CachablegetCache () const
 

Private Attributes

PageDefm_pageDef
 
bool m_isMainPage
 
bool m_isExample
 

Static Private Attributes

static PropertyMapper< PageContext::Privates_inst
 

Detailed Description

Definition at line 3567 of file context.cpp.

Constructor & Destructor Documentation

PageContext::Private::Private ( PageDef pd,
bool  isMainPage,
bool  isExample 
)
inline

Definition at line 3570 of file context.cpp.

3572  m_isExample(isExample)
3573  {
3574  static bool init=FALSE;
3575  if (!init)
3576  {
3578  s_inst.addProperty("title", &Private::title);
3579  s_inst.addProperty("highlight", &Private::highlight);
3580  s_inst.addProperty("subhighlight",&Private::subHighlight);
3581  s_inst.addProperty("example", &Private::example);
3582  init=TRUE;
3583  }
3584  if (!pd->cookie()) { pd->setCookie(new PageContext::Private::Cachable(pd)); }
3585  }
TemplateVariant example() const
Definition: context.cpp:3639
Cookie * cookie() const
Definition: definition.h:352
const bool FALSE
Definition: qglobal.h:370
init
Definition: train.py:42
void setCookie(Cookie *cookie)
Definition: definition.h:351
void addBaseProperties(PropertyMapper< PageContext::Private > &inst)
Definition: context.cpp:1364
TemplateVariant title() const
Definition: context.cpp:3591
TemplateVariant highlight() const
Definition: context.cpp:3624
static PropertyMapper< PageContext::Private > s_inst
Definition: context.cpp:3675
const bool TRUE
Definition: qglobal.h:371
TemplateVariant subHighlight() const
Definition: context.cpp:3635
virtual PageContext::Private::~Private ( )
inlinevirtual

Definition at line 3586 of file context.cpp.

3586 {}

Member Function Documentation

TemplateVariant PageContext::Private::example ( ) const
inline

Definition at line 3639 of file context.cpp.

3640  {
3641  if (m_isExample)
3642  {
3643  Cachable &cache = getCache();
3644  if (!cache.example || g_globals.outputFormat!=cache.exampleOutputFormat)
3645  {
3646  cache.example.reset(new TemplateVariant(
3648  relPathAsString(),"\\include "+m_pageDef->name(),FALSE)));
3649  cache.exampleOutputFormat = g_globals.outputFormat;
3650  }
3651  return *cache.example;
3652  }
3653  else
3654  {
3655  return TemplateVariant("");
3656  }
3657  }
QCString docFile() const
Cachable & getCache() const
Definition: context.cpp:3667
const bool FALSE
Definition: qglobal.h:370
static TemplateVariant parseDoc(Definition *def, const QCString &file, int line, const QCString &relPath, const QCString &docStr, bool isBrief)
Definition: context.cpp:1227
const QCString & name() const
Definition: definition.h:114
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
ContextOutputFormat outputFormat
Definition: context.cpp:71
struct ContextGlobals g_globals
int docLine() const
TemplateVariant PageContext::Private::get ( const char *  n) const
inline

Definition at line 3587 of file context.cpp.

3588  {
3589  return s_inst.get(this,n);
3590  }
std::void_t< T > n
static PropertyMapper< PageContext::Private > s_inst
Definition: context.cpp:3675
Cachable& PageContext::Private::getCache ( ) const
inlineprivate

Definition at line 3667 of file context.cpp.

3668  {
3669  Cachable *c = static_cast<Cachable*>(m_pageDef->cookie());
3670  assert(c!=0);
3671  return *c;
3672  }
Cookie * cookie() const
Definition: definition.h:352
TemplateVariant PageContext::Private::highlight ( ) const
inline

Definition at line 3624 of file context.cpp.

3625  {
3626  if (m_isMainPage)
3627  {
3628  return "main";
3629  }
3630  else
3631  {
3632  return "pages";
3633  }
3634  }
TemplateVariant PageContext::Private::relPath ( ) const
inlinevirtual

Reimplemented from DefinitionContext< PageContext::Private >.

Definition at line 3613 of file context.cpp.

3614  {
3615  if (m_isMainPage)
3616  {
3617  return "";
3618  }
3619  else
3620  {
3622  }
3623  }
virtual TemplateVariant relPath() const
Definition: context.cpp:1436
TemplateVariant PageContext::Private::subHighlight ( ) const
inline

Definition at line 3635 of file context.cpp.

3636  {
3637  return "";
3638  }
TemplateVariant PageContext::Private::title ( ) const
inline

Definition at line 3591 of file context.cpp.

3592  {
3593  if (m_isMainPage)
3594  {
3595  if (mainPageHasTitle())
3596  {
3597  return m_pageDef->title();
3598  }
3599  else
3600  {
3601  return theTranslator->trMainPage();
3602  }
3603  }
3604  else if (m_isExample)
3605  {
3606  return m_pageDef->name();
3607  }
3608  else
3609  {
3610  return m_pageDef->title();
3611  }
3612  }
QCString title() const
Definition: pagedef.h:54
bool mainPageHasTitle()
Definition: util.cpp:8554
virtual QCString trMainPage()=0
const QCString & name() const
Definition: definition.h:114
Translator * theTranslator
Definition: language.cpp:157

Member Data Documentation

bool PageContext::Private::m_isExample
private

Definition at line 3674 of file context.cpp.

bool PageContext::Private::m_isMainPage
private

Definition at line 3673 of file context.cpp.

PageDef* PageContext::Private::m_pageDef
private

Definition at line 3659 of file context.cpp.

PropertyMapper< PageContext::Private > PageContext::Private::s_inst
staticprivate

Definition at line 3675 of file context.cpp.


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