Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MtpFilter.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2002 by Yann Hodique                                    *
00003  *   Yann.Hodique@lifl.fr                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef _MTPFILTER_H_
00012 #define _MTPFILTER_H_
00013 
00014 #include <vector>
00015 #include <qstring.h>
00016 #include "GlobalFilter.h"
00017 #include "BlockFilter.h"
00018 #include "LineFilter.h"
00019 #include "ItemFilter.h"
00020 #include "InputFilter.h"
00021 
00027 class QDomDocument;
00028 class MtpContext;
00029 
00030 class MtpFilter {
00031 
00032     typedef enum {
00033         Global = 0,
00034         Block,
00035         Line,
00036         Item
00037     } FilterType;
00038 
00039 public:
00040     MtpFilter(QDomDocument*, MtpContext*);
00041     ~MtpFilter();
00042 
00043     QString filterIn(const QString &);
00044     QString filterOut(const QString &);
00045     void addGlobalFilter(GlobalFilter*);
00046     void addBlockFilter(BlockFilter*);
00047     void addLineFilter(LineFilter*);
00048     void addItemFilter(ItemFilter*);
00049     void addInputFilter(InputFilter*);
00050     
00051     InputFilter * getInputFilter(const QString& name);
00052 
00053     void setObsolete() {obsolete = true;}
00054     
00055 private:
00056     std::vector<GlobalFilter*> global;
00057     std::vector<BlockFilter*> block;
00058     std::vector<LineFilter*> line;
00059     std::vector<ItemFilter*> item;
00060     std::vector<InputFilter*> input, queue;
00061 
00062     BlockFilter *current_block;
00063     
00064     QDomDocument* m_dom;
00065     MtpContext* m_context;
00066     bool obsolete;
00067 };
00068 
00069 #endif

Generated on Sat May 10 15:09:27 2003 for qnet by doxygen1.3