2 * Copyright (C) 2003 by Unai Garro <ugarro@users.sourceforge.net>
3 * Copyright (C) 2004 by Enrico Ros <rosenric@dei.unipd.it>
4 * Copyright (C) 2004 by Stephan Kulow <coolo@kde.org>
5 * Copyright (C) 2004 by Oswald Buddenhagen <ossi@kde.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
41 * The themer widget. Whatever drawn here is just themed
42 * according to a XML file set by the user.
46 class KdmThemer
: public QObject
{
51 * Construct and destruct the interface
54 KdmThemer( const QString
&path
,
55 const QMap
<QString
, bool> &types
, QWidget
*w
);
58 bool isOK() { return rootItem
!= 0; }
60 const QString
&baseDir() const { return basedir
; }
62 KdmItem
*findNode( const QString
& ) const;
64 // must be called by parent widget
65 void widgetEvent( QEvent
*e
);
67 void setWidget( QWidget
*w
);
68 QWidget
*widget() { return m_widget
; }
70 void setTypeVisible( const QString
&t
, bool show
);
71 bool typeVisible( const QString
&t
) { return m_showTypes
.value( t
, false ); }
73 void paintBackground( QPaintDevice
*dev
, const QRect
&rect
, bool primaryScreen
);
76 void activated( const QString
&id
);
79 QMap
<QString
, bool> m_showTypes
;
81 // defines the directory the theme is in
85 * Stores the root of the theme
89 bool m_geometryOutdated
;
90 bool m_geometryInvalid
;
97 * Parses the XML file looking for the
98 * item list and adds those to the themer
100 void generateItems( KdmItem
*parent
, const QDomNode
&node
);
101 void generateLayouts( KdmItem
*parent
, const QDomNode
&node
);
103 void showStructure();
106 void update( int x
, int y
, int w
, int h
);
107 void slotNeedPlacement();
108 void slotNeedPlugging();