kontact

profiledialog.h
1/*
2 This file is part of KDE Kontact.
3
4 Copyright (c) 2007 Frank Osterfeld <frank.osterfeld@kdemail.net>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20 As a special exception, permission is given to link this program
21 with any edition of TQt, and distribute the resulting executable,
22 without including the source code for TQt in the source distribution.
23*/
24
25#ifndef KONTACT_PROFILEDIALOG_H
26#define KONTACT_PROFILEDIALOG_H
27
28#include <kdialogbase.h>
29
30#include <tqmap.h>
31#include <tqstring.h>
32
33class TQListViewItem;
34
35class TDEListView;
36class TQPushButton;
37
38namespace Kontact {
39
40class ProfileDialog : public KDialogBase
41{
42TQ_OBJECT
43
44
45public:
46 explicit ProfileDialog( TQWidget* parent = 0, WFlags f = 0 );
47
48private:
49 enum ListColumn {
50 NameColumn=0,
51 DescriptionColumn=1
52 };
53
54 TQString selectedProfile() const;
55 void updateButtonState();
56
57protected slots:
58
59 //override
60 void slotOk();
61
62private slots:
63
64 void loadSelectedProfile();
65 void saveToSelectedProfile();
66 void deleteSelectedProfile();
67 void importProfile();
68 void exportSelectedProfile();
69 void addNewProfile();
70 void listSelectionChanged();
71 void listItemRenamed( TQListViewItem* item, const TQString& text, int col );
72
73 void profileAdded( const TQString& id );
74 void profileRemoved( const TQString& id );
75 void profileUpdated( const TQString& id );
76 void profileLoaded( const TQString& id );
77
78private:
79 TDEListView* m_list;
80 TQPushButton* m_newProfileButton;
81 TQPushButton* m_deleteProfileButton;
82 TQPushButton* m_saveProfileButton;
83 TQPushButton* m_importProfileButton;
84 TQPushButton* m_exportProfileButton;
85 TQMap<TQListViewItem*, TQString> m_itemToProfile;
86 TQMap<TQString, TQListViewItem*> m_profileToItem;
87};
88
89} // Kontact
90
91#endif // KONTACT_PROFILEDIALOG_H