kpilot
pilotDOCEntry.h
Go to the documentation of this file.00001 /* pilotDOCEntry.h -*- C++ -*- KPilot 00002 ** 00003 ** Copyright (C) 2002 by Reinhold Kainhofer 00004 ** 00005 ** See the .cc file for an explanation of what this file is for. 00006 */ 00007 00008 /* 00009 ** This program is free software; you can redistribute it and/or modify 00010 ** it under the terms of the GNU General Public License as published by 00011 ** the Free Software Foundation; either version 2 of the License, or 00012 ** (at your option) any later version. 00013 ** 00014 ** This program is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 ** GNU General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU General Public License 00020 ** along with this program in a file called COPYING; if not, write to 00021 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00022 ** MA 02110-1301, USA. 00023 */ 00024 00025 /* 00026 ** Bug reports and questions can be sent to the mailinlist kde-pim@kde.org 00027 */ 00028 #ifndef _KPILOT_PILOTDOCENTRY_H 00029 #define _KPILOT_PILOTDOCENTRY_H 00030 00031 #include <pilotRecord.h> 00032 #include "makedoc9.h" 00033 00034 00035 class PilotRecord; 00036 00037 00038 class PilotDOCEntry:public PilotRecordBase { 00039 private: 00040 bool compress; 00041 tBuf fText; 00042 public: 00043 static const int TEXT_SIZE; 00044 PilotDOCEntry(); 00045 PilotDOCEntry(PilotRecord * rec, bool compressed = false); 00046 PilotDOCEntry(const PilotDOCEntry & e); 00047 ~PilotDOCEntry() {}; 00048 PilotDOCEntry & operator=(const PilotDOCEntry & e); 00049 00050 00051 QString getText() { 00052 fText.Decompress(); 00053 return QString::fromLatin1((const char *) fText.text()); 00054 }; 00055 void setText(QString newtext, bool compressed = false) { 00056 fText.setText((const unsigned char *) newtext.latin1(), 00057 newtext.length(), compressed); 00058 }; 00059 00060 bool getCompress() const { 00061 return compress; 00062 } 00063 void setCompress(bool compressed) { 00064 compress = compressed; 00065 }; 00066 00067 PilotRecord *pack(); // Not const because it can change the compression 00068 }; 00069 00070 00071 00072 #endif 00073