This file is indexed.

/usr/include/qgis/qgsattributeeditorcontext.h is in libqgis-dev 2.18.17+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/***************************************************************************
    qgsattributeeditorcontext.h
     --------------------------------------
    Date                 : 30.7.2013
    Copyright            : (C) 2013 Matthias Kuhn
    Email                : matthias at opengis dot ch
 ***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef QGSATTRIBUTEEDITORCONTEXT_H
#define QGSATTRIBUTEEDITORCONTEXT_H

#include <QMap>
#include <QWidget>

#include <qgsdistancearea.h>
#include <qgsvectorlayer.h>
#include <qgsvectorlayertools.h>


/** \ingroup gui
 * This class contains context information for attribute editor widgets.
 * It will be passed to embedded widgets whenever this occurs (e.g. when
 * showing an embedded form due to relations)
 */

class GUI_EXPORT QgsAttributeEditorContext
{
  public:
    /**
     * Determines in which direction a relation was resolved.
     */
    enum RelationMode
    {
      Undefined,  //!< This context is not defined by a relation
      Multiple,   //!< When showing a list of features (e.g. houses as an embedded form in a district form)
      Single      //!< When showing a single feature (e.g. district information when looking at the form of a house)
    };

    enum FormMode
    {
      Embed,            //!< A form was embedded as a widget on another form
      StandaloneDialog, //!< A form was opened as a new dialog
      Popup             //!< A widget was opened as a popup (e.g. attribute table editor widget)
    };

    QgsAttributeEditorContext()
        : mParentContext( nullptr )
        , mLayer( nullptr )
        , mVectorLayerTools( nullptr )
        , mRelationMode( Undefined )
        , mFormMode( Embed )
        , mAllowCustomUi( true )
    {}

    QgsAttributeEditorContext( const QgsAttributeEditorContext& parentContext, FormMode formMode )
        : mParentContext( &parentContext )
        , mLayer( nullptr )
        , mVectorLayerTools( parentContext.mVectorLayerTools )
        , mDistanceArea( parentContext.mDistanceArea )
        , mRelationMode( Undefined )
        , mFormMode( formMode )
        , mAllowCustomUi( true )
    {
      Q_ASSERT( parentContext.vectorLayerTools() );
    }

    QgsAttributeEditorContext( const QgsAttributeEditorContext& parentContext, const QgsRelation& relation, RelationMode relationMode, FormMode widgetMode )
        : mParentContext( &parentContext )
        , mLayer( nullptr )
        , mVectorLayerTools( parentContext.mVectorLayerTools )
        , mDistanceArea( parentContext.mDistanceArea )
        , mRelation( relation )
        , mRelationMode( relationMode )
        , mFormMode( widgetMode )
        , mAllowCustomUi( true )
    {
      Q_ASSERT( parentContext.vectorLayerTools() );
    }

    inline void setDistanceArea( const QgsDistanceArea& distanceArea )
    {
      if ( mLayer )
      {
        mDistanceArea = distanceArea;
        mDistanceArea.setSourceCrs( mLayer->crs() );
      }
    }

    inline const QgsDistanceArea& distanceArea() const { return mDistanceArea; }

    inline void setVectorLayerTools( QgsVectorLayerTools* vlTools ) { mVectorLayerTools = vlTools; }
    inline const QgsVectorLayerTools* vectorLayerTools() const { return mVectorLayerTools; }

    inline void setRelation( const QgsRelation& relation, RelationMode mode ) { mRelation = relation; mRelationMode = mode; }
    inline const QgsRelation& relation() const { return mRelation; }
    inline RelationMode relationMode() const { return mRelationMode; }

    /** Returns the form mode.
     * @see setFormMode()
     */
    inline FormMode formMode() const { return mFormMode; }

    /** Sets the form mode.
     * @param mode form mode
     * @see formMode()
     * @note added in QGIS 2.16
     */
    inline void setFormMode( FormMode mode ) { mFormMode = mode; }

    /** Returns true if the attribute editor should permit use of custom UI forms.
     * @see setAllowCustomUi()
     * @note added in QGIS 2.16
     */
    bool allowCustomUi() const { return mAllowCustomUi; }

    /** Sets whether the attribute editor should permit use of custom UI forms.
     * @param allow set to true to allow custom UI forms, or false to disable them and use default generated
     * QGIS forms
     * @see allowCustomUi()
     * @note added in QGIS 2.16
     */
    void setAllowCustomUi( bool allow ) { mAllowCustomUi = allow; }

    inline const QgsAttributeEditorContext* parentContext() const { return mParentContext; }

  private:
    const QgsAttributeEditorContext* mParentContext;
    QgsVectorLayer* mLayer;
    QgsVectorLayerTools* mVectorLayerTools;
    QgsDistanceArea mDistanceArea;
    QgsRelation mRelation;
    RelationMode mRelationMode;
    FormMode mFormMode;
    bool mAllowCustomUi;
};

#endif // QGSATTRIBUTEEDITORCONTEXT_H