added modifier modes (color,link,copy). Not fully functional yet
3 #include "linkablemapobj.h"
11 bool Export::setOutputDir(QString dirname)
13 outdir.setPath (dirname);
14 if ( outdir.exists() )
17 // ask for confirmation
22 // try to create directory
23 //return outdir.mkdir (outdir.absPath());
29 void Export::setPath (const QString &p)
34 void Export::setMapCenter(MapCenterObj *mc)
39 void Export::exportMap()
41 QFile file (filepath);
42 if ( !file.open( IO_WriteOnly ) )
45 cout << "Export::exportMap couldn't open "<<filepath<<endl;
48 QTextStream ts( &file ); // use LANG decoding here...
50 // Main loop over all branches
52 QString actIndent("");
55 bo=mapCenter->first();
59 for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
62 // write (actIndent + getSectionString(bo) + bo->getHeading()+ "\n");
63 if (bo->getDepth()==1)
64 ts << (getSectionString(bo) + bo->getHeading()+ "\n");
66 ts << (actIndent + " - " + bo->getHeading()+ "\n");
68 // If necessary, write note
69 if (!bo->getNote().isEmpty())
71 ts << ("-------------------Begin of Note-----------------\n");
72 ts << (bo->getNote());
74 ts << ("-------------------End of Note-------------------\n");
83 QString Export::getSectionString(BranchObj *bostart)
86 BranchObj *bo=bostart;
87 int depth=bo->getDepth();
90 r=QString("%1").arg(1+bo->getNum(),0,10)+"." + r;
91 bo=(BranchObj*)(bo->getParObj());
100 void Export::exportAsHTML()
102 // FIXME just testing...
103 // Main loop over all branches
105 QString actIndent("");
108 bo=mapCenter->first();
112 for (i=0;i<bo->getDepth();i++) actIndent+= indentPerDepth;
115 write (actIndent + getSectionString(bo) + bo->getHeading()+ "\n");
117 // If necessary, write note
118 if (!bo->getNote().isEmpty())
120 write (bo->getNote());
128 void Export::write(QString s)