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.
129 lines
2.7 KiB
129 lines
2.7 KiB
15 years ago
|
/*
|
||
|
* Copyright (C) 2003 by Unai Garro <ugarro@users.sourceforge.net>
|
||
|
* Copyright (C) 2004 by Enrico Ros <rosenric@dei.unipd.it>
|
||
|
* Copyright (C) 2004 by Stephan Kulow <coolo@kde.org>
|
||
|
* Copyright (C) 2004 by Oswald Buddenhagen <ossi@kde.org>
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation; either version 2 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program 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 General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
13 years ago
|
#ifndef TDMTHEMER_H
|
||
|
#define TDMTHEMER_H
|
||
15 years ago
|
|
||
14 years ago
|
#include <tqobject.h>
|
||
|
#include <tqdom.h>
|
||
13 years ago
|
#include <tqimage.h>
|
||
15 years ago
|
|
||
|
class KdmThemer;
|
||
|
class KdmItem;
|
||
|
class KdmPixmap;
|
||
|
class KdmRect;
|
||
|
class KdmBox;
|
||
|
|
||
14 years ago
|
class TQRect;
|
||
|
class TQWidget;
|
||
|
class TQEvent;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* @author Unai Garro
|
||
|
*/
|
||
|
|
||
|
|
||
|
|
||
|
/*
|
||
|
* The themer widget. Whatever drawn here is just themed
|
||
|
* according to a XML file set by the user.
|
||
|
*/
|
||
|
|
||
|
|
||
14 years ago
|
class KdmThemer : public TQObject {
|
||
15 years ago
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
/*
|
||
|
* Construct and destruct the interface
|
||
|
*/
|
||
|
|
||
14 years ago
|
KdmThemer( const TQString &path, const TQString &mode, TQWidget *parent );
|
||
15 years ago
|
~KdmThemer();
|
||
|
|
||
|
bool isOK() { return rootItem != 0; }
|
||
|
/*
|
||
13 years ago
|
* Gives a sizeHint to the widget (parent size)
|
||
15 years ago
|
*/
|
||
13 years ago
|
//TQSize sizeHint() const{ return parentWidget()->size(); }
|
||
15 years ago
|
|
||
|
/*
|
||
|
* Takes a shot of the current widget
|
||
|
*/
|
||
14 years ago
|
// void pixmap( const TQRect &r, TQPixmap *px );
|
||
15 years ago
|
|
||
|
virtual // just to put the reference in the vmt
|
||
14 years ago
|
KdmItem *findNode( const TQString & ) const;
|
||
15 years ago
|
|
||
|
void updateGeometry( bool force ); // force = true for external calls
|
||
|
|
||
|
// must be called by parent widget
|
||
14 years ago
|
void widgetEvent( TQEvent *e );
|
||
15 years ago
|
|
||
|
signals:
|
||
14 years ago
|
void activated( const TQString &id );
|
||
15 years ago
|
|
||
14 years ago
|
protected slots:
|
||
|
void slotActivated( const TQString &id );
|
||
|
void slotPaintRoot();
|
||
|
|
||
15 years ago
|
private:
|
||
|
/*
|
||
|
* Our display mode (e.g. console, remote, ...)
|
||
|
*/
|
||
14 years ago
|
TQString m_currentMode;
|
||
15 years ago
|
|
||
|
/*
|
||
|
* The config file being used
|
||
|
*/
|
||
14 years ago
|
TQDomDocument domTree;
|
||
15 years ago
|
|
||
|
/*
|
||
|
* Stores the root of the theme
|
||
|
*/
|
||
|
KdmItem *rootItem;
|
||
|
|
||
|
/*
|
||
|
* The backbuffer
|
||
|
*/
|
||
14 years ago
|
TQPixmap *backBuffer;
|
||
15 years ago
|
|
||
|
// methods
|
||
|
|
||
|
/*
|
||
|
* Test whether item needs to be displayed
|
||
|
*/
|
||
14 years ago
|
bool willDisplay( const TQDomNode &node );
|
||
15 years ago
|
|
||
|
/*
|
||
|
* Parses the XML file looking for the
|
||
|
* item list and adds those to the themer
|
||
|
*/
|
||
14 years ago
|
void generateItems( KdmItem *parent = 0, const TQDomNode &node = TQDomNode() );
|
||
15 years ago
|
|
||
14 years ago
|
void showStructure( TQObject *obj );
|
||
15 years ago
|
|
||
14 years ago
|
TQWidget *widget();
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
|
#endif
|