~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kstyles/oxygen/debug/oxygenwidgetexplorer.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef oxygenwidgetexplorer_h
 
2
#define oxygenwidgetexplorer_h
 
3
 
 
4
//////////////////////////////////////////////////////////////////////////////
 
5
// oxygenwidgetexplorer.h
 
6
// print widget's and parent's information on mouse click
 
7
// -------------------
 
8
//
 
9
// Copyright (c) 2010 Hugo Pereira Da Costa <hugo@oxygen-icons.org>
 
10
//
 
11
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
12
// of this software and associated documentation files (the "Software"), to
 
13
// deal in the Software without restriction, including without limitation the
 
14
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 
15
// sell copies of the Software, and to permit persons to whom the Software is
 
16
// furnished to do so, subject to the following conditions:
 
17
//
 
18
// The above copyright notice and this permission notice shall be included in
 
19
// all copies or substantial portions of the Software.
 
20
//
 
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
24
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
26
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 
27
// IN THE SOFTWARE.
 
28
//////////////////////////////////////////////////////////////////////////////
 
29
 
 
30
#include <QtCore/QEvent>
 
31
#include <QtCore/QObject>
 
32
#include <QtCore/QMap>
 
33
#include <QtCore/QSet>
 
34
#include <QtGui/QWidget>
 
35
 
 
36
namespace Oxygen
 
37
{
 
38
 
 
39
    //! print widget's and parent's information on mouse click
 
40
    class WidgetExplorer: public QObject
 
41
    {
 
42
 
 
43
        Q_OBJECT
 
44
 
 
45
        public:
 
46
 
 
47
        //! constructor
 
48
        WidgetExplorer( QObject* parent );
 
49
 
 
50
        //! enable
 
51
        bool enabled( void ) const;
 
52
 
 
53
        //! enable
 
54
        void setEnabled( bool );
 
55
 
 
56
        //! widget rects
 
57
        void setDrawWidgetRects( bool value )
 
58
        { _drawWidgetRects = value; }
 
59
 
 
60
        //! event filter
 
61
        virtual bool eventFilter( QObject*, QEvent* );
 
62
 
 
63
        protected:
 
64
 
 
65
        //! event type
 
66
        QString eventType( const QEvent::Type& ) const;
 
67
 
 
68
        //! print widget information
 
69
        QString widgetInformation( const QWidget* ) const;
 
70
 
 
71
        private:
 
72
 
 
73
        //! enable state
 
74
        bool _enabled;
 
75
 
 
76
        //! widget rects
 
77
        bool _drawWidgetRects;
 
78
 
 
79
        //! map event types to string
 
80
        QMap<QEvent::Type, QString > _eventTypes;
 
81
 
 
82
    };
 
83
 
 
84
}
 
85
 
 
86
#endif