kwin Library API Documentation

ruleswidget.h

00001 /*
00002  * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00018 
00019 
00020 #ifndef __RULESWIDGET_H__
00021 #define __RULESWIDGET_H__
00022 
00023 #include <kdialogbase.h>
00024 #include <kwin.h>
00025 #include <kshortcutdialog.h>
00026 
00027 #include "ruleswidgetbase.h"
00028 #include "editshortcutbase.h"
00029 
00030 namespace KWinInternal
00031 {
00032 
00033 class Rules;
00034 class DetectDialog;
00035 
00036 class RulesWidget
00037     : public RulesWidgetBase
00038     {
00039     Q_OBJECT
00040     public:
00041         RulesWidget( QWidget* parent = NULL, const char* name = NULL );
00042         void setRules( Rules* r );
00043         Rules* rules() const;
00044         bool finalCheck();
00045         void prepareWindowSpecific( WId window );
00046     signals:
00047         void changed( bool state );
00048     protected slots:
00049         virtual void detectClicked();
00050         virtual void wmclassMatchChanged();
00051         virtual void roleMatchChanged();
00052         virtual void titleMatchChanged();
00053         virtual void extraMatchChanged();
00054         virtual void machineMatchChanged();
00055         virtual void shortcutEditClicked();
00056     private slots:
00057         // geometry tab
00058         void updateEnableposition();
00059         void updateEnablesize();
00060         void updateEnabledesktop();
00061         void updateEnablemaximizehoriz();
00062         void updateEnablemaximizevert();
00063         void updateEnableminimize();
00064         void updateEnableshade();
00065         void updateEnablefullscreen();
00066         void updateEnableplacement();
00067         // preferences tab
00068         void updateEnableabove();
00069         void updateEnablebelow();
00070         void updateEnablenoborder();
00071         void updateEnableskiptaskbar();
00072         void updateEnableskippager();
00073         void updateEnableacceptfocus();
00074         void updateEnablecloseable();
00075         void updateEnableopacityactive();
00076         void updateEnableopacityinactive();
00077         // workarounds tab
00078         void updateEnablefsplevel();
00079         void updateEnablemoveresizemode();
00080         void updateEnabletype();
00081         void updateEnableignoreposition();
00082         void updateEnableminsize();
00083         void updateEnablemaxsize();
00084         void updateEnablestrictgeometry();
00085         void updateEnableshortcut();
00086         // internal
00087         void detected( bool );
00088     private:
00089         int desktopToCombo( int d ) const;
00090         int comboToDesktop( int val ) const;
00091         void prefillUnusedValues( const KWin::WindowInfo& info );
00092         DetectDialog* detect_dlg;
00093         bool detect_dlg_ok;
00094     };
00095 
00096 class RulesDialog
00097     : public KDialogBase
00098     {
00099     Q_OBJECT
00100     public:
00101         RulesDialog( QWidget* parent = NULL, const char* name = NULL );
00102         Rules* edit( Rules* r, WId window );
00103     protected:
00104         virtual void accept();
00105     private:
00106         RulesWidget* widget;
00107         Rules* rules;
00108     };
00109 
00110 class EditShortcut
00111     : public EditShortcutBase
00112     {
00113     Q_OBJECT
00114     public:
00115         EditShortcut( QWidget* parent = NULL, const char* name = NULL );
00116     protected:
00117         void editShortcut();
00118         void clearShortcut();
00119     };
00120 
00121 class EditShortcutDialog
00122     : public KDialogBase
00123     {
00124     Q_OBJECT
00125     public:
00126         EditShortcutDialog( QWidget* parent = NULL, const char* name = NULL );
00127         void setShortcut( const QString& cut );
00128         QString shortcut() const;
00129     private:
00130         EditShortcut* widget;
00131     };
00132 
00133 // slightly duped from utils.cpp
00134 class ShortcutDialog
00135     : public KShortcutDialog
00136     {
00137     Q_OBJECT
00138     public:
00139         ShortcutDialog( const KShortcut& cut, QWidget* parent = NULL, const char* name = NULL );
00140         virtual void accept();
00141     };
00142 
00143 } // namespace
00144 
00145 #endif
KDE Logo
This file is part of the documentation for kwin Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 6 02:41:07 2005 by doxygen 1.4.0 written by Dimitri van Heesch, © 1997-2003