source: trunk/tools/designer/interfaces/actioninterface.h@ 10

Last change on this file since 10 was 2, checked in by dmik, 20 years ago

Imported xplatform parts of the official release 3.3.1 from Trolltech

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1 /**********************************************************************
2** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
3**
4** This file is part of Qt Designer.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
12** licenses may use this file in accordance with the Qt Commercial License
13** Agreement provided with the Software.
14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17**
18** See http://www.trolltech.com/gpl/ for GPL licensing information.
19** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
20** information about Qt Commercial License Agreements.
21**
22** Contact info@trolltech.com if any conditions of this licensing are
23** not clear to you.
24**
25**********************************************************************/
26
27#ifndef ACTIONINTERFACE_H
28#define ACTIONINTERFACE_H
29
30#include <private/qcom_p.h>
31
32class QAction;
33class QObject;
34
35// {bb206e09-84e5-4777-9fce-706babfab931}
36#ifndef IID_Action
37#define IID_Action QUuid( 0xbb206e09, 0x84e5, 0x4777, 0x9f, 0xce, 0x70, 0x6b, 0xab, 0xfa, 0xb9, 0x31 )
38#endif
39
40/*! To add actions to the Qt Designer menubars and toolbars, implement
41 this interface. You have to implement the create(), group() and
42 connectTo() functions.
43
44 You also have to implement the function featureList() (\sa
45 QFeatureListInterface) to return the names of all actions
46 which this interface provides.
47*/
48
49class ActionInterface : public QFeatureListInterface
50{
51public:
52 enum Location {
53 Toolbar,
54 Menu
55 };
56
57 /*! This functions is called to create the action with the name \a
58 name. \a parent should be used as parent of the action.
59
60 In the implementation return the QAction object for the action
61 \a name.
62 */
63 virtual QAction* create( const QString &name, QObject* parent = 0 ) = 0;
64
65 /*! In the implementation of the interface return the name of the
66 group of the action \a name.
67 */
68 virtual QString group( const QString &name ) const = 0;
69
70 /*! In the implementation of the interface return whether the
71 action \a name should appear in the location \a l */
72 virtual bool location( const QString &name, Location l ) const = 0;
73
74 /*! \internal */
75 virtual void connectTo( QUnknownInterface *appInterface ) = 0;
76};
77
78#endif
Note: See TracBrowser for help on using the repository browser.