home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoZoomMode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  1.7 KB  |  55 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2005 Johannes Schaub <litb_devel@web.de>
  3.  
  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.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.  * Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef _KOZOOMMODE_H_
  21. #define _KOZOOMMODE_H_
  22.  
  23. #include <qstring.h>
  24. #include "koffice_export.h"
  25.  
  26. /**
  27.  * The ZoomMode container
  28.  */
  29. class KOFFICEUI_EXPORT KoZoomMode
  30. {
  31. public:
  32.     enum Mode
  33.     {
  34.         ZOOM_WIDTH    = 0,  ///< zoom pagewidth
  35.         ZOOM_PAGE     = 1,  ///< zoom to pagesize
  36.         ZOOM_CONSTANT = 2   ///< zoom x %
  37.     };
  38.     
  39.     /// \param mode the mode name
  40.     /// \return the to Mode converted QString \c mode
  41.     static Mode toMode(const QString& mode);
  42.     
  43.     /// \return the to QString converted and translated Mode \c mode
  44.     static QString toString(Mode mode);
  45.     
  46.     /// \param mode the mode name
  47.     /// \return true if \c mode isn't dependent on windowsize
  48.     static bool isConstant(const QString& mode)
  49.     { return toMode(mode) == ZOOM_CONSTANT; }
  50. private:
  51.     static const char * modes[];
  52. };
  53.  
  54. #endif
  55.