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. TQ_OBJECT
  30. public:
  31. struct GeneralValue
  32. {
  33. GeneralValue()
  34. {}
  35. TQString m_name;
  36. PropValue m_keepRatio;
  37. PropValue m_protect;
  38. KoRect m_rect;
  39. };
  40. enum GeneralConfigChange
  41. {
  42. Name = 1,
  43. Protect = 2,
  44. KeepRatio = 4,
  45. Left = 8,
  46. Top = 16,
  47. Width = 32,
  48. Height = 64
  49. };
  50. GeneralProperty( TQWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit );
  51. ~GeneralProperty();
  52. int getGeneralPropertyChange() const;
  53. GeneralValue getGeneralValue() const;
  54. void apply();
  55. protected:
  56. KoRect getRect() const;
  57. void setRect( KoRect &rect );
  58. KoGeneralPropertyUI *m_ui;
  59. double m_ratio;
  60. GeneralValue m_generalValue;
  61. KoUnit::Unit m_unit;
  62. protected slots:
  63. void slotReset();
  64. void slotProtectToggled( bool state );
  65. void slotKeepRatioToggled( bool state );
  66. void slotWidthChanged( double value );
  67. void slotHeightChanged( double value );
  68. };
  69. }
  70. #endif /* GENERALPROPERTY_H */