PhoenixLecture  2.0.0
Set of tools to make lectures
updateParent.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 
8 #include "updateParent.h"
9 
10 
12 
16 void updateParent(POutoutMode & outputMode, PLatexObj & obj, const PLatexMenu & parentMenu){
17  if(!isSection(obj)){return;}
18  obj.setParentSec(parentMenu);
19 
20  PLatexMenu menu;
21  menu.setLink(obj.getLink());
22 // menu.setText(obj.getName());
23  menu.setText(getSectionTitle(outputMode, obj));
24 
25  PVecLatexObj & vecObj = obj.getVecContent();
26  for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
27  if(isSection(*it)){
28  updateParent(outputMode, *it, menu);
29  }
30  }
31 }
32 
34 
37 void updateParent(POutoutMode & outputMode, PLatexObj & obj){
38  PLatexMenu menu;
39  menu.setLink(obj.getLink());
40  menu.setText("Main Page");
41  PVecLatexObj & vecObj = obj.getVecContent();
42  for(PVecLatexObj::iterator it(vecObj.begin()); it != vecObj.end(); ++it){
43  if(isSection(*it)){
44  updateParent(outputMode, *it, menu);
45  }
46  }
47 }
48 
49 
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
Describe a latex object.
Definition: PLatexObj.h:40
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
const PString & getLink() const
Gets the link of the PLatexObj.
Definition: PLatexObj.cpp:368
void setParentSec(const PLatexMenu &parentSec)
Sets the parentSec of the PLatexObj.
Definition: PLatexObj.cpp:228
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.
std::vector< PLatexObj > PVecLatexObj
Vector of obj.
Output mode of the html backend.
void updateParent(POutoutMode &outputMode, PLatexObj &obj, const PLatexMenu &parentMenu)
Update the parent of the sections.