configpage.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 #ifndef KRESOURCES_CONFIGPAGE_H
00024 #define KRESOURCES_CONFIGPAGE_H
00025 
00026 #include <ksharedptr.h>
00027 #include <qstringlist.h>
00028 #include <qwidget.h>
00029 
00030 #include "manager.h"
00031 
00032 class KComboBox;
00033 class KListView;
00034 
00035 class QListViewItem;
00036 class QPushButton;
00037 
00038 namespace KRES {
00039 
00040 class ResourcePageInfo : public KShared
00041 {
00042   public:
00043     ResourcePageInfo();
00044     ~ResourcePageInfo();
00045     Manager<Resource> *mManager;
00046     KConfig *mConfig;
00047 };
00048 
00049 class Resource;
00050 class ConfigViewItem;
00051 
00052 class ConfigPage : public QWidget, public ManagerObserver<Resource>
00053 {
00054   Q_OBJECT
00055 
00056   public:
00057     ConfigPage( QWidget *parent = 0, const char *name = 0 );
00058     virtual ~ConfigPage();
00059 
00060     void load();
00061     void save();
00062     virtual void defaults();
00063 
00064   public slots:
00065     void slotFamilyChanged( int );
00066     void slotAdd();
00067     void slotRemove();
00068     void slotEdit();
00069     void slotStandard();
00070     void slotSelectionChanged();
00071 
00072   public:
00073     
00074     virtual void resourceAdded( Resource *resource );
00075     virtual void resourceModified( Resource *resource );
00076     virtual void resourceDeleted( Resource *resource );
00077 
00078   protected:
00079     ConfigViewItem *findItem( Resource *resource );
00080 
00081   protected slots:
00082     void slotItemClicked( QListViewItem * );
00083 
00084   signals:
00085     void changed( bool );
00086 
00087   private:
00088     void saveResourceSettings();
00089 
00090     Manager<Resource>* mCurrentManager;
00091     KConfig* mCurrentConfig;
00092     KConfig* mConfig;
00093     QString mFamily;
00094     QStringList mFamilyMap;
00095     QValueList<KSharedPtr<ResourcePageInfo> > mInfoMap;
00096 
00097     KComboBox* mFamilyCombo;
00098     KListView* mListView;
00099     QPushButton* mAddButton;
00100     QPushButton* mRemoveButton;
00101     QPushButton* mEditButton;
00102     QPushButton* mStandardButton;
00103 
00104     QListViewItem* mLastItem;
00105 };
00106 
00107 }
00108 
00109 #endif
 
This file is part of the documentation for kresources Library Version 3.2.0.