mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-03 00:14:12 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			84 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			84 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsoptional.h                                               *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
template<T>
 | 
						|
class QgsOptional
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
A container for other classes and adds an additional enabled/disabled
 | 
						|
flag.
 | 
						|
 | 
						|
Often it is used for configuration options which can be enabled or
 | 
						|
disabled but also have more internal configuration information that
 | 
						|
should not be lost when disabling and re-enabling.
 | 
						|
 | 
						|
.. note::
 | 
						|
 | 
						|
   For Python you need to use implementations for specific template classes
 | 
						|
 | 
						|
.. note::
 | 
						|
 | 
						|
   Not available in Python bindings (although SIP file is present for specific implementations).
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsoptional.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    QgsOptional();
 | 
						|
%Docstring
 | 
						|
A QgsOptional is disabled by default if default constructed.
 | 
						|
%End
 | 
						|
 | 
						|
    QgsOptional( const T &data );
 | 
						|
%Docstring
 | 
						|
A QgsOptional is enabled by default if constructed with payload.
 | 
						|
%End
 | 
						|
 | 
						|
    QgsOptional( const T &data, bool enabled );
 | 
						|
%Docstring
 | 
						|
A QgsOptional constructed with enabled status and data
 | 
						|
%End
 | 
						|
 | 
						|
    bool operator== ( const QgsOptional<T> &other ) const;
 | 
						|
 | 
						|
 | 
						|
    bool enabled() const;
 | 
						|
%Docstring
 | 
						|
Check if this optional is enabled
 | 
						|
%End
 | 
						|
 | 
						|
    void setEnabled( bool enabled );
 | 
						|
%Docstring
 | 
						|
Set if this optional is enabled
 | 
						|
%End
 | 
						|
 | 
						|
 | 
						|
    T data() const;
 | 
						|
%Docstring
 | 
						|
Access the payload data
 | 
						|
%End
 | 
						|
 | 
						|
    void setData( const T &data );
 | 
						|
%Docstring
 | 
						|
Set the payload data
 | 
						|
%End
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/qgsoptional.h                                               *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 |