korganizer
templatemanagementdialog.h
00001 /******************************************************************************* 00002 ** 00003 ** Filename : templatemanagerdialog.h 00004 ** Created on : 05 June, 2005 00005 ** Copyright : (c) 2005 Till Adam 00006 ** Email : <adam@kde.org> 00007 ** 00008 *******************************************************************************/ 00009 00010 /******************************************************************************* 00011 ** 00012 ** This program is free software; you can redistribute it and/or modify 00013 ** it under the terms of the GNU General Public License as published by 00014 ** the Free Software Foundation; either version 2 of the License, or 00015 ** (at your option) any later version. 00016 ** 00017 ** It is distributed in the hope that it will be useful, but 00018 ** WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 ** General Public License for more details. 00021 ** 00022 ** You should have received a copy of the GNU General Public License 00023 ** along with this program; if not, write to the Free Software 00024 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00025 ** 00026 ** In addition, as a special exception, the copyright holders give 00027 ** permission to link the code of this program with any edition of 00028 ** the Qt library by Trolltech AS, Norway (or with modified versions 00029 ** of Qt that use the same license as Qt), and distribute linked 00030 ** combinations including the two. You must obey the GNU General 00031 ** Public License in all respects for all of the code used other than 00032 ** Qt. If you modify this file, you may extend this exception to 00033 ** your version of the file, but you are not obligated to do so. If 00034 ** you do not wish to do so, delete this exception statement from 00035 ** your version. 00036 ** 00037 *******************************************************************************/ 00038 #ifndef TEMPLATEMANAGEMENTDIALOG_H 00039 #define TEMPLATEMANAGEMENTDIALOG_H 00040 00041 #include <qstringlist.h> 00042 00043 #include "template_management_dialog_base.h" 00044 00045 #include <kdialogbase.h> 00046 00047 class TemplateManagementDialog: public KDialogBase { 00048 Q_OBJECT 00049 public: 00050 TemplateManagementDialog( QWidget *parent, const QStringList& templates ); 00051 00052 signals: 00053 /* Emitted whenever the user hits apply, indicating that the currently selected template 00054 should be loaded into to the incidence editor which triggered this. */ 00055 void loadTemplate( const QString& templateName ); 00056 /* Emitted whenever the user wants to add teh current incidence as a template 00057 with the given name. */ 00058 void saveTemplate( const QString& templateName ); 00059 /* Emitted when the dialog changed the list of templates. Calling code can the replace 00060 the list that was handed in with the one this signal transports. */ 00061 void templatesChanged( const QStringList& templates ); 00062 00063 protected slots: 00064 void slotAddTemplate(); 00065 void slotDeleteTemplate(); 00066 void slotApplyTemplate(); 00067 void slotUpdateDeleteButton( QListBoxItem *item ); 00068 void slotOk(); 00069 00070 private: 00071 TemplateManagementDialog_base *m_base; 00072 QStringList m_templates; 00073 QString m_newTemplate; 00074 bool m_changed; 00075 }; 00076 00077 #endif