• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kig

cabri-utils.h

Go to the documentation of this file.
00001 // This file is part of Kig, a KDE program for Interactive Geometry...
00002 // Copyright (C)  2002  Dominique Devriese <devriese@kde.org>
00003 // Copyright (C)  2006  Pino Toscano       <toscano.pino@tiscali.it>
00004 
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 // This program 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
00013 // GNU General Public License for more details.
00014 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 
00020 #ifndef KIG_FILTERS_CABRI_UTILS_H
00021 #define KIG_FILTERS_CABRI_UTILS_H
00022 
00023 #undef CABRI_DEBUG
00024 
00025 #include <qbytearray.h>
00026 #include <qcolor.h>
00027 
00028 #include "../misc/rect.h"
00029 
00030 #include <map>
00031 #include <vector>
00032 
00033 class QFile;
00034 class KigFilterCabri;
00035 
00036 namespace CabriNS
00037 {
00041   enum CabriVersion
00042   {
00043     CV_1_0,
00044     CV_1_2
00045   };
00046 
00047   enum CabriGonio
00048   {
00049     CG_Deg,
00050     CG_Rad
00051     // TODO
00052   };
00053 
00057   QString readLine( QFile& file );
00058 
00059   QString readText( QFile& f, const QString& s, const QString& sep = QString( "\n" ) );
00060 }
00061 
00068 class CabriObject
00069 {
00070 public:
00071   CabriObject();
00072 
00073   uint id;
00074   QByteArray type;
00075   int specification;
00076   QColor color;
00077   QColor fillColor;
00078   int thick;
00079   int lineSegLength;
00080   int lineSegSplit;
00081 //  int specialAppearanceSwitch;
00082   bool visible;
00083   int intersectionId;
00084   int ticks;
00085   int side;
00086 //  bool fixed;
00087   std::vector<int> parents;
00088   std::vector<double> data;
00089   QString name;
00090   QString text;
00091   Rect textRect;
00092   std::vector<int> incs;
00093   CabriNS::CabriGonio gonio;
00094 };
00095 
00096 class CabriObject_v10
00097   : public CabriObject
00098 {
00099 public:
00100   CabriObject_v10();
00101 
00102   int specialAppearanceSwitch;
00103   bool fixed;
00104 };
00105 
00106 class CabriObject_v12
00107   : public CabriObject
00108 {
00109 public:
00110   CabriObject_v12();
00111 
00112   int pointStyle;
00113 };
00114 
00115 
00120 class CabriReader
00121 {
00122 protected:
00123   const KigFilterCabri* m_filter;
00124 
00125   CabriReader( const KigFilterCabri* filter );
00126 
00127   static void initColorMap();
00128 
00129 public:
00130   virtual ~CabriReader();
00131 
00135   static QColor translateColor( const QString& s );
00136 
00137   virtual bool readWindowMetrics( QFile& f ) = 0;
00138   virtual CabriObject* readObject( QFile& f ) = 0;
00139   virtual void decodeStyle( CabriObject* obj, Qt::PenStyle& ps, int& pointType ) = 0;
00140 };
00141 
00142 class CabriReader_v10
00143   : public CabriReader
00144 {
00145 public:
00146   CabriReader_v10( const KigFilterCabri* filter );
00147   virtual ~CabriReader_v10();
00148 
00149   virtual bool readWindowMetrics( QFile& f );
00150   virtual CabriObject* readObject( QFile& f );
00151   virtual void decodeStyle( CabriObject* obj, Qt::PenStyle& ps, int& pointType );
00152 };
00153 
00154 class CabriReader_v12
00155   : public CabriReader
00156 {
00157 private:
00158   static void initColorMap();
00159   bool readStyles( const QString& file, const QString& s, CabriObject_v12* myobj );
00160 
00161 public:
00162   CabriReader_v12( const KigFilterCabri* filter );
00163   virtual ~CabriReader_v12();
00164 
00165   static QColor translateColor( const QString& s );
00166 
00167   virtual bool readWindowMetrics( QFile& f );
00168   virtual CabriObject* readObject( QFile& f );
00169   virtual void decodeStyle( CabriObject* obj, Qt::PenStyle& ps, int& pointType );
00170 };
00171 
00172 #endif

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal