filters
workbook.h
00001 /* Swinder - Portable library for spreadsheet 00002 Copyright (C) 2003-2005 Ariya Hidayat <ariya@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA 00018 */ 00019 00020 #ifndef SWINDER_WORKBOOK_H 00021 #define SWINDER_WORKBOOK_H 00022 00023 namespace Swinder 00024 { 00025 00026 class Sheet; 00027 00028 class Workbook 00029 { 00030 public: 00031 00032 /* 00033 * Constructs a new workbook. 00034 */ 00035 00036 Workbook(); 00037 00038 /* 00039 * Destroys the workbook. 00040 */ 00041 00042 virtual ~Workbook(); 00043 00044 /* 00045 * Clears the workbook, i.e. makes it as if it is just constructed. 00046 */ 00047 void clear(); 00048 00049 /* 00050 * Loads the workbook from file. Returns false if error occurred. 00051 */ 00052 bool load( const char* filename ); 00053 00054 /* 00055 * Appends a new sheet. 00056 */ 00057 void appendSheet( Sheet* sheet ); 00058 00059 /* 00060 * Returns the number of worksheet in this workbook. A newly created 00061 * workbook has no sheet, i.e. sheetCount() returns 0. 00062 */ 00063 unsigned sheetCount() const; 00064 00065 /* 00066 * Returns a worksheet at given index. If index is invalid (e.g. larger 00067 * than total number of worksheet), this function returns NULL. 00068 */ 00069 Sheet* sheet( unsigned index ); 00070 00071 /* 00072 * Returns true if automatic calculation is enabled. 00073 */ 00074 bool autoCalc() const; 00075 00076 /* 00077 * Sets the automatic calculation. 00078 */ 00079 void setAutoCalc( bool a ); 00080 00081 00082 bool isPasswordProtected() const; 00083 void setPasswordProtected( bool p ); 00084 00085 private: 00086 // no copy or assign 00087 Workbook( const Workbook& ); 00088 Workbook& operator=( const Workbook& ); 00089 00090 class Private; 00091 Private* d; 00092 }; 00093 00094 } 00095 00096 00097 #endif // SWINDER_WORKBOOK_H