F:/KPlato/koffice/kplato/kptwbsdefinition.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 Dag Andersen <danders@get2net.dk>
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;
00007    version 2 of the License.
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 KPTWBSDEFINITION_H
00021 #define KPTWBSDEFINITION_H
00022 
00023 #include <QString>
00024 #include <QMap>
00025 #include <QPair>
00026 #include <QList>
00027 
00028 class QStringList;
00029 
00030 namespace KPlato
00031 {
00032 
00033 class Part;
00034 
00035 class WBSDefinition {
00036 
00037 public:
00038     WBSDefinition();
00039     ~WBSDefinition();
00040 
00041     class CodeDef {
00042         public:
00043             CodeDef() {}
00044             CodeDef(QString c, QString s) { code = c; separator = s; }
00045             ~CodeDef() {}
00046             void clear() { code = separator = QString(); }
00047             bool isEmpty() { return code.isEmpty(); }
00048             QString code;
00049             QString separator;
00050     };
00051     
00052     void clear();
00053     
00055     QString wbs(uint index, int level);
00057     QString code(uint index, int level);
00059     QString separator(int level);
00060     
00061     CodeDef &defaultDef() { return m_defaultDef; }
00062     void setDefaultDef(CodeDef def) { m_defaultDef = def; }
00063     
00064     bool isLevelsDefEnabled() const { return m_levelsEnabled; }
00065     bool level0Enabled();
00066     void setLevelsDefEnabled(bool on) { m_levelsEnabled = on; }
00067     void clearLevelsDef() { m_levelsDef.clear(); }
00068     const QMap<int, CodeDef> &levelsDef() const { return m_levelsDef; }
00069     void setLevelsDef(QMap<int, CodeDef> def);
00070     CodeDef levelsDef(int level) const;
00071     void setLevelsDef(int level, CodeDef def);
00072     void setLevelsDef(int level, QString c, QString s);
00073     
00074     QStringList codeList();
00075     int defaultCodeIndex() const;
00076     bool setDefaultCode(uint index);
00077     QString defaultSeparator() const { return m_defaultDef.separator; }
00078     void setDefaultSeparator(QString s);
00079 
00080 protected:
00081     QString code(CodeDef &def, uint index);
00082     QString toRoman(int n, bool upper = false);
00083     
00084 private:
00085     CodeDef m_defaultDef;
00086     
00087     bool m_levelsEnabled;
00088     QMap<int, CodeDef> m_levelsDef;
00089 
00090     QList<QPair<QString, QString> > m_codeLists;
00091 };
00092 
00093 } //namespace KPlato
00094 
00095 #endif //WBSDEFINITION_H

Généré le Wed Nov 22 23:40:58 2006 pour KPlato par  doxygen 1.5.1-p1