LCOV - code coverage report
Current view: top level - templates/scriptabletags - scriptabletags.h (source / functions) Hit Total Coverage
Test: test_all.info Lines: 1 1 100.0 %
Date: 2011-06-24 Functions: 2 2 100.0 %
Branches: 6 12 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :   This file is part of the Grantlee template system.
       3                 :            : 
       4                 :            :   Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
       5                 :            : 
       6                 :            :   This library is free software; you can redistribute it and/or
       7                 :            :   modify it under the terms of the GNU Lesser General Public
       8                 :            :   License as published by the Free Software Foundation; either version
       9                 :            :   2.1 of the Licence, or (at your option) any later version.
      10                 :            : 
      11                 :            :   This library is distributed in the hope that it will be useful,
      12                 :            :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      14                 :            :   Lesser General Public License for more details.
      15                 :            : 
      16                 :            :   You should have received a copy of the GNU Lesser General Public
      17                 :            :   License along with this library.  If not, see <http://www.gnu.org/licenses/>.
      18                 :            : 
      19                 :            : */
      20                 :            : 
      21                 :            : #ifndef SCRIPTABLETAGS_H
      22                 :            : #define SCRIPTABLETAGS_H
      23                 :            : 
      24                 :            : #include "node.h"
      25                 :            : #include "taglibraryinterface.h"
      26                 :            : 
      27                 :            : // #include <QtScript/QScriptEngine>
      28                 :            : 
      29                 :            : // #include <QtScript/QSharedPointer>
      30                 :            : // typedef QSharedPointer<QScriptEngine> ScriptEnginePointer;
      31                 :            : 
      32                 :            : class QScriptEngine;
      33                 :            : 
      34                 :            : namespace Grantlee
      35                 :            : {
      36                 :            : class Engine;
      37                 :            : class Parser;
      38                 :            : 
      39                 :            : class ScriptableTagLibrary : public QObject, public TagLibraryInterface
      40 [ +  - ][ +  - ]:          4 : {
         [ +  - ][ +  - ]
         [ +  - ][ -  + ]
      41                 :            :   Q_OBJECT
      42                 :            :   Q_INTERFACES( Grantlee::TagLibraryInterface )
      43                 :            : public:
      44                 :            :   ScriptableTagLibrary( QObject *parent = 0 );
      45                 :            : 
      46                 :            :   virtual QHash<QString, AbstractNodeFactory*> nodeFactories( const QString &name = QString() );
      47                 :            : 
      48                 :            :   virtual QHash<QString, Filter*> filters( const QString &name = QString() );
      49                 :            : 
      50                 :            : public Q_SLOTS:
      51                 :            :   void addFactory( const QString &factoryName, const QString &tagname );
      52                 :            :   void addFilter( const QString &filterName );
      53                 :            : 
      54                 :            : protected:
      55                 :            :   bool evaluateScript( const QString &name );
      56                 :            :   QHash<QString, AbstractNodeFactory*> getFactories();
      57                 :            :   QHash<QString, Filter*> getFilters();
      58                 :            : 
      59                 :            : private:
      60                 :            : //   ScriptEnginePointer m_scriptEngine;
      61                 :            :   QScriptEngine *m_scriptEngine;
      62                 :            :   QHash<QString, AbstractNodeFactory*> m_nodeFactories;
      63                 :            :   QHash<QString, QString> m_factoryNames;
      64                 :            :   QStringList m_filterNames;
      65                 :            :   QHash<QString, Filter*> m_filters;
      66                 :            : 
      67                 :            : };
      68                 :            : 
      69                 :            : }
      70                 :            : 
      71                 :            : #endif
      72                 :            : 

Generated by: LCOV version 1.9