src/versit/qversitdocument.h
changeset 5 603d3f8b6302
parent 0 876b1a06bc25
equal deleted inserted replaced
3:e4ebb16b39ea 5:603d3f8b6302
    61 class Q_VERSIT_EXPORT QVersitDocument
    61 class Q_VERSIT_EXPORT QVersitDocument
    62 {
    62 {
    63 public:
    63 public:
    64     enum VersitType {
    64     enum VersitType {
    65         InvalidType,
    65         InvalidType,
    66         VCard21Type,   // vCard version 2.1
    66         VCard21Type,    // vCard version 2.1
    67         VCard30Type    // vCard version 3.0 (RFC 2426)
    67         VCard30Type,    // vCard version 3.0 (RFC 2426)
       
    68         ICalendar20Type,// iCalendar version 2.0 (RFC 2445)
       
    69         VCard40Type,    // vCard version 4.0
    68     };
    70     };
    69 
    71 
    70     QVersitDocument();
    72     QVersitDocument();
    71     QVersitDocument(const QVersitDocument& other);
    73     QVersitDocument(const QVersitDocument& other);
    72     QVersitDocument(VersitType type);
    74     QVersitDocument(VersitType type);
    74 
    76 
    75     QVersitDocument& operator=(const QVersitDocument& other);
    77     QVersitDocument& operator=(const QVersitDocument& other);
    76     bool operator==(const QVersitDocument& other) const;
    78     bool operator==(const QVersitDocument& other) const;
    77     bool operator!=(const QVersitDocument& other) const;
    79     bool operator!=(const QVersitDocument& other) const;
    78 
    80 
    79     // metadata about the versit document itself.
    81     // Metadata about the versit document
       
    82     // The type determines the format for serialization
    80     void setType(VersitType type);
    83     void setType(VersitType type);
    81     VersitType type() const;
    84     VersitType type() const;
    82 
    85 
       
    86     // The componentType is the value of the BEGIN property
       
    87     void setComponentType(QString componentType);
       
    88     QString componentType() const;
       
    89 
       
    90     // The content
    83     void addProperty(const QVersitProperty& property);
    91     void addProperty(const QVersitProperty& property);
    84     void removeProperty(const QVersitProperty& property);
    92     void removeProperty(const QVersitProperty& property);
    85     void removeProperties(const QString& name);
    93     void removeProperties(const QString& name);
    86     QList<QVersitProperty> properties() const;
    94     QList<QVersitProperty> properties() const;
       
    95 
       
    96     void addSubDocument(const QVersitDocument& subdocument);
       
    97     void setSubDocuments(const QList<QVersitDocument>& documents);
       
    98     QList<QVersitDocument> subDocuments() const;
    87 
    99 
    88     bool isEmpty() const;
   100     bool isEmpty() const;
    89     void clear();
   101     void clear();
    90 
   102 
    91 private:
   103 private: