# kdeui Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | 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
    00029 #include <qframe.h>
    00030
    00096 class KPanelApplet : public QFrame
    00097 {
    00098     Q_OBJECT
    00099
    00100 public:
    00101
    00105     enum Type { Normal = 0, Stretch };
    00110     enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
    00111     // FIXME: Remove 'p' from element names for KDE 4.
    00112     enum Position { pLeft = 0, pRight, pTop, pBottom };
    00113     enum Alignment { LeftTop = 0, Center, RightBottom };
    00114     // FIXME: Remove for KDE 4.
    00115     enum Direction { Up = 0, Down, Left, Right };
    00116
    00126     KPanelApplet(const QString& configFile, Type t = Normal,
    00127                  int actions = 0, QWidget *parent = 0, const char *name = 0,
    00128                  WFlags f = 0);
    00129
    00133     ~KPanelApplet();
    00134
    00154     virtual int widthForHeight(int height) const { return height; }
    00155
    00175     virtual int heightForWidth(int width) const { return width; }
    00176
    00186     KConfig* config() const { return _config; }
    00187
    00192     Type type() const { return _type; }
    00193
    00198     int actions() const { return _actions; }
    00199
    00210     virtual void action( Action a );
    00211
    00215     void setPosition( Position p );
    00219     void setAlignment( Alignment a );
    00220
    00221 signals:
    00236     void updateLayout();
    00237
    00241     void requestFocus();
    00242
    00243 protected:
    00244
    00252     virtual void about() {}
    00253
    00261     virtual void help() {}
    00262
    00270     virtual void preferences() {}
    00271
    00280    virtual void reportBug() {}
    00281
    00285     Orientation orientation() const;
    00289     Position position() const { return _position; }
    00293     Alignment alignment() const { return _alignment; }
    00294
    00300     virtual void positionChange( Position p );
    00301
    00307     virtual void alignmentChange( Alignment /*a*/ ) {};
    00308
    00315     // FIXME: Remove for KDE 4
    00316     virtual void orientationChange( Orientation /* orientation*/) {}
    00317
    00325     // FIXME: Remove for KDE 4
    00326     Direction popupDirection();
    00327
    00334     // FIXME: Remove for KDE 4
    00335     virtual void popupDirectionChange( Direction /*direction*/ ) {}
    00336
    00337 private:
    00338     Type         _type;
    00339     Position     _position;
    00340     Alignment    _alignment;
    00341     KConfig*     _config;
    00342     int          _actions;
    00343 protected:
    00344     virtual void virtual_hook( int id, void* data );
    00345     class KPanelAppletPrivate;
    00346     KPanelAppletPrivate *d;
    00347 };
    00348
    00349 #endif

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:57:28 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001