PhoenixLecture  2.0.0
Set of tools to make lectures
updateNextPrev.cpp File Reference
#include "updateNextPrev.h"
+ Include dependency graph for updateNextPrev.cpp:

Go to the source code of this file.

Functions

void updateNextPrev (POutoutMode &outputMode, PLatexObj &obj)
 Update the next and previous section for the menu. More...
 
void updateNextPrev (POutoutMode &outputMode, PLatexObj &obj, PLatexObj *&lastSec)
 Update the next and previous section for the menu. More...
 

Function Documentation

◆ updateNextPrev() [1/2]

void updateNextPrev ( POutoutMode outputMode,
PLatexObj obj 
)

Update the next and previous section for the menu.

Parameters
[out]outputMode: output mode of the html backend
[out]obj: PLatexObj to be updated

Definition at line 43 of file updateNextPrev.cpp.

43  {
44  PLatexObj* lastSec = &obj;
45  PVecLatexObj & vecObj = obj.getVecContent();
46  for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
47  updateNextPrev(outputMode, *it, lastSec);
48  }
49 }
Describe a latex object.
Definition: PLatexObj.h:40
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
std::vector< PLatexObj > PVecLatexObj
Vector of obj.
void updateNextPrev(POutoutMode &outputMode, PLatexObj &obj, PLatexObj *&lastSec)
Update the next and previous section for the menu.

References PLatexObj::getVecContent(), and updateNextPrev().

+ Here is the call graph for this function:

◆ updateNextPrev() [2/2]

void updateNextPrev ( POutoutMode outputMode,
PLatexObj obj,
PLatexObj *&  lastSec 
)

Update the next and previous section for the menu.

Parameters
[out]outputMode: output mode of the html backend
[out]obj: PLatexObj to be updated
[out]lastSec: last section

Definition at line 15 of file updateNextPrev.cpp.

15  {
16  if(!isSection(obj)){return;}
17  if(lastSec != NULL){
18  PLatexMenu & prevMenu = obj.getPrevSec(); //Prev menu before obj is given by lastSec
19  prevMenu.setLink(lastSec->getLink());
20 
21 // prevMenu.setText(lastSec->getName());
22  prevMenu.setText(getSectionTitle(outputMode, *lastSec));
23 
24  PLatexMenu & nextMenu = lastSec->getNextSec(); //Next menu after lastSec is given by obj
25  nextMenu.setLink(obj.getLink());
26 
27 // nextMenu.setText(obj.getName());
28  nextMenu.setText(getSectionTitle(outputMode, obj));
29  }
30 
31  lastSec = &obj;
32 
33  PVecLatexObj & vecObj = obj.getVecContent();
34  for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
35  updateNextPrev(outputMode, *it, lastSec);
36  }
37 }
Describe a menu entry.
Definition: PLatexObj.h:17
void setText(const PString &text)
Sets the text of the PLatexMenu.
Definition: PLatexObj.cpp:48
void setLink(const PString &link)
Sets the link of the PLatexMenu.
Definition: PLatexObj.cpp:41
const PLatexMenu & getNextSec() const
Gets the nextSec of the PLatexObj.
Definition: PLatexObj.cpp:480
const PString & getLink() const
Gets the link of the PLatexObj.
Definition: PLatexObj.cpp:368
const PLatexMenu & getPrevSec() const
Gets the prevSec of the PLatexObj.
Definition: PLatexObj.cpp:466
bool isSection(const PLatexObj &obj)
Say if the PLatexObj is a part, charpter, section, subsection or subsubsection.
PString getSectionTitle(POutoutMode &outputMode, const PLatexObj &obj)
Get the title of a part/chapter/section etc.

References PLatexObj::getLink(), PLatexObj::getNextSec(), PLatexObj::getPrevSec(), getSectionTitle(), PLatexObj::getVecContent(), isSection(), PLatexMenu::setLink(), and PLatexMenu::setText().

Referenced by processAllFile(), and updateNextPrev().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: