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 KConfig;
00028 class KPanelExtensionPrivate;
00029 
00030 #include <qframe.h>
00031 
00096 class KPanelExtension : public QFrame
00097 {
00098     Q_OBJECT
00099 
00100 public:
00101 
00103     enum Type { Normal = 0, Stretch };
00104     enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00105     enum Position { Left = 0, Right, Top, Bottom };
00106     enum Alignment { LeftTop = 0, Center, RightBottom };
00108     enum Size { SizeTiny = 0, SizeSmall, SizeNormal, SizeLarge, SizeCustom };
00109 
00119     KPanelExtension(const QString& configFile, Type t = Normal,
00120          int actions = 0, QWidget *parent = 0, const char *name = 0);
00121 
00125     ~KPanelExtension();
00126 
00136     virtual QSize sizeHint(Position /*p*/, QSize maxsize) const { return maxsize; }
00137 
00147     KConfig* config() const { return _config; }
00148 
00153     Type type() const { return _type; }
00154 
00159     int actions() const { return _actions; }
00160 
00171     virtual void action( Action a );
00172 
00173 
00180     virtual Position preferedPosition() const { return Bottom; }
00181 
00185     void setPosition( Position p );
00189     void setAlignment( Alignment a );
00194     void setSize( Size size, int customSize );
00195 
00200     Size sizeSetting() const;
00201 
00206     int customSize() const;
00207 
00208 
00209 signals:
00215     void updateLayout();
00216 
00217 protected:
00218 
00226     virtual void about() {}
00227 
00235     virtual void help() {}
00236 
00244     virtual void preferences() {}
00245 
00254     virtual void reportBug() {}
00255 
00259     Position position() const { return _position; }
00260 
00264     Alignment alignment() const { return _alignment; }
00265 
00269     Orientation orientation();
00270 
00275     int sizeInPixels() const;
00276 
00282     virtual void positionChange( Position ) {};
00283 
00289     virtual void alignmentChange( Alignment ) {};
00290 
00291 private:
00292     Type                _type;
00293     Position            _position;
00294     Alignment           _alignment;
00295     KConfig*            _config;
00296     int                 _actions;
00297 protected:
00298     virtual void virtual_hook( int id, void* data );
00299 private:
00300     KPanelExtensionPrivate     *d;
00301 };
00302 
00303 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:00 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001