korganizer

templatemanagementdialog.h
1 /*******************************************************************************
2 **
3 ** Filename : templatemanagerdialog.h
4 ** Created on : 05 June, 2005
5 ** Copyright : (c) 2005 Till Adam
6 ** Email : <adam@kde.org>
7 **
8 *******************************************************************************/
9 
10 /*******************************************************************************
11 **
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License as published by
14 ** the Free Software Foundation; either version 2 of the License, or
15 ** (at your option) any later version.
16 **
17 ** It is distributed in the hope that it will be useful, but
18 ** WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ** General Public License for more details.
21 **
22 ** You should have received a copy of the GNU General Public License
23 ** along with this program; if not, write to the Free Software
24 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 **
26 ** In addition, as a special exception, the copyright holders give
27 ** permission to link the code of this program with any edition of
28 ** the TQt library by Trolltech AS, Norway (or with modified versions
29 ** of TQt that use the same license as TQt), and distribute linked
30 ** combinations including the two. You must obey the GNU General
31 ** Public License in all respects for all of the code used other than
32 ** TQt. If you modify this file, you may extend this exception to
33 ** your version of the file, but you are not obligated to do so. If
34 ** you do not wish to do so, delete this exception statement from
35 ** your version.
36 **
37 *******************************************************************************/
38 #ifndef TEMPLATEMANAGEMENTDIALOG_H
39 #define TEMPLATEMANAGEMENTDIALOG_H
40 
41 #include <tqstringlist.h>
42 
43 #include "template_management_dialog_base.h"
44 
45 #include <kdialogbase.h>
46 
47 class TemplateManagementDialog: public KDialogBase {
48 TQ_OBJECT
49 
50  public:
51  TemplateManagementDialog( TQWidget *parent, const TQStringList& templates );
52 
53  signals:
54  /* Emitted whenever the user hits apply, indicating that the currently selected template
55  should be loaded into to the incidence editor which triggered this. */
56  void loadTemplate( const TQString& templateName );
57  /* Emitted whenever the user wants to add teh current incidence as a template
58  with the given name. */
59  void saveTemplate( const TQString& templateName );
60  /* Emitted when the dialog changed the list of templates. Calling code can the replace
61  the list that was handed in with the one this signal transports. */
62  void templatesChanged( const TQStringList& templates );
63 
64  protected slots:
65  void slotAddTemplate();
66  void slotDeleteTemplate();
67  void slotApplyTemplate();
68  void slotUpdateDeleteButton( TQListBoxItem *item );
69  void slotOk();
70 
71  private:
72  TemplateManagementDialog_base *m_base;
73  TQStringList m_templates;
74  TQString m_newTemplate;
75  bool m_changed;
76 };
77 
78 #endif