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

« back to all changes in this revision

Viewing changes to kstyles/oxygen/animations/oxygenmenudata.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 oxygenmenu_datah
 
2
#define oxygenmenu_datah
 
3
 
 
4
//////////////////////////////////////////////////////////////////////////////
 
5
// oxygenmenudata.h
 
6
// data container for QMenu animations
 
7
// -------------------
 
8
//
 
9
// Copyright (c) 2009 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 "oxygenmenubardata.h"
 
31
#include <QtGui/QMenu>
 
32
 
 
33
namespace Oxygen
 
34
{
 
35
 
 
36
    //! menubar data
 
37
    /*!
 
38
    most members are identical to menubar data. The one that are not are
 
39
    using templatized versions, because QMenuBar and QMenu API are very similar
 
40
    */
 
41
    class MenuDataV1: public MenuBarDataV1
 
42
    {
 
43
 
 
44
        Q_OBJECT
 
45
 
 
46
        public:
 
47
 
 
48
        //! constructor
 
49
        MenuDataV1( QObject* parent, QWidget* target, int duration ):
 
50
        MenuBarDataV1( parent, target, duration )
 
51
        {}
 
52
 
 
53
        //! destructor
 
54
        virtual ~MenuDataV1( void )
 
55
        {}
 
56
 
 
57
        protected:
 
58
 
 
59
        //! menubar enterEvent
 
60
        virtual void enterEvent( const QObject* object )
 
61
        { MenuBarDataV1::enterEvent<QMenu>( object ); }
 
62
 
 
63
        //! menubar enterEvent
 
64
        virtual void leaveEvent( const QObject* object )
 
65
        { MenuBarDataV1::leaveEvent<QMenu>( object ); }
 
66
 
 
67
        //! menubar mouseMoveEvent
 
68
        virtual void mouseMoveEvent( const QObject* object )
 
69
        { MenuBarDataV1::mouseMoveEvent<QMenu>( object ); }
 
70
 
 
71
        //! menubar mousePressEvent
 
72
        virtual void mousePressEvent( const QObject* object )
 
73
        { MenuBarDataV1::mousePressEvent<QMenu>( object ); }
 
74
 
 
75
    };
 
76
 
 
77
    //! menubar data
 
78
    /*!
 
79
    most members are identical to menubar data. The one that are not are
 
80
    using templatized versions, because QMenuBar and QMenu API are very similar
 
81
    */
 
82
    class MenuDataV2: public MenuBarDataV2
 
83
    {
 
84
 
 
85
        Q_OBJECT
 
86
 
 
87
        public:
 
88
        //! constructor
 
89
        MenuDataV2( QObject* parent, QWidget* target, int duration ):
 
90
        MenuBarDataV2( parent, target, duration )
 
91
        { setEntered( false ); }
 
92
 
 
93
        //! destructor
 
94
        virtual ~MenuDataV2( void )
 
95
        {}
 
96
 
 
97
        protected:
 
98
 
 
99
        //! menubar enterEvent
 
100
        virtual void enterEvent( const QObject* object )
 
101
        { MenuBarDataV2::enterEvent<QMenu>( object ); }
 
102
 
 
103
        //! menubar enterEvent
 
104
        virtual void leaveEvent( const QObject* object )
 
105
        { MenuBarDataV2::leaveEvent<QMenu>( object ); }
 
106
 
 
107
        //! menubar mouseMoveEvent
 
108
        virtual void mouseMoveEvent( const QObject* object )
 
109
        { MenuBarDataV2::mouseMoveEvent<QMenu>( object ); }
 
110
 
 
111
    };
 
112
 
 
113
}
 
114
 
 
115
#endif