~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to filters/kspread/opencalc/opencalcimport.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
   You should have received a copy of the GNU Library General Public License
16
16
   along with this library; see the file COPYING.LIB.  If not, write to
17
 
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
 
   Boston, MA 02111-1307, USA.
 
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
 * Boston, MA 02110-1301, USA.
19
19
*/
20
20
 
21
21
#ifndef OpenCalc_IMPORT_H__
22
22
#define OpenCalc_IMPORT_H__
23
23
 
24
 
#include <koFilter.h>
 
24
#include <KoFilter.h>
25
25
#include "kspread_format.h"
26
26
 
27
27
#include <qdict.h>
28
28
#include <qdom.h>
29
29
 
30
 
class KSpreadCell;
31
 
class KSpreadDoc;
32
 
class KSpreadSheet;
33
 
class KSpreadValidity;
34
30
class KoStyleStack;
35
 
class KSpreadConditional;
36
31
class KoStore;
37
32
 
 
33
namespace KSpread
 
34
{
 
35
class Cell;
 
36
class Conditional;
 
37
class Doc;
 
38
class Sheet;
 
39
class Validity;
 
40
}
 
41
 
38
42
class OpenCalcImport : public KoFilter
39
43
{
40
44
  Q_OBJECT
61
65
 
62
66
  enum bPos { Left, Top, Right, Bottom, Fall, GoUp, Border };
63
67
 
64
 
  KSpreadDoc *    m_doc;
65
 
  KSpreadFormat * m_defaultLayout;
 
68
  KSpread::Doc *    m_doc;
 
69
  KSpread::Format * m_defaultLayout;
66
70
 
67
71
  QDomDocument    m_content;
68
72
  QDomDocument    m_meta;
69
73
  QDomDocument    m_settings;
70
74
 
71
75
  QDict<QDomElement>   m_styles;
72
 
  QDict<KSpreadFormat> m_defaultStyles;
 
76
  QDict<KSpread::Format> m_defaultStyles;
73
77
  QDict<QString>       m_formats;
74
78
  QMap<QString,QDomElement> m_validationList;
75
79
 
80
84
  void insertStyles( QDomElement const & element );
81
85
  bool createStyleMap( QDomDocument const & styles );
82
86
  bool readRowFormat( QDomElement & rowNode, QDomElement * rowStyle,
83
 
                      KSpreadSheet * table, int & row, int & number, bool last );
84
 
  bool readColLayouts( QDomElement & content, KSpreadSheet * table );
85
 
  bool readRowsAndCells( QDomElement & content, KSpreadSheet * table );
86
 
  bool readCells( QDomElement & rowNode, KSpreadSheet  * table, int row, int & columns );
 
87
                      KSpread::Sheet * table, int & row, int & number, bool last );
 
88
  bool readColLayouts( QDomElement & content, KSpread::Sheet * table );
 
89
  bool readRowsAndCells( QDomElement & content, KSpread::Sheet * table );
 
90
  bool readCells( QDomElement & rowNode, KSpread::Sheet  * table, int row, int & columns );
87
91
  void convertFormula( QString & text, QString const & f ) const;
88
 
  void loadFontStyle( KSpreadFormat * layout, QDomElement const * font ) const;
89
 
  void readInStyle( KSpreadFormat * layout, QDomElement const & style );
90
 
  void loadStyleProperties( KSpreadFormat * layout, QDomElement const & property ) const;
91
 
  void loadBorder( KSpreadFormat * layout, QString const & borderDef, bPos pos ) const;
92
 
  void loadTableMasterStyle( KSpreadSheet * table, QString const & stylename );
 
92
  void loadFontStyle( KSpread::Format * layout, QDomElement const * font ) const;
 
93
  void readInStyle( KSpread::Format * layout, QDomElement const & style );
 
94
  void loadStyleProperties( KSpread::Format * layout, QDomElement const & property ) const;
 
95
  void loadBorder( KSpread::Format * layout, QString const & borderDef, bPos pos ) const;
 
96
  void loadTableMasterStyle( KSpread::Sheet * table, QString const & stylename );
93
97
  QString * loadFormat( QDomElement * element,
94
 
                        FormatType & formatType,
 
98
                        KSpread::FormatType & formatType,
95
99
                        QString name );
96
100
  void checkForNamedAreas( QString & formula ) const;
97
101
  void loadOasisCellValidation( const QDomElement&body );
98
 
  void loadOasisValidation( KSpreadValidity* val, const QString& validationName );
99
 
  void loadOasisValidationCondition( KSpreadValidity* val,QString &valExpression );
 
102
  void loadOasisValidation( KSpread::Validity* val, const QString& validationName );
 
103
  void loadOasisValidationCondition( KSpread::Validity* val,QString &valExpression );
100
104
  void loadOasisAreaName( const QDomElement&body );
101
 
  void loadOasisMasterLayoutPage( KSpreadSheet * table,KoStyleStack &styleStack );
102
 
    void loadOasisValidationValue( KSpreadValidity* val, const QStringList &listVal );
 
105
  void loadOasisMasterLayoutPage( KSpread::Sheet * table,KoStyleStack &styleStack );
 
106
  void loadOasisValidationValue( KSpread::Validity* val, const QStringList &listVal );
103
107
    QString translatePar( QString & par ) const;
104
 
    void loadCondition( KSpreadCell *cell,const QDomElement &property );
105
 
    void loadOasisCondition(KSpreadCell *cell,const QDomElement &property );
106
 
    void loadOasisConditionValue( const QString &styleCondition, KSpreadConditional &newCondition );
107
 
    void loadOasisCondition( QString &valExpression, KSpreadConditional &newCondition );
108
 
    void loadOasisValidationValue( const QStringList &listVal, KSpreadConditional &newCondition );
 
108
    void loadCondition( KSpread::Cell*cell,const QDomElement &property );
 
109
    void loadOasisCondition(KSpread::Cell*cell,const QDomElement &property );
 
110
    void loadOasisConditionValue( const QString &styleCondition, KSpread::Conditional &newCondition );
 
111
    void loadOasisCondition( QString &valExpression, KSpread::Conditional &newCondition );
 
112
    void loadOasisValidationValue( const QStringList &listVal, KSpread::Conditional &newCondition );
109
113
    KoFilter::ConversionStatus loadAndParse( QDomDocument& doc, const QString& fileName,KoStore *m_store );
110
114
 
111
115
  KoFilter::ConversionStatus openFile();