1
/* This file is part of the KDE project
2
* Copyright (C) 2003 Robert JACOLIN <rjacolin@ifrance.com>
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Library General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Library General Public License for more details.
14
* You should have received a copy of the GNU Library General Public License
15
* along with this library; see the file COPYING.LIB. If not, write to
16
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
26
setType(Element::LATEX_COMMAND);
27
_options.setAutoDelete(true);
28
_params.setAutoDelete(true);
31
Command::Command(const char* name)
33
setType(Element::LATEX_COMMAND);
34
_options.setAutoDelete(true);
35
_params.setAutoDelete(true);
37
_name = _name.stripWhiteSpace();
40
Command::Command(const char* name, QPtrList<QPtrList<Element> >* groups)
42
setType(Element::LATEX_COMMAND);
43
_options.setAutoDelete(true);
44
_params.setAutoDelete(true);
48
_name = _name.stripWhiteSpace();
51
Command::Command(const char* name, QPtrList<QPtrList<Param> >* params,
52
QPtrList<QPtrList<Element> >* groups)
54
setType(Element::LATEX_COMMAND);
55
_options.setAutoDelete(true);
56
_params.setAutoDelete(true);
62
_name = _name.stripWhiteSpace();
65
Command::Command(const char* name, QPtrList<QPtrList<Param> >* params, QPtrList<Param>* options,
66
QPtrList<QPtrList<Element> >* groups)
68
setType(Element::LATEX_COMMAND);
69
_options.setAutoDelete(true);
70
_params.setAutoDelete(true);
79
_name = _name.stripWhiteSpace();
86
void Command::addParam(const char* )
88
/*QString test = QString(name);
89
QString key = test.left(test.find("="));
90
QString value = test.right(test.find("="));
91
addParam(key, value);*/
94
void Command::addOption(const char* )
96
/*QString test = QString(name);
97
QString key = test.left(test.find("="));
98
QString value = test.right(test.find("="));
99
addOption(key, value);*/
102
void Command::print(int tab)
104
cout << _name.latin1();
105
QPtrList<Param>* params;
106
for ( params = _params.first(); params; params = _params.next() )
110
for ( param = params->first(); param; param = params->next() )
113
if(param != params->getLast())
118
if(_options.count() > 0)
122
for ( param = _options.first(); param; param = _options.next() )
125
if(param != _options.getLast())
131
QPtrList<Element>* group;
132
for(group = _elements.first(); group; group = _elements.next() )
136
for ( elt = group->first(); elt; elt = group->next() )