kpresenter
KPrGeneralProperty.h
00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- 00002 /* This file is part of the KDE project 00003 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef GENERALPROPERTY_H 00021 #define GENERALPROPERTY_H 00022 00023 #include <qwidget.h> 00024 #include <global.h> 00025 00026 #include <KoRect.h> 00027 #include <KoUnit.h> 00028 00029 class KoGeneralPropertyUI; 00030 00031 class KPrGeneralProperty : public QWidget 00032 { 00033 Q_OBJECT 00034 public: 00035 struct GeneralValue 00036 { 00037 GeneralValue() 00038 {} 00039 QString m_name; 00040 PropValue m_keepRatio; 00041 PropValue m_protect; 00042 KoRect m_rect; 00043 }; 00044 00045 enum GeneralConfigChange 00046 { 00047 Name = 1, 00048 Protect = 2, 00049 KeepRatio = 4, 00050 Left = 8, 00051 Top = 16, 00052 Width = 32, 00053 Height = 64 00054 }; 00055 00056 KPrGeneralProperty( QWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit ); 00057 ~KPrGeneralProperty(); 00058 00059 int getGeneralPropertyChange() const; 00060 GeneralValue getGeneralValue() const; 00061 00062 void apply(); 00063 00064 protected: 00065 KoRect getRect() const; 00066 void setRect( KoRect &rect ); 00067 00068 KoGeneralPropertyUI *m_ui; 00069 double m_ratio; 00070 00071 GeneralValue m_generalValue; 00072 KoUnit::Unit m_unit; 00073 00074 protected slots: 00075 void slotReset(); 00076 void slotProtectToggled( bool state ); 00077 void slotKeepRatioToggled( bool state ); 00078 void slotWidthChanged( double value ); 00079 void slotHeightChanged( double value ); 00080 }; 00081 00082 #endif /* GENERALPROPERTY_H */