~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/app/composer/qgscomposerpicturewidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
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.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef QGSCOMPOSERPICTUREWIDGET_H
 
19
#define QGSCOMPOSERPICTUREWIDGET_H
 
20
 
 
21
#include "ui_qgscomposerpicturewidgetbase.h"
 
22
 
 
23
class QgsComposerPicture;
 
24
 
 
25
/** \ingroup MapComposer
 
26
 * A widget for adding an image to a map composition.
 
27
 */
 
28
class QgsComposerPictureWidget: public QWidget, private Ui::QgsComposerPictureWidgetBase
 
29
{
 
30
    Q_OBJECT
 
31
 
 
32
  public:
 
33
    QgsComposerPictureWidget( QgsComposerPicture* picture );
 
34
    ~QgsComposerPictureWidget();
 
35
 
 
36
  public slots:
 
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 );
 
47
 
 
48
    /**Sets the GUI elements to the values of mPicture*/
 
49
    void setGuiElementValues();
 
50
 
 
51
  protected:
 
52
    void showEvent( QShowEvent * event );
 
53
 
 
54
  private:
 
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();
 
66
};
 
67
 
 
68
#endif