• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • sources
  • kde-4.14
  • kdelibs
  • kde3support
  • kdeui
k3panelapplet.h
Go to the documentation of this file.
1 /*****************************************************************
2 
3 Copyright (c) 2000 Matthias Elter
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11 
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 ******************************************************************/
23 
24 #ifndef __kpanelapplet_h__
25 #define __kpanelapplet_h__
26 
27 #include <kde3support_export.h>
28 #include <QtGui/QFrame>
29 
30 #include <ksharedconfig.h>
31 
32 class QMenu;
33 
98 class KDE3SUPPORT_EXPORT K3PanelApplet : public QFrame
99 {
100  Q_OBJECT
101 
102 public:
103  enum Type { Normal = 0, Stretch };
104  enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
105  enum Position { Left = 0, Right, Up, Down, Top = Up, Bottom = Down, Floating };
106  enum Alignment { LeftTop = 0, Center, RightBottom };
107 
117  explicit K3PanelApplet(const QString& configFile, Type t = Normal,
118  int actions = 0, QWidget *parent = 0, Qt::WindowFlags f = 0);
119 
123  ~K3PanelApplet();
124 
144  virtual int widthForHeight(int height) const { return height; }
145 
165  virtual int heightForWidth(int width) const { return width; }
166 
176  KConfig* config() const;
177  KSharedConfig::Ptr sharedConfig() const;
178 
183  Type type() const;
184 
189  int actions() const;
190 
201  virtual void action( Action a );
202 
207  const QMenu* customMenu() const;
208 
212  void setPosition( Position p );
216  void setAlignment( Alignment a );
217 
218 Q_SIGNALS:
233  void updateLayout();
234 
239  void requestFocus();
240 
249  void requestFocus(bool focus);
250 
251 protected:
252 
260  virtual void about() {}
261 
269  virtual void help() {}
270 
278  virtual void preferences() {}
279 
288  virtual void reportBug() {}
289 
293  Qt::Orientation orientation() const;
297  Position position() const;
301  Alignment alignment() const;
302 
308  virtual void positionChange( Position p );
309 
315  virtual void alignmentChange( Alignment /*a*/ ) {}
316 
326  void setCustomMenu(const QMenu*);
327 
334  void watchForFocus(QWidget* widget, bool watch = true);
335 
341  void needsFocus(bool focus);
342 
349  // FIXME: Remove for KDE 4
350  virtual KDE_DEPRECATED void orientationChange( Qt::Orientation /* orientation*/) {}
351 
356  Position popupDirection();
357 
364  // FIXME: Remove for KDE 4
365  virtual KDE_DEPRECATED void popupDirectionChange( Position /*direction*/ ) {}
366 
367  bool eventFilter(QObject *, QEvent *);
368 
369 protected:
370  class Private;
371  Private *d;
372 };
373 
374 #endif
KSharedPtr
QEvent
QWidget
Preferences
K3PanelApplet
KDE Panel Applet class
Definition: k3panelapplet.h:98
Left
Type
Type
Right
K3PanelApplet::Alignment
Alignment
Definition: k3panelapplet.h:106
K3PanelApplet::heightForWidth
virtual int heightForWidth(int width) const
Definition: k3panelapplet.h:165
K3PanelApplet::d
Private * d
Definition: k3panelapplet.h:370
ReportBug
K3PanelApplet::alignmentChange
virtual void alignmentChange(Alignment)
The panel on which this applet resides has changed its alignment.
Definition: k3panelapplet.h:315
config
KSharedConfigPtr config()
QWidget::width
int width() const
K3PanelApplet::orientationChange
virtual void orientationChange(Qt::Orientation)
The orientation changed to orientation.
Definition: k3panelapplet.h:350
K3PanelApplet::reportBug
virtual void reportBug()
Is called when the user selects "Report bug" from the applet's RMB menu.
Definition: k3panelapplet.h:288
kde3support_export.h
K3PanelApplet::popupDirectionChange
virtual void popupDirectionChange(Position)
The popup direction changed to direction.
Definition: k3panelapplet.h:365
QObject
QObject::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
ksharedconfig.h
QString
K3PanelApplet::preferences
virtual void preferences()
Is called when the user selects "Preferences" from the applet's RMB menu.
Definition: k3panelapplet.h:278
Action
K3PanelApplet::Type
Type
Definition: k3panelapplet.h:103
QMenu
QFrame
Top
KConfig
K3PanelApplet::Position
Position
Definition: k3panelapplet.h:105
K3PanelApplet::widthForHeight
virtual int widthForHeight(int height) const
Returns a suggested width for a given height.
Definition: k3panelapplet.h:144
Help
K3PanelApplet::about
virtual void about()
Is called when the user selects "About" from the applet's RMB menu.
Definition: k3panelapplet.h:260
Qt::WindowFlags
typedef WindowFlags
K3PanelApplet::help
virtual void help()
Is called when the user selects "Help" from the applet's RMB menu.
Definition: k3panelapplet.h:269
QWidget::actions
QList< QAction * > actions() const
QWidget::height
int height() const
K3PanelApplet::Up
Definition: k3panelapplet.h:105
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal