profiledialog.h
00001 /* 00002 This file is part of KDE Kontact. 00003 00004 Copyright (c) 2007 Frank Osterfeld <frank.osterfeld@kdemail.net> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 00025 #ifndef KONTACT_PROFILEDIALOG_H 00026 #define KONTACT_PROFILEDIALOG_H 00027 00028 #include <kdialogbase.h> 00029 00030 #include <tqmap.h> 00031 #include <tqstring.h> 00032 00033 class TQListViewItem; 00034 00035 class KListView; 00036 class TQPushButton; 00037 00038 namespace Kontact { 00039 00040 class ProfileDialog : public KDialogBase 00041 { 00042 Q_OBJECT 00043 TQ_OBJECT 00044 00045 public: 00046 explicit ProfileDialog( TQWidget* parent = 0, WFlags f = 0 ); 00047 00048 private: 00049 enum ListColumn { 00050 NameColumn=0, 00051 DescriptionColumn=1 00052 }; 00053 00054 TQString selectedProfile() const; 00055 void updateButtonState(); 00056 00057 protected slots: 00058 00059 //override 00060 void slotOk(); 00061 00062 private slots: 00063 00064 void loadSelectedProfile(); 00065 void saveToSelectedProfile(); 00066 void deleteSelectedProfile(); 00067 void importProfile(); 00068 void exportSelectedProfile(); 00069 void addNewProfile(); 00070 void listSelectionChanged(); 00071 void listItemRenamed( TQListViewItem* item, const TQString& text, int col ); 00072 00073 void profileAdded( const TQString& id ); 00074 void profileRemoved( const TQString& id ); 00075 void profileUpdated( const TQString& id ); 00076 void profileLoaded( const TQString& id ); 00077 00078 private: 00079 KListView* m_list; 00080 TQPushButton* m_newProfileButton; 00081 TQPushButton* m_deleteProfileButton; 00082 TQPushButton* m_saveProfileButton; 00083 TQPushButton* m_importProfileButton; 00084 TQPushButton* m_exportProfileButton; 00085 TQMap<TQListViewItem*, TQString> m_itemToProfile; 00086 TQMap<TQString, TQListViewItem*> m_profileToItem; 00087 }; 00088 00089 } // Kontact 00090 00091 #endif // KONTACT_PROFILEDIALOG_H