Ananas Library  0.9.5
aootemplate.h
1 /****************************************************************************
2 ** $Id: aootemplate.h,v 1.10 2007/12/01 08:58:35 app Exp $
3 **
4 ** Report metadata object header file of
5 ** Ananas application library
6 **
7 ** Created : 20050202
8 **
9 ** Copyright (C) 2003-2005 Grigory Panov <gr1313 at mail.ru>, Yoshkar-Ola.
10 **
11 ** This file is part of the Designer application of the Ananas
12 ** automation accounting system.
13 **
14 ** This file may be distributed and/or modified under the terms of the
15 ** GNU General Public License version 2 as published by the Free Software
16 ** Foundation and appearing in the file LICENSE.GPL included in the
17 ** packaging of this file.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23 ** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24 **
25 ** Contact org@leaderit.ru if any conditions of this licensing are
26 ** not clear to you.
27 **
28 **********************************************************************/
29 #ifndef AOOTEMPLATE_H
30 #define AOOTEMPLATE_H
31 
32 #include <qstring.h>
33 #include <qptrlist.h>
34 #include <qvaluestack.h>
35 #include <qdom.h>
36 
37 #define open_token "<:"
38 #define close_token ":>"
39 #define open_token_section "\\[:"
40 #define close_token_section ":\\]"
41 #define PARAM "param"
42 
43 #include "ananasglobal.h"
44 #include "itemplate.h"
45 
80 class ANANAS_EXPORT aOOTemplate : public iTemplate
81 {
82 public:
83  aOOTemplate();
84  virtual ~aOOTemplate();
85  virtual bool open( const QString &fname );
86  virtual void close();
87  virtual void clear();
88  virtual QString getValue( const QString &name );
89  virtual void setValue( const QString &name, const QString &value );
90  virtual QString exec( const QString &sname );
91  virtual QString result();
92  virtual bool save( const QString & fname );
93  virtual void setDir( const QString &dirName );
94  virtual QString getDir();
95  virtual void cleanUpTags();
96  virtual bool lineFeedRemove( const QString &filename );
97 protected:
106  QString copyName;
107  protected:
116  QString templateDir;
117 
118  QMap<QString,QString> values;
119 
120  void searchTags(QDomNode node, const QString &sname );
121  virtual bool getNodeTags(QDomNode node, const QString &tagname, bool params );
122  void insertRowValues(QDomNode node);
123  virtual void insertTagsValues(QDomNode node, const QString &tagName);
124  void clearTags(QDomNode node, bool section );
125  void clearRow(QDomNode node);
134  QDomDocument docTpl;
135 
144  QDomDocument docStyle;
145 };
146 #endif // AOOTEMPLATE_H
QString copyName
Definition: aootemplate.h:106
virtual QString result()
Definition: itemplate.cpp:172
virtual bool open(const QString &fname)=0
Definition: itemplate.cpp:73
virtual void clear()
Definition: itemplate.cpp:159
Definition: itemplate.h:58
virtual QString getValue(const QString &name)
Definition: itemplate.cpp:100
virtual QString exec(const QString &sname)
Definition: itemplate.cpp:145
QDomDocument docStyle
Definition: aootemplate.h:144
virtual bool save(const QString &fname)
Definition: itemplate.cpp:129
QDomDocument docTpl
Definition: aootemplate.h:134
QString templateDir
Definition: aootemplate.h:116
virtual void setDir(const QString &dir)
Definition: itemplate.cpp:199
virtual void cleanUpTags()
Definition: itemplate.cpp:186
virtual void setValue(const QString &name, const QString &value)
Definition: itemplate.cpp:115
Definition: aootemplate.h:80
virtual QString getDir()
Definition: itemplate.cpp:212
virtual void close()
Definition: itemplate.cpp:87