kspread
kspread_generalProperty.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 "kspread_global.h" 00025 00026 #include <KoRect.h> 00027 #include <KoUnit.h> 00028 00029 class KoGeneralPropertyUI; 00030 00031 namespace KSpread 00032 { 00033 00034 class GeneralProperty : public QWidget 00035 { 00036 Q_OBJECT 00037 public: 00038 struct GeneralValue 00039 { 00040 GeneralValue() 00041 {} 00042 QString m_name; 00043 PropValue m_keepRatio; 00044 PropValue m_protect; 00045 KoRect m_rect; 00046 }; 00047 00048 enum GeneralConfigChange 00049 { 00050 Name = 1, 00051 Protect = 2, 00052 KeepRatio = 4, 00053 Left = 8, 00054 Top = 16, 00055 Width = 32, 00056 Height = 64 00057 }; 00058 00059 GeneralProperty( QWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit ); 00060 ~GeneralProperty(); 00061 00062 int getGeneralPropertyChange() const; 00063 GeneralValue getGeneralValue() const; 00064 00065 void apply(); 00066 00067 protected: 00068 KoRect getRect() const; 00069 void setRect( KoRect &rect ); 00070 00071 KoGeneralPropertyUI *m_ui; 00072 double m_ratio; 00073 00074 GeneralValue m_generalValue; 00075 KoUnit::Unit m_unit; 00076 00077 protected slots: 00078 void slotReset(); 00079 void slotProtectToggled( bool state ); 00080 void slotKeepRatioToggled( bool state ); 00081 void slotWidthChanged( double value ); 00082 void slotHeightChanged( double value ); 00083 }; 00084 00085 } 00086 00087 #endif /* GENERALPROPERTY_H */