File indexing completed on 2024-12-08 06:46:40

0001 /***************************************************************************
0002                                cmappropertiespanebase.h
0003                              -------------------
0004     begin                : Mon Aug 6 2001
0005     copyright            : (C) 2001 by Kmud Developer Team
0006     email                : kmud-devel@kmud.de
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef CMAPPROPERTIESPANEBASE_H
0019 #define CMAPPROPERTIESPANEBASE_H
0020 
0021 #include <qwidget.h>
0022 #include <qicon.h>
0023 #include <kmuddy_export.h>
0024 
0025 #include "cmapelement.h"
0026 
0027 /**This is the base class for properties panes used by the mapper plugins
0028   *@author Kmud Developer Team
0029   */
0030 
0031 class KMUDDY_EXPORT CMapPropertiesPaneBase : public QWidget
0032 {
0033    Q_OBJECT
0034 public: 
0035     CMapPropertiesPaneBase(QString title,QIcon *icon,elementTyp panelType,CMapElement *element,QWidget *parent=nullptr);
0036     ~CMapPropertiesPaneBase() override             {}
0037 
0038     /** Set the panel title */
0039     void setTitle(QString title)          { paneName = title; }
0040     /** Get the panel title */
0041     QString getTitle(void)                { return paneName; }
0042     /** Set the panel icon */
0043     void setIcon(QIcon *icon)           { paneIcon = icon; }
0044     /** Get the panel icon */
0045     QIcon *getIcon(void)                { return paneIcon; }
0046     /** Set the panel type */
0047     void setPanelType(elementTyp type)    { panelType = type; }
0048     /** Get the panel type */
0049     elementTyp getPanelType(void)         { return panelType; }
0050     /** Set the element the properties are being changed for */
0051     void setElement(CMapElement *element) { elm = element; }
0052 
0053 public slots:
0054     /** This is called when the ok button of the property dialog is pressed */
0055     virtual void slotOk()=0;
0056     /** This is called when the cancel button of the property dialog is pressed */
0057     virtual void slotCancel()=0;
0058 
0059 private:
0060     /** Used to store the panel name */
0061     QString paneName;
0062     /** Used to store the panel icon */
0063     QIcon *paneIcon;
0064     /** Used to store the panel type */
0065     elementTyp panelType;
0066     /** The element being altered */
0067     CMapElement *elm;
0068 };
0069 
0070 #endif