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
80class ANANAS_EXPORT aOOTemplate : public iTemplate
81{
82public:
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 );
97protected:
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
virtual void insertTagsValues(QDomNode node, const QString &tagName)
Определения aootemplate.cpp:379
void searchTags(QDomNode node, const QString &sname)
Определения aootemplate.cpp:262
virtual bool getNodeTags(QDomNode node, const QString &tagname, bool params)
Определения aootemplate.cpp:301
QString templateDir
Определения aootemplate.h:116
QString copyName
Определения aootemplate.h:106
virtual bool lineFeedRemove(const QString &filename)
Определения aootemplate.cpp:657
void clearTags(QDomNode node, bool section)
Определения aootemplate.cpp:442
QDomDocument docStyle
Определения aootemplate.h:144
QDomDocument docTpl
Определения aootemplate.h:134
void insertRowValues(QDomNode node)
Определения aootemplate.cpp:347
void clearRow(QDomNode node)
Определения aootemplate.cpp:492
virtual void setValue(const QString &name, const QString &value)
Определения itemplate.cpp:115
virtual void close()
Определения itemplate.cpp:87
virtual bool open(const QString &fname)=0
Определения itemplate.cpp:73
virtual void cleanUpTags()
Определения itemplate.cpp:186
virtual void setDir(const QString &dir)
Определения itemplate.cpp:199
virtual QString getDir()
Определения itemplate.cpp:212
iTemplate()
Определения itemplate.cpp:47
virtual QString getValue(const QString &name)
Определения itemplate.cpp:100
virtual void clear()
Определения itemplate.cpp:159
virtual QString result()
Определения itemplate.cpp:172
virtual QString exec(const QString &sname)
Определения itemplate.cpp:145
virtual bool save(const QString &fname)
Сохраняет документ в файл с заданным именем. .
Определения itemplate.cpp:129