kradio4  r778
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
widgetpluginbase.h
Go to the documentation of this file.
1 /***************************************************************************
2  widgetplugins.h - description
3  -------------------
4  begin : Mi Aug 27 2003
5  copyright : (C) 2003 by Martin Witte
6  email : emw-kradio@nocabal.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef KRADIO_WIDGETPLUGINS_INTERFACES_H
19 #define KRADIO_WIDGETPLUGINS_INTERFACES_H
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 #include <QtGui/QAction>
26 
27 #include "pluginbase.h"
28 
29 
30 class QWidget;
31 class KConfigGroup;
32 
33 class KDE_EXPORT WidgetPluginBase : public PluginBase
34 {
35 public :
36  WidgetPluginBase(QWidget *myself, const QString &instanceID, const QString &name, const QString &description);
37 
38  virtual void saveState ( KConfigGroup &) const;
39  virtual void restoreState (const KConfigGroup &);
40  virtual void restoreState (const KConfigGroup &, bool showByDefault);
41  virtual void startPlugin();
42 
43  virtual QWidget *getWidget() { return m_myself; }
44  virtual const QWidget *getWidget() const { return m_myself; }
45 
46  virtual bool isReallyVisible(const QWidget *w = NULL, bool ignore_mapping_state = false) const;
47  virtual bool isAnywhereVisible(const QWidget *w = NULL) const;
48 
49  virtual QAction *getHideShowAction() { return &m_HideShowAction; }
50  virtual void updateHideShowAction(bool show);
51 
52  virtual void showOnOrgDesktop();
53 
54 protected:
55  virtual void toggleShown() = 0; // must be implemented as protected SLOT in the widget plugin!
56  virtual void setVisible(bool) = 0; // this QWidget method must be intercepted
57 
58  virtual void pShow ();
59  virtual void pHide ();
60  virtual void pSetVisible(bool v);
61  virtual void pToggleShown ();
62 
63  virtual void showEvent(QShowEvent *) = 0;
64  virtual void pShowEvent(QShowEvent *);
65  virtual void hideEvent(QHideEvent *) = 0;
66  virtual void pHideEvent(QHideEvent *);
67 
68  virtual void notifyManager(bool shown);
69 
70  virtual void getKWinState(const QWidget *w = NULL) const;
71 
72 
73 protected:
74  QWidget *m_myself;
79 
80  // temporary data
81  mutable bool m_geoCacheValid;
82  mutable bool m_saveMinimized;
83  mutable bool m_saveMaximized;
84  mutable bool m_saveSticky;
85  mutable int m_saveDesktop;
86  mutable QRect m_saveGeometry;
87 
88 
89 };
90 
91 
92 
93 #endif