LCOV - code coverage report
Current view: top level - core - qgsexpressioncontextgenerator.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 2 2 100.0 %
Date: 2021-03-26 12:19:53 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /***************************************************************************
       2                 :            :   qgsexpressioncontextgenerator.h - QgsExpressionContextGenerator
       3                 :            : 
       4                 :            :  ---------------------
       5                 :            :  begin                : 1.8.2016
       6                 :            :  copyright            : (C) 2016 by Matthias Kuhn
       7                 :            :  email                : matthias@opengis.ch
       8                 :            :  ***************************************************************************
       9                 :            :  *                                                                         *
      10                 :            :  *   This program is free software; you can redistribute it and/or modify  *
      11                 :            :  *   it under the terms of the GNU General Public License as published by  *
      12                 :            :  *   the Free Software Foundation; either version 2 of the License, or     *
      13                 :            :  *   (at your option) any later version.                                   *
      14                 :            :  *                                                                         *
      15                 :            :  ***************************************************************************/
      16                 :            : #ifndef QGSEXPRESSIONCONTEXTGENERATOR_H
      17                 :            : #define QGSEXPRESSIONCONTEXTGENERATOR_H
      18                 :            : 
      19                 :            : #include "qgsexpressioncontext.h"
      20                 :            : 
      21                 :            : /**
      22                 :            :  * \ingroup core
      23                 :            :  * \brief Abstract interface for generating an expression context.
      24                 :            :  *
      25                 :            :  * You need to implement this interface in a class and register this class with
      26                 :            :  * QgsFieldExpressionWidget::registerExpressionGenerator().
      27                 :            :  *
      28                 :            :  * This is used for example in QgsPropertyOverrideButton or QgsFieldExpressionWidget
      29                 :            :  * classes which will ask for a new QgsExpressionContext every time the expression
      30                 :            :  * editor is opened. This way they are able to provide an up-to-date expression
      31                 :            :  * editor even when the environment changes.
      32                 :            :  *
      33                 :            :  * \since QGIS 3.0
      34                 :            :  */
      35                 :            : 
      36                 :         83 : class CORE_EXPORT QgsExpressionContextGenerator
      37                 :            : {
      38                 :            :   public:
      39                 :            : 
      40                 :            :     /**
      41                 :            :      * This method needs to be reimplemented in all classes which implement this interface
      42                 :            :      * and return an expression context.
      43                 :            :      *
      44                 :            :      * \since QGIS 3.0
      45                 :            :      */
      46                 :            :     virtual QgsExpressionContext createExpressionContext() const = 0;
      47                 :            : 
      48                 :         65 :     virtual ~QgsExpressionContextGenerator() = default;
      49                 :            : };
      50                 :            : 
      51                 :            : #endif // QGSEXPRESSIONCONTEXTGENERATOR_H

Generated by: LCOV version 1.14