Skip to content

Commit

Permalink
add sip bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 13, 2016
1 parent 488b41f commit 492f1ad
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 19 deletions.
38 changes: 20 additions & 18 deletions python/gui/gui.sip
Expand Up @@ -42,8 +42,8 @@
%Include qgscodeeditorhtml.sip
%Include qgscodeeditorcss.sip
%End
%Include qgscolorbutton.sip
%Include qgscharacterselectdialog.sip
%Include qgscolorbutton.sip
%Include qgscolorbuttonv2.sip
%Include qgscolordialog.sip
%Include qgscolorschemelist.sip
Expand All @@ -65,14 +65,16 @@
%Include qgsexpressionhighlighter.sip
%Include qgsexpressionselectiondialog.sip
%Include qgsextentgroupbox.sip
%Include qgsexternalresourcewidget.sip
%Include qgsfeatureselectiondlg.sip
%Include qgsfieldcombobox.sip
%Include qgsfieldexpressionwidget.sip
%Include qgsfieldmodel.sip
%Include qgsfieldproxymodel.sip
%Include qgsfieldvalidator.sip
%Include qgsfiledropedit.sip
%Include qgsfilepickerwidget.sip
%Include qgsfilterlineedit.sip
%Include qgsfeatureselectiondlg.sip
%Include qgsformannotationitem.sip
%Include qgsgenericprojectionselector.sip
%Include qgsgeometryrubberband.sip
Expand All @@ -81,8 +83,8 @@
%Include qgshistogramwidget.sip
%Include qgshtmlannotationitem.sip
%Include qgsidentifymenu.sip
%Include qgslegendinterface.sip
%Include qgslegendfilterbutton.sip
%Include qgslegendinterface.sip
%Include qgslonglongvalidator.sip
%Include qgsludialog.sip
%Include qgsmanageconnectionsdialog.sip
Expand Down Expand Up @@ -130,8 +132,8 @@
%Include qgsrasterformatsaveoptionswidget.sip
%Include qgsrasterlayersaveasdialog.sip
%Include qgsrasterpyramidsoptionswidget.sip
%Include qgsrubberband.sip
%Include qgsrelationeditorwidget.sip
%Include qgsrubberband.sip
%Include qgsscalecombobox.sip
%Include qgsscalerangewidget.sip
%Include qgsscalevisibilitydialog.sip
Expand All @@ -149,8 +151,8 @@

%Include attributetable/qgsattributetabledelegate.sip
%Include attributetable/qgsattributetablefiltermodel.sip
%Include attributetable/qgsattributetableview.sip
%Include attributetable/qgsattributetablemodel.sip
%Include attributetable/qgsattributetableview.sip
%Include attributetable/qgsdualview.sip
%Include attributetable/qgsfeaturelistmodel.sip
%Include attributetable/qgsfeaturelistview.sip
Expand Down Expand Up @@ -190,23 +192,31 @@
%Include raster/qgssinglebandgrayrendererwidget.sip
%Include raster/qgssinglebandpseudocolorrendererwidget.sip

%Include symbology-ng/qgsrendererv2widget.sip
%Include symbology-ng/characterwidget.sip
%Include symbology-ng/qgsbrushstylecombobox.sip
%Include symbology-ng/qgscategorizedsymbolrendererv2widget.sip
%Include symbology-ng/qgscolorrampcombobox.sip
%Include symbology-ng/qgscptcitycolorrampv2dialog.sip
%Include symbology-ng/qgsdashspacedialog.sip
%Include symbology-ng/qgsdatadefinedsymboldialog.sip
%Include symbology-ng/qgsellipsesymbollayerv2widget.sip
%Include symbology-ng/qgsgraduatedhistogramwidget.sip
%Include symbology-ng/qgsgraduatedsymbolrendererv2widget.sip
%Include symbology-ng/qgsinvertedpolygonrendererwidget.sip
%Include symbology-ng/qgsheatmaprendererwidget.sip
%Include symbology-ng/qgsinvertedpolygonrendererwidget.sip
%Include symbology-ng/qgslayerpropertieswidget.sip
%Include symbology-ng/qgspenstylecombobox.sip
%Include symbology-ng/qgspointdisplacementrendererwidget.sip
%Include symbology-ng/qgsrendererv2propertiesdialog.sip
%Include symbology-ng/qgsrendererv2widget.sip
%Include symbology-ng/qgsrulebasedrendererv2widget.sip
%Include symbology-ng/qgssinglesymbolrendererv2widget.sip
%Include symbology-ng/qgssizescalewidget.sip
%Include symbology-ng/qgssmartgroupeditordialog.sip
%Include symbology-ng/qgsstylev2managerdialog.sip
%Include symbology-ng/qgsstylev2exportimportdialog.sip
%Include symbology-ng/qgsstylev2groupselectiondialog.sip
%Include symbology-ng/qgsstylev2managerdialog.sip
%Include symbology-ng/qgssvgselectorwidget.sip
%Include symbology-ng/qgssymbollayerv2widget.sip
%Include symbology-ng/qgssymbollevelsv2dialog.sip
%Include symbology-ng/qgssymbolslistwidget.sip
Expand All @@ -215,31 +225,23 @@
%Include symbology-ng/qgsvectorfieldsymbollayerwidget.sip
%Include symbology-ng/qgsvectorgradientcolorrampv2dialog.sip
%Include symbology-ng/qgsvectorrandomcolorrampv2dialog.sip
%Include symbology-ng/qgscolorrampcombobox.sip
%Include symbology-ng/characterwidget.sip
%Include symbology-ng/qgsdashspacedialog.sip
%Include symbology-ng/qgsdatadefinedsymboldialog.sip
%Include symbology-ng/qgssizescalewidget.sip
%Include symbology-ng/qgsstylev2exportimportdialog.sip
%Include symbology-ng/qgssvgselectorwidget.sip
%Include symbology-ng/qgsgraduatedhistogramwidget.sip

