1
/***************************************************************************
2
qgscomposerpicturewidget.h
3
--------------------------
4
begin : August 13, 2008
5
copyright : (C) 2008 by Marco Hugentobler
6
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
18
#ifndef QGSCOMPOSERPICTUREWIDGET_H
19
#define QGSCOMPOSERPICTUREWIDGET_H
21
#include "ui_qgscomposerpicturewidgetbase.h"
23
class QgsComposerPicture;
25
/** \ingroup MapComposer
26
* A widget for adding an image to a map composition.
28
class QgsComposerPictureWidget: public QWidget, private Ui::QgsComposerPictureWidgetBase
33
QgsComposerPictureWidget( QgsComposerPicture* picture );
34
~QgsComposerPictureWidget();
37
void on_mPictureBrowseButton_clicked();
38
void on_mPictureLineEdit_editingFinished();
39
void on_mRotationSpinBox_valueChanged( double d );
40
void on_mWidthLineEdit_editingFinished();
41
void on_mHeightLineEdit_editingFinished();
42
void on_mPreviewListWidget_currentItemChanged( QListWidgetItem* current, QListWidgetItem* previous );
43
void on_mAddDirectoryButton_clicked();
44
void on_mRemoveDirectoryButton_clicked();
45
void on_mRotationFromComposerMapCheckBox_stateChanged( int state );
46
void on_mComposerMapComboBox_activated( const QString & text );
48
/**Sets the GUI elements to the values of mPicture*/
49
void setGuiElementValues();
52
void showEvent( QShowEvent * event );
55
QgsComposerPicture* mPicture;
56
/**Add the icons of a directory to the preview. Returns 0 in case of success*/
57
int addDirectoryToPreview( const QString& path );
58
/**Add the icons of the standard directories to the preview*/
59
void addStandardDirectoriesToPreview();
60
/**Tests if a file is valid svg*/
61
bool testSvgFile( const QString& filename ) const;
62
/**Tests if a file is a valid pixel format*/
63
bool testImageFile( const QString& filename ) const;
64
/**Updates the map combo box with the current composer map ids*/
65
void refreshMapComboBox();