QGIS/src/qgsdlgvectorlayerproperties.h
g_j_m 62e2c7cf1f Provide a UI in the vector layer properties dialog box to set the
field used as the top level field in the Identify Results dialog
box. The value is read from and written to .qgs files


git-svn-id: http://svn.osgeo.org/qgis/trunk@2222 c8812cc2-4d05-0410-92ff-de0c093fc19c
2004-11-08 09:10:32 +00:00

97 lines
3.5 KiB
C++

/***************************************************************************
qgsdlgvectorlayerproperties.h
Unified property dialog for vector layers
-------------------
begin : 2004-01-28
copyright : (C) 2004 by Gary E.Sherman
email : sherman at mrcc.com
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/* $Id$ */
#ifndef QGSDLGVECTORLAYERPROPERTIES
#define QGSDLGVECTORLAYERPROPERTIES
#ifdef WIN32
#include "qgsdlgvectorlayerpropertiesbase.h"
#else
#include "qgsdlgvectorlayerpropertiesbase.uic.h"
#endif
#include "qgsrenderer.h"
#include "qpixmap.h"
#include "qlineedit.h"
class QgsVectorLayer;
class QgsLabelDialog;
class QgsAttributeActionDialog;
class QgsDlgVectorLayerProperties : public QgsDlgVectorLayerPropertiesBase{
Q_OBJECT
public:
QgsDlgVectorLayerProperties(QgsVectorLayer *lyr =0,QWidget *parent=0, const char *name=0, bool modal=true);
~QgsDlgVectorLayerProperties();
/**Sets the legend type to "single symbol", "graduated symbol" or "continuous color"*/
void setLegendType(QString type);
/**Returns the display name entered in the dialog*/
QString displayName();
/**Sets the attribute that is used in the Identify Results dialog box*/
void setDisplayField(QString name);
/**Sets the rendererDirty flag*/
void setRendererDirty(bool enabled=true);
/**Returns a pointer to the bufferDialog*/
QDialog* getBufferDialog();
/**Sets the buffer dialog*/
void setBufferDialog(QDialog* dialog);
/**Returns a pointer to the buffer pixmap*/
QPixmap* getBufferPixmap();
/**Returns a pointer to the buffer renderer*/
QgsRenderer* getBufferRenderer();
public slots:
void alterLayerDialog(const QString& string);
void apply();
void close();
/** Reset to original (vector layer) values */
void reset();
protected:
QgsVectorLayer *layer;
/**Flag indicating that the render type has changed compared to the vector layer (true)*/
bool rendererDirty;
/**Renderer dialog which is shown. If apply is pressed, it assigned to the vector layer*/
QDialog* bufferDialog;
/**Buffer renderer, which is assigned to the vector layer when apply is pressed*/
QgsRenderer* bufferRenderer;
/**Label dialog. If apply is pressed, options are applied to vector's QgsLabel */
QgsLabelDialog* labelDialog;
/**Actions dialog. If apply is pressed, the actions are stored for later use */
QgsAttributeActionDialog* actionDialog;
/**Buffer pixmap which takes the picture of renderers before they are assigned to the vector layer*/
QPixmap bufferPixmap;
void closeEvent(QCloseEvent* e);
};
inline void QgsDlgVectorLayerProperties::setBufferDialog(QDialog* dialog)
{
bufferDialog=dialog;
}
inline QPixmap* QgsDlgVectorLayerProperties::getBufferPixmap()
{
return &bufferPixmap;
}
inline QString QgsDlgVectorLayerProperties::displayName()
{
return txtDisplayName->text();
}
#endif