# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kpanelapplet.h

    00001 /*****************************************************************
    00002
    00003 Copyright (c) 2000 Matthias Elter
    00004
    00005 Permission is hereby granted, free of charge, to any person obtaining a copy
    00006 of this software and associated documentation files (the "Software"), to deal
    00007 in the Software without restriction, including without limitation the rights
    00008 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    00009 copies of the Software, and to permit persons to whom the Software is
    00010 furnished to do so, subject to the following conditions:
    00011
    00012 The above copyright notice and this permission notice shall be included in
    00013 all copies or substantial portions of the Software.
    00014
    00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    00018 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
    00019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    00020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00021
    00022 ******************************************************************/
    00023
    00024 #ifndef __kpanelapplet_h__
    00025 #define __kpanelapplet_h__
    00026
    00027 class KConfig;
    00028 class QPopupMenu;
    00029
    00030 #include <qframe.h>
    00031 #include <kconfig.h>
    00032
    00097 class KDEUI_EXPORT KPanelApplet : public QFrame
    00098 {
    00099     Q_OBJECT
    00100
    00101 public:
    00102
    00106     enum Type { Normal = 0, Stretch };
    00111     // KDE4: Merge these with KPanelExtension's enums
    00112     enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
    00113     enum Position { pLeft = 0, pRight, pTop, pBottom };
    00114     enum Alignment { LeftTop = 0, Center, RightBottom };
    00115     enum Direction { Up = 0, Down, Left, Right };
    00116
    00127     KPanelApplet(const QString& configFile, Type t = Normal,
    00128                  int actions = 0, QWidget *parent = 0, const char *name = 0,
    00129                  WFlags f = 0);
    00130
    00134     ~KPanelApplet();
    00135
    00155     virtual int widthForHeight(int height) const { return height; }
    00156
    00176     virtual int heightForWidth(int width) const { return width; }
    00177
    00187     KConfig* config() const { return _config; }
    00188     KSharedConfig::Ptr sharedConfig() const;
    00189
    00194     Type type() const { return _type; }
    00195
    00200     int actions() const { return _actions; }
    00201
    00212     virtual void action( Action a );
    00213
    00218     const QPopupMenu* customMenu() const;
    00219
    00223     void setPosition( Position p );
    00227     void setAlignment( Alignment a );
    00228
    00229 signals:
    00244     void updateLayout();
    00245
    00250     void requestFocus();
    00251
    00261     void requestFocus(bool focus);
    00262
    00263 protected:
    00264
    00272     virtual void about() {}
    00273
    00281     virtual void help() {}
    00282
    00290     virtual void preferences() {}
    00291
    00300    virtual void reportBug() {}
    00301
    00305     Orientation orientation() const;
    00309     Position position() const { return _position; }
    00313     Alignment alignment() const { return _alignment; }
    00314
    00320     virtual void positionChange( Position p );
    00321
    00327     virtual void alignmentChange( Alignment /*a*/ ) {};
    00328
    00338     void setCustomMenu(const QPopupMenu*);
    00339
    00347     void watchForFocus(QWidget* widget, bool watch = true);
    00348
    00355     void needsFocus(bool focus);
    00356
    00363     // FIXME: Remove for KDE 4
    00364     virtual KDE_DEPRECATED void orientationChange( Orientation /* orientation*/) {}
    00365
    00370     Direction popupDirection();
    00371
    00378     // FIXME: Remove for KDE 4
    00379     virtual KDE_DEPRECATED void popupDirectionChange( Direction /*direction*/ ) {}
    00380
    00381     bool eventFilter(QObject *, QEvent *);
    00382
    00383 private:
    00384     Type         _type;
    00385     Position     _position;
    00386     Alignment    _alignment;
    00387     KConfig*     _config;
    00388     int          _actions;
    00389 protected:
    00390     virtual void virtual_hook( int id, void* data );
    00391     class KPanelAppletPrivate;
    00392     KPanelAppletPrivate *d;
    00393 };
    00394
    00395 #endif

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:20:19 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003