File indexing completed on 2024-04-14 03:59:55

0001 //
0002 // C++ Interface: cbutton
0003 //
0004 // Description: One button.
0005 //
0006 /*
0007 Copyright 2008-2011 Tomas Mecir <kmuddy@kmuddy.com>
0008 
0009 This program is free software; you can redistribute it and/or
0010 modify it under the terms of the GNU General Public License as
0011 published by the Free Software Foundation; either version 2 of 
0012 the License, or (at your option) any later version.
0013 
0014 This program is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU General Public License for more details.
0018 
0019 You should have received a copy of the GNU General Public License
0020 along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #ifndef CBUTTON_H
0024 #define CBUTTON_H
0025 
0026 #include "clistobject.h"
0027 
0028 /**
0029 This class represents one button.
0030 
0031 @author Tomas Mecir
0032 */
0033 
0034 class cButton : public cListObject
0035 {
0036 Q_OBJECT
0037  public:
0038   /** destructor */
0039   ~cButton() override;
0040   
0041 #define BUTTON_UPDATE 1
0042   
0043   cList::TraverseAction traverse (int traversalType) override;
0044 
0045   void attribChanged (const QString &name) override;
0046 
0047   void updateVisibleName() override;
0048 
0049  protected slots:
0050   void execute (bool checked);
0051  protected:
0052   friend class cButtonList;
0053   cButton (cList *list);
0054 
0055   struct Private;
0056   Private *d;
0057 
0058   /** Insert this button to the button bar. */
0059   void addButton ();
0060 
0061   /** React on the fact that the object has moved. */
0062   void objectMoved () override;
0063   void objectEnabled () override;
0064   void objectDisabled () override;
0065 };
0066 
0067 #endif