KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.2KB

  1. // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
  2. /* This file is part of the KDE project
  3. Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. * Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef GENERALPROPERTY_H
  18. #define GENERALPROPERTY_H
  19. #include <tqwidget.h>
  20. #include "kspread_global.h"
  21. #include <KoRect.h>
  22. #include <KoUnit.h>
  23. class KoGeneralPropertyUI;
  24. namespace KSpread
  25. {
  26. class GeneralProperty : public TQWidget
  27. {
  28. Q_OBJECT
  29. public:
  30. struct GeneralValue
  31. {
  32. GeneralValue()
  33. {}
  34. TQString m_name;
  35. PropValue m_keepRatio;
  36. PropValue m_protect;
  37. KoRect m_rect;
  38. };
  39. enum GeneralConfigChange
  40. {
  41. Name = 1,
  42. Protect = 2,
  43. KeepRatio = 4,
  44. Left = 8,
  45. Top = 16,
  46. Width = 32,
  47. Height = 64
  48. };
  49. GeneralProperty( TQWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit );
  50. ~GeneralProperty();
  51. int getGeneralPropertyChange() const;
  52. GeneralValue getGeneralValue() const;
  53. void apply();
  54. protected:
  55. KoRect getRect() const;
  56. void setRect( KoRect &rect );
  57. KoGeneralPropertyUI *m_ui;
  58. double m_ratio;
  59. GeneralValue m_generalValue;
  60. KoUnit::Unit m_unit;
  61. protected slots:
  62. void slotReset();
  63. void slotProtectToggled( bool state );
  64. void slotKeepRatioToggled( bool state );
  65. void slotWidthChanged( double value );
  66. void slotHeightChanged( double value );
  67. };
  68. }
  69. #endif /* GENERALPROPERTY_H */