%Include effects/qgseffectdrawmodecombobox.sip
%Include effects/qgseffectstackpropertieswidget.sip
%Include effects/qgspainteffectpropertieswidget.sip
%Include effects/qgspainteffectwidget.sip
%Include effects/qgseffectstackpropertieswidget.sip

%Include editorwidgets/core/qgseditorconfigwidget.sip
%Include editorwidgets/core/qgseditorwidgetfactory.sip
%Include editorwidgets/core/qgseditorwidgetregistry.sip
%Include editorwidgets/core/qgseditorwidgetwrapper.sip
%Include editorwidgets/core/qgssearchwidgetwrapper.sip
%Include editorwidgets/core/qgswidgetwrapper.sip
%Include editorwidgets/qgsdatetimeedit.sip
%Include editorwidgets/qgsdoublespinbox.sip
%Include editorwidgets/qgsrelationreferencewidget.sip
%Include editorwidgets/qgsrelationreferencewidgetwrapper.sip
%Include editorwidgets/qgsrelationwidgetwrapper.sip
%Include editorwidgets/qgsspinbox.sip
%Include editorwidgets/qgsdatetimeedit.sip

%Include layertree/qgslayertreeview.sip
54 changes: 54 additions & 0 deletions python/gui/qgsexternalresourcewidget.sip
@@ -0,0 +1,54 @@

class QgsExternalResourceWidget : QWidget
{
%TypeHeaderCode
#include <qgsexternalresourcewidget.h>
%End

public:

enum DocumentViewerContent
{
NoContent,
Image,
Web
};

explicit QgsExternalResourceWidget( QWidget* parent /TransferThis/ );

~QgsExternalResourceWidget();

/**
* @brief documentPath returns the path of the current document in the widget
* @param type determines the type of the returned null variant if the document is not defined yet
*/
QVariant documentPath( QVariant::Type type = QVariant::String ) const;
void setDocumentPath( QVariant documentPath );

//! access the file picker widget to allow its configuration
QgsFilePickerWidget* filePickerwidget();

//! returns if the file picker is visible in the widget
bool filePickerVisible() const;
//! set the visiblity of the file picker in the widget
void setFilePickerVisible( bool visible );

//! returns the type of content used in the document viewer
QgsExternalResourceWidget::DocumentViewerContent documentViewerContent() const;
//! setDocumentViewerContent defines the type of content to be shown. Widget will be adapated accordingly
void setDocumentViewerContent( QgsExternalResourceWidget::DocumentViewerContent content );

//! set the configuration of the document viewer
int documentViewerHeight() const;
void setDocumentViewerHeight( int height );
int documentViewerWidth() const ;
void setDocumentViewerWidth( int width );

//! defines if the widget is readonly
void setReadOnly( bool readOnly );

signals:
void valueChanged( QString );


};
74 changes: 74 additions & 0 deletions python/gui/qgsfilepickerwidget.sip
@@ -0,0 +1,74 @@

class QgsFilePickerWidget : QWidget
{
%TypeHeaderCode
#include <qgsfilepickerwidget.h>
%End

public:

enum StorageMode
{
File,
Directory
};

enum RelativeStorage
{
Absolute,
RelativeProject,
RelativeDefaultPath
};

explicit QgsFilePickerWidget( QWidget* parent /TransferThis/ );

~QgsFilePickerWidget();

//! Returns the current file path
QString filePath();

//! Sets the file path
void setFilePath( QString path );

//! defines if the widget is readonly
void setReadOnly( bool readOnly );

//! returns the open file dialog title
QString dialogTitle() const;
/**
* @brief setDialogTitle defines the open file dialog title
* @note if not defined, the title is "Select a file" or "Select a directory" depending on the configuration.
*/
void setDialogTitle( QString title );

//! determines if the tool button is shown
bool filePickerButtonVisible() const;
//! determines if the tool button is shown
void setFilePickerButtonVisible( bool visible );

//! determines if the file path will be shown as a link
bool useLink() const;
//! determines if the file path will be shown as a link
void setUseLink( bool useLink );

//! determines if the links shows the full path or not
bool fullUrl() const;
void setFullUrl( bool fullUrl );

//! determinies the default root path
QString defaultRoot() const;
void setDefaultRoot( QString defaultRoot );

//! determines the storage mode (i.e. file or directory)
QgsFilePickerWidget::StorageMode storageMode() const;
void setStorageMode( QgsFilePickerWidget::StorageMode storageMode );

//! determines if the relative path is with respect to the project path or the default path
QgsFilePickerWidget::RelativeStorage relativeStorage() const;
void setRelativeStorage( QgsFilePickerWidget::RelativeStorage relativeStorage );

signals:
void fileChanged( QString );


};
4 changes: 4 additions & 0 deletions src/gui/qgsfilepickerwidget.cpp
Expand Up @@ -69,6 +69,10 @@ QgsFilePickerWidget::QgsFilePickerWidget( QWidget *parent )
setLayout( layout );
}

QgsFilePickerWidget::~QgsFilePickerWidget()
{
}

QString QgsFilePickerWidget::filePath()
{
return mFilePath;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsfilepickerwidget.h
Expand Up @@ -50,9 +50,10 @@ class GUI_EXPORT QgsFilePickerWidget : public QWidget
RelativeDefaultPath
};

public:
explicit QgsFilePickerWidget( QWidget *parent = 0 );

~QgsFilePickerWidget();

//! Returns the current file path
QString filePath();

Expand Down

0 comments on commit 492f1ad

Please sign in to comment.