kandy

commandset.h
00001 /*
00002     This file is part of Kandy.
00003 
00004     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 #ifndef COMMANDSET_H
00025 #define COMMANDSET_H
00026 
00027 #include <tqlistview.h>
00028 
00029 class ATCommand;
00030 class ATParameter;
00031 class TQDomElement;
00032 class TQDomDocument;
00033 
00037 class CommandSet {
00038   public:
00039     CommandSet();
00040     ~CommandSet();
00041     
00042     void addCommand(ATCommand *);
00043     void deleteCommand(ATCommand *);
00044     
00045     bool loadFile(const TQString &);
00046     bool saveFile(const TQString &);
00047     
00048     void clear();
00049     
00050     TQPtrList<ATCommand> *commandList() { return &mList; }
00051     
00052   protected:
00053     void loadCommand(ATCommand *,TQDomElement *c);
00054     void saveCommand(ATCommand *,TQDomDocument *doc,TQDomElement *parent);
00055     void saveParameter(ATParameter *p, TQDomDocument *doc,TQDomElement *parent);
00056   
00057   private:
00058     TQPtrList<ATCommand> mList;
00059 };
00060 
00061 #endif