kdeui Library API Documentation

kpanelextension.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 __kpanelextension_h__
00025 #define __kpanelextension_h__
00026 
00027 class QPopupMenu;
00028 class KConfig;
00029 class KPanelExtensionPrivate;
00030 
00031 #include <qframe.h>
00032 
00033 #include <kdelibs_export.h>
00034 
00098 class KDEUI_EXPORT KPanelExtension : public QFrame
00099 {
00100     Q_OBJECT
00101 
00102 public:
00103 
00105     enum Type { Normal = 0, Stretch };
00106     // KDE4: Merge these with KPanelApplet's enums
00107     enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00108     enum Position { Left = 0, Right, Top, Bottom, Floating };
00109     enum Alignment { LeftTop = 0, Center, RightBottom };
00111     enum Size { SizeTiny = 0, SizeSmall, SizeNormal, SizeLarge, SizeCustom };
00112 
00122     KPanelExtension(const QString& configFile, Type t = Normal,
00123          int actions = 0, QWidget *parent = 0, const char *name = 0);
00124 
00128     ~KPanelExtension();
00129 
00139     virtual QSize sizeHint(Position /*p*/, QSize maxsize) const { return maxsize; }
00140 
00150     KConfig* config() const { return _config; }
00151 
00156     Type type() const { return _type; }
00157 
00162     int actions() const { return _actions; }
00163 
00174     virtual void action( Action a );
00175 
00176 
00183     virtual Position preferedPosition() const { return Bottom; }
00184 
00188     void setPosition( Position p );
00192     void setAlignment( Alignment a );
00197     void setSize( Size size, int customSize );
00198 
00203     Size sizeSetting() const;
00204 
00209     int customSize() const;
00210 
00211 
00212 signals:
00218     void updateLayout();
00219 
00220 protected:
00221 
00229     virtual void about() {}
00230 
00238     virtual void help() {}
00239 
00247     virtual void preferences() {}
00248 
00257     virtual void reportBug() {}
00258 
00262     Position position() const { return _position; }
00263 
00267     Alignment alignment() const { return _alignment; }
00268 
00272     Orientation orientation();
00273 
00278     int sizeInPixels() const;
00279 
00285     virtual void positionChange( Position ) {};
00286 
00292     virtual void alignmentChange( Alignment ) {};
00293 
00294 
00295 private:
00296     Type                _type;
00297     Position            _position;
00298     Alignment           _alignment;
00299     KConfig*            _config;
00300     int                 _actions;
00301 protected:
00302     virtual void virtual_hook( int id, void* data );
00303 private:
00304     KPanelExtensionPrivate     *d;
00305 };
00306 
00307 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:12:01 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003