1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#ifndef _UMLBASEFRAGMENTCOMPARTMENT_H
#define _UMLBASEFRAGMENTCOMPARTMENT_H
// to avoid compiler warning
#include "UmlFragment.h"
#include <qvector.h>
#include <qcstring.h>
class UmlFragment;
class UmlBaseFragment;
// this class manages fragments compartments,
// a fragment without separator contains one compartment
class UmlBaseFragmentCompartment {
public:
// return the fragment owning the compartment
UmlFragment * fragment() const {
return _fragment;
}
// the rank of the compartment in the fragment (0..)
int rank() const {
return _rank;
}
// the texts placed in the compartment
const QVector<char> & texts() const {
return _texts;
}
// return the fragments contained in the compartment,
// may be none
const QVector<UmlFragment> & contained() const {
return _contained;
}
// return the continuation ('label' case), or an empty string/null
QCString startContinuation() const {
return _start_continuation;
}
// return the continuation ('goto' case), or an empty string/null
QCString endContinuation() const {
return _end_continuation;
}
private:
UmlFragment * _fragment;
QVector<UmlFragment> _contained;
int _rank;
QVector<char> _texts;
int _y;
QCString _start_continuation;
QCString _end_continuation;
public:
void add_contained_(UmlFragment * x);
void add_text_(QCString x);
//internal, do NOT use it
void add_cont_(QCString s, int cy);
int b() const {
return _y;
}
bool smaller(const UmlBaseFragmentCompartment * x) const;
private:
// internal, don't call it
void read_(UmlBaseFragment * fragment, int rank);
public:
// to avoid compiler warning, don't call it
~UmlBaseFragmentCompartment();
friend class UmlBaseFragment;
friend class UmlBaseUseCaseDiagramDefinition;
friend class UmlBaseSequenceDiagramDefinition;
};
#endif
|