tomenu.h

Go to the documentation of this file.
00001 // OSB library ************************************************ -*- C++ -*-
00006 /*
00007   AUTHOR(S): Stephan Broennimann (vb)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.11 $
00012 
00013   License
00014    OSB rating and billing library for communication networks
00015    Copyright (C) 2004, 2005, 2006  OSB systems
00016 
00017    This file may be distributed and/or modify under the terms of the
00018    GNU General Public License (GPL) as published by the Free Software
00019    Foundation which is provided in the file LICENSE.GPL included in the
00020    packaging of this file.
00021 
00022    The file is distributed in the hope that it will be useful, but WITHOUT
00023    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00024    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00025    for more details.
00026 
00027    Holders of a OSB Commercial License may use this file under the terms
00028    and conditions of this commercial license.
00029  */
00030 #ifndef _TOMENU_H_
00031 #define _TOMENU_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + libraries
00038 #include <qpopupmenu.h>
00039 
00040 // + local headers
00041 
00042 // ************************************************************************
00043 // namespace extensions
00044 namespace OSB_GUI {
00045 
00046 // ************************************************************************
00047 // forward declarations
00048     struct ToMenuCmd;
00049 
00050 // ************************************************************************
00051 // class definitions
00055     class ToMenu : public QPopupMenu {
00056         Q_OBJECT                        // for vim ->;
00057     public:
00058         enum Command {
00060             cmdShow = 1,
00062             cmdEdit,
00064             cmdStatus,
00066             cmdDelete,
00068             cmdNewObject,
00070             cmdNewVersion,
00072             cmdCopyVersion,
00074             cmdGoto,
00076             cmdUser = 16
00077         };
00078     public:
00080         explicit ToMenu(
00081                   QWidget* parent,
00082             const char*    name = "toMenu_"
00083         );
00084     private:
00086         ToMenu(const ToMenu&);
00088         ToMenu& operator=(const ToMenu&);
00089     public:
00091         void languageChange();
00097         void clearCommands(bool disable = false);
00104         void addCmd(
00105             Command cmd,
00106             bool    enable = true
00107         );
00117         void addUserCmd(
00118                   int           cmd,
00119             const std::string&  text,
00120                   bool          enable = true,
00121             const QKeySequence& accel  = QKeySequence()
00122         );
00123     signals:
00132         void sigCommand(ToMenuCmd cmd);
00133     private slots:
00139         void activationEvent(int id);
00140     };
00141 
00150     struct ToMenuCmd {
00151     public:
00153         ToMenuCmd(ToMenu::Command cmd);
00155         operator ToMenu::Command() const;
00157         ToMenu::Command cmd_;
00158     };                                  // ToMenuCmd
00159 }                                       // namespace OSB_GUI
00160 #endif                                  // #ifndef _TOMENU_H_

Generated on Sat Sep 2 14:17:37 2006 for OSB Library by  doxygen 1.4.7