• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kpanelapplet.h
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 <tqframe.h>
28 #include <tdeconfig.h>
29 
30 class TDEConfig;
31 class TQPopupMenu;
32 
97 class TDEUI_EXPORT KPanelApplet : public TQFrame
98 {
99  Q_OBJECT
100 
101 public:
102 
106  enum Type { Normal = 0, Stretch };
111  // KDE4: Merge these with KPanelExtension's enums
112  enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
113  enum Position { pLeft = 0, pRight, pTop, pBottom };
114  enum Alignment { LeftTop = 0, Center, RightBottom };
115  enum Direction { Up = 0, Down, Left, Right };
116 
127  KPanelApplet(const TQString& configFile, Type t = Normal,
128  int actions = 0, TQWidget *parent = 0, const char *name = 0,
129  WFlags f = 0);
130 
134  ~KPanelApplet();
135 
155  virtual int widthForHeight(int height) const { return height; }
156 
176  virtual int heightForWidth(int width) const { return width; }
177 
187  TDEConfig* config() const { return _config; }
188  TDESharedConfig::Ptr sharedConfig() const;
189 
194  Type type() const { return _type; }
195 
200  int actions() const { return _actions; }
201 
212  virtual void action( Action a );
213 
218  const TQPopupMenu* customMenu() const;
219 
223  void setPosition( Position p );
227  void setAlignment( Alignment a );
228 
229 signals:
244  void updateLayout();
245 
250  void requestFocus();
251 
261  void requestFocus(bool focus);
262 
263 protected:
264 
272  virtual void about() {}
273 
281  virtual void help() {}
282 
290  virtual void preferences() {}
291 
300  virtual void reportBug() {}
301 
305  Orientation orientation() const;
309  Position position() const { return _position; }
313  Alignment alignment() const { return _alignment; }
314 
320  virtual void positionChange( Position p );
321 
327  virtual void alignmentChange( Alignment /*a*/ ) {}
328 
338  void setCustomMenu(const TQPopupMenu*);
339 
347  void watchForFocus(TQWidget* widget, bool watch = true);
348 
355  void needsFocus(bool focus);
356 
363  // FIXME: Remove for KDE 4
364  virtual KDE_DEPRECATED void orientationChange( Orientation /* orientation*/) {}
365 
370  Direction popupDirection();
371 
378  // FIXME: Remove for KDE 4
379  virtual KDE_DEPRECATED void popupDirectionChange( Direction /*direction*/ ) {}
380 
381  bool eventFilter(TQObject *, TQEvent *);
382 
383 private:
384  Type _type;
385  Position _position;
386  Alignment _alignment;
387  TDEConfig* _config;
388  int _actions;
389 protected:
390  virtual void virtual_hook( int id, void* data );
391  class KPanelAppletPrivate;
392  KPanelAppletPrivate *d;
393 };
394 
395 #endif
TDEConfig
KPanelApplet::help
virtual void help()
Is called when the user selects "Help" from the applet's RMB menu.
Definition: kpanelapplet.h:281
KPanelApplet::orientationChange
virtual KDE_DEPRECATED void orientationChange(Orientation)
The orientation changed to orientation.
Definition: kpanelapplet.h:364
KPanelApplet::position
Position position() const
Definition: kpanelapplet.h:309
Right
KPanelApplet::about
virtual void about()
Is called when the user selects "About" from the applet's RMB menu.
Definition: kpanelapplet.h:272
KPanelApplet::widthForHeight
virtual int widthForHeight(int height) const
Returns a suggested width for a given height.
Definition: kpanelapplet.h:155
KPanelApplet
TDE Panel Applet class
Definition: kpanelapplet.h:97
KPanelApplet::alignmentChange
virtual void alignmentChange(Alignment)
The panel on which this applet resides has changed its alignment.
Definition: kpanelapplet.h:327
KPanelApplet::config
TDEConfig * config() const
Always use this TDEConfig object to save/load your applet's configuration.
Definition: kpanelapplet.h:187
KPanelApplet::Type
Type
This enum describes the type of the applet.
Definition: kpanelapplet.h:106
KPanelApplet::actions
int actions() const
Definition: kpanelapplet.h:200
KPanelApplet::Action
Action
This enum holds flags which can be ORed together to describe which items the context menu over the ap...
Definition: kpanelapplet.h:112
Left
KPanelApplet::preferences
virtual void preferences()
Is called when the user selects "Preferences" from the applet's RMB menu.
Definition: kpanelapplet.h:290
KPanelApplet::type
Type type() const
Definition: kpanelapplet.h:194
KPanelApplet::reportBug
virtual void reportBug()
Is called when the user selects "Report bug" from the applet's RMB menu.
Definition: kpanelapplet.h:300
KPanelApplet::popupDirectionChange
virtual KDE_DEPRECATED void popupDirectionChange(Direction)
The popup direction changed to direction.
Definition: kpanelapplet.h:379
KPanelApplet::heightForWidth
virtual int heightForWidth(int width) const
Definition: kpanelapplet.h:176
KPanelApplet::alignment
Alignment alignment() const
Definition: kpanelapplet.h:313

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.