kinstance.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Torben Weis <weis@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 #ifndef _KINSTANCE_H 00019 #define _KINSTANCE_H 00020 00021 #include <tqstring.h> 00022 #include "tdelibs_export.h" 00023 00024 class TDEStandardDirs; 00025 class TDEAboutData; 00026 class TDEConfig; 00027 class TDEIconLoader; 00028 class KCharsets; 00029 class TQFont; 00030 class TDEInstancePrivate; 00031 class KMimeSourceFactory; 00032 class TDESharedConfig; 00033 #ifdef __TDE_HAVE_TDEHWLIB 00034 class TDEHardwareDevices; 00035 class TDEGlobalNetworkManager; 00036 #endif 00037 00038 00047 class TDECORE_EXPORT TDEInstance 00048 { 00049 friend class TDEStandardDirs; 00050 00051 public: 00056 TDEInstance( const TQCString& instanceName) ; 00057 00068 TDEInstance( const TDEAboutData * aboutData ); 00069 00070 /* 00071 * @internal 00072 * Only for K(Unique)Application 00073 * Initialize from src and delete it. 00074 */ 00075 00076 TDEInstance( TDEInstance* src ); 00077 00081 virtual ~TDEInstance(); 00082 00087 TDEStandardDirs *dirs() const; 00088 00093 TDEConfig *config() const; 00094 00099 TDESharedConfig *sharedConfig() const; 00100 00107 void setConfigReadOnly(bool ro); 00108 00113 TDEIconLoader *iconLoader() const; 00114 00115 #ifdef __TDE_HAVE_TDEHWLIB 00116 00120 TDEHardwareDevices *hardwareDevices() const; 00121 00126 TDEGlobalNetworkManager *networkManager() const; 00127 #endif 00128 00132 void newIconLoader() const; 00133 00140 const TDEAboutData *aboutData() const; 00141 00147 TQCString instanceName() const; 00148 00154 KMimeSourceFactory* mimeSourceFactory () const; 00155 00156 protected: 00160 TDEInstance( const TDEInstance& ); 00161 00167 void setConfigName(const TQString &name); 00168 00169 private: 00170 mutable TDEStandardDirs *_dirs; 00171 00172 mutable TDEConfig *_config; 00173 mutable TDEIconLoader *_iconLoader; 00174 00175 #ifdef __TDE_HAVE_TDEHWLIB 00176 mutable TDEHardwareDevices *_hardwaredevices; 00177 mutable TDEGlobalNetworkManager *_networkmanager; 00178 #endif 00179 mutable void *_placeholder; 00180 00181 TQCString _name; 00182 const TDEAboutData *_aboutData; 00183 00184 protected: 00185 virtual void virtual_hook( int id, void* data ); 00186 private: 00187 TDEInstancePrivate *d; 00188 bool m_configReadOnly; 00189 }; 00190 00191 #endif 00192