You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
3.0 KiB
108 lines
3.0 KiB
15 years ago
|
/*
|
||
12 years ago
|
This file is part of libtderesources.
|
||
15 years ago
|
|
||
|
Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
|
||
|
Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
|
||
|
Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
#ifndef KRESOURCES_MANAGERIMPL_H
|
||
|
#define KRESOURCES_MANAGERIMPL_H
|
||
|
|
||
15 years ago
|
#include <tqstring.h>
|
||
|
#include <tqptrlist.h>
|
||
|
#include <tqdict.h>
|
||
15 years ago
|
|
||
|
#include "manageriface.h"
|
||
12 years ago
|
#include <tderesources/resource.h>
|
||
15 years ago
|
|
||
12 years ago
|
class TDEConfig;
|
||
15 years ago
|
|
||
|
namespace KRES {
|
||
|
|
||
|
class Resource;
|
||
|
class Factory;
|
||
|
class ManagerNotifier;
|
||
|
|
||
|
/**
|
||
|
@internal
|
||
|
|
||
|
Do not use this class directly. Use ResourceManager instead
|
||
|
*/
|
||
|
class KRESOURCES_EXPORT ManagerImpl : virtual public ManagerIface
|
||
|
{
|
||
|
public:
|
||
15 years ago
|
ManagerImpl( ManagerNotifier *, const TQString &family );
|
||
15 years ago
|
~ManagerImpl();
|
||
|
|
||
12 years ago
|
void readConfig( TDEConfig * );
|
||
|
void writeConfig( TDEConfig * );
|
||
15 years ago
|
|
||
|
void add( Resource *resource );
|
||
|
void remove( Resource *resource );
|
||
|
void change( Resource *resource );
|
||
|
|
||
|
Resource *standardResource();
|
||
|
void setStandardResource( Resource *resource );
|
||
|
|
||
|
void setActive( Resource *resource, bool active );
|
||
|
|
||
|
Resource::List *resourceList();
|
||
|
|
||
15 years ago
|
TQPtrList<Resource> resources();
|
||
15 years ago
|
|
||
|
// Get only active or passive resources
|
||
15 years ago
|
TQPtrList<Resource> resources( bool active );
|
||
15 years ago
|
|
||
15 years ago
|
TQStringList resourceNames();
|
||
15 years ago
|
|
||
15 years ago
|
static TQString defaultConfigFile( const TQString &family );
|
||
15 years ago
|
|
||
|
private:
|
||
|
// dcop calls
|
||
15 years ago
|
void dcopKResourceAdded( TQString managerId, TQString resourceId );
|
||
|
void dcopKResourceModified( TQString managerId, TQString resourceId );
|
||
|
void dcopKResourceDeleted( TQString managerId, TQString resourceId );
|
||
15 years ago
|
|
||
|
private:
|
||
|
void createStandardConfig();
|
||
|
|
||
15 years ago
|
Resource *readResourceConfig( const TQString& identifier, bool checkActive );
|
||
15 years ago
|
void writeResourceConfig( Resource *resource, bool checkActive );
|
||
|
|
||
|
void removeResource( Resource *resource );
|
||
|
Resource *getResource( Resource *resource );
|
||
15 years ago
|
Resource *getResource( const TQString& identifier );
|
||
15 years ago
|
|
||
|
ManagerNotifier *mNotifier;
|
||
15 years ago
|
TQString mFamily;
|
||
12 years ago
|
TDEConfig *mConfig;
|
||
|
TDEConfig *mStdConfig;
|
||
15 years ago
|
Resource *mStandard;
|
||
|
Factory *mFactory;
|
||
|
Resource::List mResources;
|
||
15 years ago
|
TQString mId;
|
||
15 years ago
|
bool mConfigRead;
|
||
|
|
||
|
class ManagerImplPrivate;
|
||
|
ManagerImplPrivate *d;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|