home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / tkaction.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  3.0 KB  |  124 lines

  1. /*
  2.  * Kivio - Visual Modelling and Flowcharting
  3.  * Copyright (C) 2000 theKompany.com
  4.  *
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License
  7.  * as published by the Free Software Foundation; either version 2
  8.  * of the License, or (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  * Boston, MA 02110-1301, USA.
  19.  */
  20. #ifndef TKACTION_H
  21. #define TKACTION_H
  22.  
  23. #include <kaction.h>
  24. #include <qstringlist.h>
  25. #include <koffice_export.h>
  26. namespace TK {
  27.   enum IconMode { IconOnly, IconAndText, TextOnly };
  28. }
  29.  
  30. class TKToolBarButton;
  31. class TKComboBox;
  32.  
  33. class KOFFICEUI_EXPORT TKAction : public KAction
  34. { Q_OBJECT
  35. public:
  36.   TKAction(QObject* parent, const char* name);
  37.   ~TKAction();
  38.  
  39.   virtual int plug(QWidget* widget, int index = -1);
  40.  
  41.   TK::IconMode iconMode();
  42.  
  43. protected:
  44.   virtual void initToolBarButton(TKToolBarButton*);
  45.  
  46.   QWidget* createLayout(QWidget* parent, QWidget* children);
  47.   void updateLayout();
  48.   virtual void updateLayout(QWidget*);
  49.  
  50. public slots:
  51.   virtual void setIconMode(TK::IconMode);
  52.   void setText(const QString&);
  53.   void setIcon(const QString&);
  54.  
  55. private:
  56.   TK::IconMode m_imode;
  57.   class TKActionPrivate;
  58.   TKActionPrivate *d;
  59. };
  60. /******************************************************************************/
  61. class KOFFICEUI_EXPORT TKBaseSelectAction : public TKAction
  62. { Q_OBJECT
  63. friend class TKSelectAction;
  64. public:
  65.   TKBaseSelectAction(QObject* parent, const char* name);
  66.   ~TKBaseSelectAction();
  67.  
  68.   virtual int plug(QWidget* widget, int index = -1);
  69.  
  70.   int currentItem();
  71.   bool isEditable();
  72.  
  73.   void activate(int);
  74.  
  75. protected:
  76.   virtual void initComboBox(TKComboBox*);
  77.  
  78. public slots:
  79.   virtual void setCurrentItem(int index);
  80.   virtual void setEditable(bool);
  81.  
  82. protected slots:
  83.   virtual void slotActivated(int);
  84.  
  85. signals:
  86.   void activated(int);
  87.  
  88. private:
  89.   int m_current;
  90.   bool m_editable;
  91.   class TKBaseSelectActionPrivate;
  92.   TKBaseSelectActionPrivate *d;
  93. };
  94. /******************************************************************************/
  95. class KOFFICEUI_EXPORT TKSelectAction : public TKBaseSelectAction
  96. { Q_OBJECT
  97. public:
  98.   TKSelectAction(QObject* parent, const char* name);
  99.   ~TKSelectAction();
  100.  
  101.   QStringList items() const;
  102.  
  103. public slots:
  104.   virtual void setItems(const QStringList& );
  105.   virtual void setEditText(const QString&);
  106.   virtual void clear();
  107.  
  108. protected:
  109.   virtual void initComboBox(TKComboBox*);
  110.  
  111. protected slots:
  112.   void slotActivated(const QString&);
  113.  
  114. signals:
  115.   void activated(const QString&);
  116.  
  117. private:
  118.   QStringList m_list;
  119.   class TKSelectActionPrivate;
  120.   TKSelectActionPrivate *d;
  121. };
  122. /******************************************************************************/
  123. #endif
  124.