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.

82 lines
2.6KB

  1. /* This file is part of the KDE project
  2. Copyright (C) 2004 Laurent Montel <montel@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. * Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef KSPLOADINGINFO_H
  17. #define KSPLOADINGINFO_H
  18. #include <tqpoint.h>
  19. #include <tqstringlist.h>
  20. #include <KoPoint.h>
  21. namespace KSpread
  22. {
  23. class Sheet;
  24. /// Temporary information used only during loading
  25. class KSPLoadingInfo
  26. {
  27. public:
  28. KSPLoadingInfo() { m_loadTemplate = false;}
  29. ~KSPLoadingInfo() {}
  30. void addWordInAreaList( const TQString & word) { m_areaNamed.append( word ); }
  31. bool findWordInAreaList(const TQString & word) const { return (m_areaNamed.find( word ) != m_areaNamed.end());}
  32. void appendValidation( const TQString &name, const TQDomElement &element){ m_validationList.insert( name, element);}
  33. TQDomElement validation( const TQString &name) { return m_validationList[name];}
  34. /**
  35. * @return the cursor positions
  36. */
  37. const TQMap<Sheet*, TQPoint>& cursorPositions() const { return m_cursorPositions; }
  38. /**
  39. * Stores the cursor position @p point for @p sheet .
  40. */
  41. void setCursorPosition( Sheet* sheet, const TQPoint& point ) { m_cursorPositions.insert( sheet, point );}
  42. /**
  43. * @return scrolling offsets
  44. */
  45. const TQMap<Sheet*, KoPoint>& scrollingOffsets() const { return m_scrollingOffsets; }
  46. /**
  47. * Stores the scrolling offset @p point for @p sheet .
  48. */
  49. void setScrollingOffset( Sheet* sheet, const KoPoint& point ) { m_scrollingOffsets.insert( sheet, point );}
  50. void setLoadTemplate( bool _b ) {
  51. m_loadTemplate = _b;
  52. }
  53. bool loadTemplate() const {
  54. return m_loadTemplate;
  55. }
  56. private:
  57. TQStringList m_areaNamed;
  58. TQMap<TQString,TQDomElement> m_validationList;
  59. TQMap<Sheet*, TQPoint> m_cursorPositions;
  60. TQMap<Sheet*, KoPoint> m_scrollingOffsets;
  61. bool m_loadTemplate;
  62. };
  63. } // namespace KSpread
  64. #endif /* KPRLOADINGINFO_H */