kontact

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 Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef KONTACT_PROFILEDIALOG_H
00026 #define KONTACT_PROFILEDIALOG_H
00027 
00028 #include <kdialogbase.h>
00029 
00030 #include <qmap.h>
00031 #include <qstring.h>
00032 
00033 class QListViewItem;
00034 
00035 class KListView;
00036 class QPushButton;
00037 
00038 namespace Kontact {
00039 
00040 class ProfileDialog : public KDialogBase
00041 {
00042 Q_OBJECT
00043 
00044 public:
00045     explicit ProfileDialog( QWidget* parent = 0, WFlags f = 0 );
00046 
00047 private:
00048     enum ListColumn {
00049         NameColumn=0,
00050         DescriptionColumn=1
00051     };
00052 
00053     QString selectedProfile() const;
00054     void updateButtonState();
00055 
00056 protected slots:
00057 
00058     //override
00059     void slotOk();
00060 
00061 private slots:
00062 
00063     void loadSelectedProfile();
00064     void saveToSelectedProfile();
00065     void deleteSelectedProfile();
00066     void importProfile();
00067     void exportSelectedProfile();
00068     void addNewProfile();
00069     void listSelectionChanged();
00070     void listItemRenamed( QListViewItem* item, const QString& text, int col );
00071 
00072     void profileAdded( const QString& id );
00073     void profileRemoved( const QString& id );
00074     void profileUpdated( const QString& id );
00075     void profileLoaded( const QString& id );
00076 
00077 private:
00078     KListView* m_list;
00079     QPushButton* m_newProfileButton;
00080     QPushButton* m_deleteProfileButton;
00081     QPushButton* m_saveProfileButton;
00082     QPushButton* m_importProfileButton;
00083     QPushButton* m_exportProfileButton;
00084     QMap<QListViewItem*, QString> m_itemToProfile;
00085     QMap<QString, QListViewItem*> m_profileToItem;
00086 };
00087 
00088 } // Kontact
00089 
00090 #endif // KONTACT_PROFILEDIALOG_H
KDE Home | KDE Accessibility Home | Description of Access Keys