Jan Möbius committed Aug 29, 2008 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ``````//============================================================================= // // OpenFlipper // Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen // www.openflipper.org // //----------------------------------------------------------------------------- // // License // // OpenFlipper is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. `````` Jan Möbius committed Jan 27, 2009 15 ``````// `````` Jan Möbius committed Aug 29, 2008 16 17 18 19 ``````// OpenFlipper 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 Lesser General Public License for more details. `````` Jan Möbius committed Jan 27, 2009 20 ``````// `````` Jan Möbius committed Aug 29, 2008 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ``````// You should have received a copy of the GNU Lesser General Public License // along with OpenFlipper. If not, see . // //----------------------------------------------------------------------------- // // \$Revision\$ // \$Author\$ // \$Date\$ // //============================================================================= // // C++ Interface: BasePlugin // `````` Jan Möbius committed Jan 27, 2009 38 ``````// Description: `````` Jan Möbius committed Aug 29, 2008 39 40 41 42 43 ``````// // // Author: Jan Moebius , (C) 2007 // `````` Jan Möbius committed Jan 27, 2009 44 45 ``````#ifndef MENUBARINTERFACE_HH #define MENUBARINTERFACE_HH `````` Jan Möbius committed Aug 29, 2008 46 47 48 49 `````` #include #include #include `````` Jan Möbius committed Jan 27, 2009 50 `````` `````` Jan Möbius committed Mar 09, 2009 51 ``````enum MenuActionType { `````` Jan Möbius committed Aug 29, 2008 52 `````` /// The Menu will be created directly inside the Menubar. `````` Jan Möbius committed Jan 27, 2009 53 54 `````` TOPLEVELMENU, `````` Jan Möbius committed Aug 29, 2008 55 56 `````` /// The Menu will be added inside the File Menu FILEMENU, `````` Jan Möbius committed Jan 27, 2009 57 `````` `````` Jan Möbius committed Aug 29, 2008 58 `````` /// The Menu will be added inside the View Menu `````` Jan Möbius committed Mar 09, 2009 59 60 61 62 `````` VIEWMENU, /// The Menu will be added inside the Tools Menu TOOLSMENU `````` Jan Möbius committed Jan 27, 2009 63 `````` `````` Jan Möbius committed Aug 29, 2008 64 ``````}; `````` Jan Möbius committed Jan 27, 2009 65 `````` `````` Jan Möbius committed Aug 29, 2008 66 ``````/** \brief Interface for all plugins which provide entries to the main menubar `````` Jan Möbius committed Jan 27, 2009 67 `````` * `````` Jan Möbius committed Aug 29, 2008 68 `````` * To add custom menus to the menubar, you have to use this interface class. Create `````` Jan Möbius committed Jan 27, 2009 69 `````` * your own QMenu and emit initializeMenu to add it to the menubar. You can connect the `````` Jan Möbius committed Aug 29, 2008 70 71 `````` * signals and slots for your menu inside the plugin.\n * The placement of your menu is controlled by the MenuType. See MenuType for details. `````` Jan Möbius committed Jan 27, 2009 72 `````` */ `````` Jan Möbius committed Aug 29, 2008 73 ``````class MenuInterface { `````` Jan Möbius committed Jan 27, 2009 74 75 76 `````` public : `````` Jan Möbius committed Aug 29, 2008 77 78 `````` /// Destructor virtual ~MenuInterface() {}; `````` Jan Möbius committed Jan 27, 2009 79 `````` `````` Jan Möbius committed Aug 29, 2008 80 ``````signals: `````` Jan Möbius committed Mar 09, 2009 81 `````` /** \brief Adds an action to the menubar `````` Jan Möbius committed Jan 27, 2009 82 `````` * `````` Jan Möbius committed Mar 09, 2009 83 `````` * Add an action to the menubar or one of its sub menus \n `````` Jan Möbius committed Aug 29, 2008 84 85 86 `````` * \n * Example : \n * QMenu *colorMenu = new QMenu(tr("&Colors")); \n `````` Jan Möbius committed Mar 09, 2009 87 `````` * emit addMenubarAction( colorMenu->menuAction(), TOOLSMENU ) `````` Jan Möbius committed Aug 29, 2008 88 `````` * \n `````` Jan Möbius committed Mar 09, 2009 89 90 91 92 93 `````` * All actions or sub actions can be freely controlled by yourself. You have * to connect the required signals and slots to your plugin. * * @param _action Pointer to the new action * @param _type Type of the Action ( See MenuActionType for Details ) `````` Jan Möbius committed Aug 29, 2008 94 `````` */ `````` Jan Möbius committed Mar 09, 2009 95 `````` virtual void addMenubarAction(QAction* /*_action*/, MenuActionType /*_type*/ ) {}; `````` Jan Möbius committed Aug 29, 2008 96 97 98 `````` }; `````` Jan Möbius committed Mar 09, 2009 99 ``````Q_DECLARE_INTERFACE(MenuInterface,"OpenFlipper.MenuInterface/1.0") `````` Jan Möbius committed Jan 27, 2009 100 `````` `````` Jan Möbius committed Aug 29, 2008 101 ``#endif // MENUBARINTERFACE_HH``