home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kresources / configpage.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.8 KB  |  111 lines

  1. /*
  2.     This file is part of libkresources.
  3.  
  4.     Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
  5.     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
  6.     Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
  7.  
  8.     This library is free software; you can redistribute it and/or
  9.     modify it under the terms of the GNU Library General Public
  10.     License as published by the Free Software Foundation; either
  11.     version 2 of the License, or (at your option) any later version.
  12.  
  13.     This library is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.     Library General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU Library General Public License
  19.     along with this library; see the file COPYING.LIB.  If not, write to
  20.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21.     Boston, MA 02110-1301, USA.
  22. */
  23. #ifndef KRESOURCES_CONFIGPAGE_H
  24. #define KRESOURCES_CONFIGPAGE_H
  25.  
  26. #include <ksharedptr.h>
  27. #include <qstringlist.h>
  28. #include <qwidget.h>
  29.  
  30. #include "manager.h"
  31.  
  32. class KComboBox;
  33. class KListView;
  34.  
  35. class QListViewItem;
  36. class QPushButton;
  37.  
  38. namespace KRES {
  39.  
  40. class KRESOURCES_EXPORT ResourcePageInfo : public KShared
  41. {
  42.   public:
  43.     ResourcePageInfo();
  44.     ~ResourcePageInfo();
  45.     Manager<Resource> *mManager;
  46.     KConfig *mConfig;
  47. };
  48.  
  49. class Resource;
  50. class ConfigViewItem;
  51.  
  52. class KRESOURCES_EXPORT ConfigPage : public QWidget, public ManagerObserver<Resource>
  53. {
  54.   Q_OBJECT
  55.  
  56.   public:
  57.     ConfigPage( QWidget *parent = 0, const char *name = 0 );
  58.     virtual ~ConfigPage();
  59.  
  60.     void load();
  61.     void save();
  62.     virtual void defaults();
  63.  
  64.   public slots:
  65.     void slotFamilyChanged( int );
  66.     void slotAdd();
  67.     void slotRemove();
  68.     void slotEdit();
  69.     void slotStandard();
  70.     void slotSelectionChanged();
  71.  
  72.   public:
  73.     // From ManagerObserver<Resource>
  74.     virtual void resourceAdded( Resource *resource );
  75.     virtual void resourceModified( Resource *resource );
  76.     virtual void resourceDeleted( Resource *resource );
  77.  
  78.   protected:
  79.     ConfigViewItem *findItem( Resource *resource );
  80.  
  81.   protected slots:
  82.     void slotItemClicked( QListViewItem * );
  83.  
  84.   signals:
  85.     void changed( bool );
  86.  
  87.   private:
  88.     void loadManager( const QString& family );
  89.     void saveResourceSettings();
  90.  
  91.     Manager<Resource>* mCurrentManager;
  92.     KConfig* mCurrentConfig;
  93.     KConfig* mConfig;
  94.     QString mFamily;
  95.     QStringList mFamilyMap;
  96.     QValueList<KSharedPtr<ResourcePageInfo> > mInfoMap;
  97.  
  98.     KComboBox* mFamilyCombo;
  99.     KListView* mListView;
  100.     QPushButton* mAddButton;
  101.     QPushButton* mRemoveButton;
  102.     QPushButton* mEditButton;
  103.     QPushButton* mStandardButton;
  104.  
  105.     QListViewItem* mLastItem;
  106. };
  107.  
  108. }
  109.  
  110. #endif
  111.