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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
|
#ifndef _UMLBASEPACKAGE_H
#define _UMLBASEPACKAGE_H
#include "UmlItem.h"
#include "anItemKind.h"
#include <qcstring.h>
class UmlPackage;
class UmlDiagram;
// Manage the packages
class UmlBasePackage : public UmlItem {
public:
// returns a new package named 'name' created under 'parent'
//
// In case it cannot be created (the name is already used or
// invalid, 'parent' cannot contain it etc ...) return 0 in C++
// and produce a RuntimeException in Java
static UmlPackage * create(UmlPackage * parent, const char * name);
// returns the kind of the item
virtual anItemKind kind();
// returns the optional associated diagram
UmlDiagram * associatedDiagram();
// sets the associated diagram, arg may be null to unset it
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_AssociatedDiagram(UmlDiagram * d);
// Import a project in the current package
// fn is the pathname of the .prj file of the project to import
// or an empty string (the project will be set through a dialog)
// Return the new UmlPackage containing the imported project, or
// 0/null on error
UmlPackage * importProject(const QCString & fn);
#ifdef WITHCPP
// returns the path where the C++ source files are generated by the
// c++ generator.
const QCString & cppSrcDir();
// to set the path where the C++ source files are generated by the
// C++ generator, may be relative even the 'root' path is not
// (already) an absolute path
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_CppSrcDir(const QCString & s);
// returns the path where the C++ header files are generated by the
// C++ generator.
const QCString & cppHDir();
// to set the path where the C++ header files are generated by the
// C++ generator, may be relative even the 'root' path is not
// (already) an absolute path
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_CppHDir(const QCString & s);
//returns the namespace name associed to the package
QCString cppNamespace();
//to set the namespace name associed to the package.
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_CppNamespace(const QCString & s);
// returns a sub package of the current one having the c++ namespace 'n'
// (including the current one), else 0/null
UmlPackage * findCppNamespace(const QCString & n) const;
#endif
#ifdef WITHJAVA
// returns the path where the JAVA files are generated by the
// JAVA generator.
const QCString & javaDir();
// to set the path where the JAVA files are generated by the
// JAVA generator, may be relative even the 'root' path is not
// (already) an absolute path
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_JavaDir(const QCString & s);
//returns the java package name associed to the package
QCString javaPackage();
// to set the java package name associed to the package.
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_JavaPackage(const QCString & s);
// returns a sub package of the current one having the Java package 'n'
// (including the current one), else 0/null
UmlPackage * findJavaPackage(const QCString & n) const;
#endif
#ifdef WITHPHP
// returns the path where the PHP files are generated by the
// PHP generator.
const QCString & phpDir();
// to set the path where the PHP files are generated by the
// PHP generator, may be relative even the 'root' path is not
// (already) an absolute path
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_PhpDir(const QCString & s);
#endif
#ifdef WITHPYTHON
// returns the path where the PYTHON files are generated by the
// PYTHON generator.
const QCString & pythonDir();
// to set the path where the PYTHON files are generated by the
// PYTHON generator, may be relative even the 'root' path is not
// (already) an absolute path
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_PythonDir(const QCString & s);
//returns the python package name associed to the package
QCString pythonPackage();
// to set the python package name associed to the package.
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_PythonPackage(const QCString & s);
// returns a sub package of the current one having the Python package 'n'
// (including the current one), else 0/null
UmlPackage * findPythonPackage(const QCString & n) const;
#endif
#ifdef WITHIDL
// returns the path where the IDL files are generated by the
// IDL generator.
const QCString & idlDir();
// to set the path where the IDL files are generated by the
// IDL generator, may be relative even the 'root' path is not
// (already) an absolute path
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_IdlDir(const QCString & s);
//returns the module name associed to the package
QCString idlModule();
// to set the module name associed to the package.
//
// On error return FALSE in C++, produce a RuntimeException in Java
bool set_IdlModule(const QCString & s);
// returns a sub package of the current one having the IDL module 'n'
// (including the current one), else 0/null
UmlPackage * findIdlModule(const QCString & n) const;
#endif
// Returns the project
static UmlBasePackage * getProject();
//return TRUE in case something is modified (i.e. the project must be saved)
static bool isProjectModified();
//save the project if needed
static void saveProject();
//Does nothing in case an edition is on going under BOUML. Else :
//close the current project (in case it is not saved the last modifications are lost),
//load the specified one, and all the communications with the plug-outs including the
//current one are closed.
static void loadProject(QCString p);
// Force consistency concerning the profiles and their stereotypes
static void updateProfiles();
// to unload the object to free memory, it will be reloaded automatically
// if needed. Recursively done for the sub items if 'rec' is TRUE.
//
// if 'del' is true the sub items are deleted in C++, and removed from the
// internal dictionnary in C++ and Java (to allow it to be garbaged),
// you will have to call Children() to re-access to them
virtual void unload(bool rec = FALSE, bool del = FALSE);
private:
UmlDiagram * _assoc_diagram;
#ifdef WITHCPP
QCString _cpp_src_dir;
QCString _cpp_h_dir;
QCString _cpp_namespace;
#endif
#ifdef WITHJAVA
QCString _java_dir;
QCString _java_package;
#endif
#ifdef WITHPHP
QCString _php_dir;
#endif
#ifdef WITHPYTHON
QCString _python_dir;
QCString _python_package;
#endif
#ifdef WITHIDL
QCString _idl_dir;
QCString _idl_module;
#endif
protected:
//internal, do NOT use it
virtual void read_uml_();
#ifdef WITHCPP
//internal, do NOT use it
virtual void read_cpp_();
#endif
#ifdef WITHJAVA
//internal, do NOT use it
virtual void read_java_();
#endif
#ifdef WITHPHP
//internal, do NOT use it
virtual void read_php_();
#endif
#ifdef WITHPYTHON
//internal, do NOT use it
virtual void read_python_();
#endif
#ifdef WITHIDL
//internal, do NOT use it
virtual void read_idl_();
#endif
// the constructor, do not call it yourself !!!!!!!!!!
UmlBasePackage(void * id, const QCString & n);
};
inline UmlBasePackage::UmlBasePackage(void * id, const QCString & n) : UmlItem(id, n) {
_assoc_diagram = 0;
}
#endif
|