LCOV - code coverage report
Current view: top level - templates/scriptabletags - scriptablesafestring.h (source / functions) Hit Total Coverage
Test: test_all.info Lines: 2 2 100.0 %
Date: 2011-06-24 Functions: 3 3 100.0 %
Branches: 2 4 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 SCRIPTABLE_SAFESTRING
      22                 :            : #define SCRIPTABLE_SAFESTRING
      23                 :            : 
      24                 :            : #include <QtCore/QObject>
      25                 :            : #include <QtScript/QScriptValue>
      26                 :            : 
      27                 :            : #include "safestring.h"
      28                 :            : 
      29                 :            : class QScriptContext;
      30                 :            : 
      31                 :            : using namespace Grantlee;
      32                 :            : 
      33                 :            : QScriptValue markSafeFunction( QScriptContext *context,
      34                 :            :                                QScriptEngine *engine );
      35                 :            : 
      36                 :            : class ScriptableSafeString : public QObject
      37 [ +  - ][ -  + ]:         18 : {
      38                 :          4 :   Q_OBJECT
      39                 :            : public:
      40                 :            :   ScriptableSafeString( QObject* parent = 0 );
      41                 :            : 
      42                 :            :   void setContent( const SafeString &content );
      43                 :            :   SafeString wrappedString() const;
      44                 :            : 
      45                 :            : public Q_SLOTS:
      46                 :            :   bool isSafe() const;
      47                 :            :   void setSafety( bool safeness );
      48                 :            :   QString rawString();
      49                 :            : 
      50                 :            : private:
      51                 :            :   SafeString m_safeString;
      52                 :            : };
      53                 :            : 
      54                 :            : 
      55                 :            : #endif
      56                 :            : 

Generated by: LCOV version 1.9