diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/files.cmake b/BlueBerry/Bundles/org.blueberry.core.runtime/files.cmake index 74b176feee..db3f12cd95 100644 --- a/BlueBerry/Bundles/org.blueberry.core.runtime/files.cmake +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/files.cmake @@ -1,31 +1,33 @@ set(MOC_H_FILES src/internal/berryPluginActivator.h src/internal/berryPreferencesService.h ) set(SRC_CPP_FILES berryIAdaptable.cpp berryIAdapterManager.cpp + berryIPreferences.cpp + berryIBerryPreferences.cpp berryIPreferencesService.cpp berryPlatformObject.cpp berryRuntime.cpp berryBackingStoreException.cpp ) set(INTERNAL_CPP_FILES berryAbstractPreferencesStorage.cpp berryPluginActivator.cpp berryPreferences.cpp berryPreferencesService.cpp berryXMLPreferencesStorage.cpp ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.cpp b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.cpp new file mode 100644 index 0000000000..c583e5ba6d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIBerryPreferences.h" + +namespace berry { + +IBerryPreferences::~IBerryPreferences () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.h b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.h index 7456fbe6d4..cc47b94504 100644 --- a/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.h +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIBerryPreferences.h @@ -1,33 +1,35 @@ #ifndef BERRYIBERRYPREFERENCES_H_ #define BERRYIBERRYPREFERENCES_H_ #include #include "berryIPreferences.h" #include "berryMessage.h" #include #include #include namespace berry { /// /// Like IEclipsePreferences an extension to the osgi-IPreferences /// to send out events when nodes or values changed in a node. /// struct BERRY_RUNTIME IBerryPreferences : virtual public IPreferences { berryInterfaceMacro(IBerryPreferences, berry) + virtual ~IBerryPreferences(); + /// /// Invoked when this node was changed, that is when a property /// was changed or when a new child node was inserted. /// berry::Message1 OnChanged; }; } // namespace berry #endif /*BERRYIBERRYPREFERENCES_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.cpp b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.cpp new file mode 100644 index 0000000000..20fd094fe7 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPreferences.h" + +namespace berry { + +IPreferences::~IPreferences () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.h b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.h index 03d3b32c9b..2b2da2cedc 100644 --- a/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.h +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/src/berryIPreferences.h @@ -1,704 +1,706 @@ #ifndef BERRYIPREFERENCES_H_ #define BERRYIPREFERENCES_H_ #include #include "berryObject.h" #include "berryBackingStoreException.h" #include #include #include namespace berry { /** * A node in a hierarchical collection of preference data. * *

* This interface allows applications to store and retrieve user and system * preference data. This data is stored persistently in an * implementation-dependent backing store. Typical implementations include flat * files, OS-specific registries, directory servers and SQL databases. * *

* For each bundle, there is a separate tree of nodes for each user, and one for * system preferences. The precise description of "user" and "system" will vary * from one bundle to another. Typical information stored in the user preference * tree might include font choice, and color choice for a bundle which interacts * with the user via a servlet. Typical information stored in the system * preference tree might include installation data, or things like high score * information for a game program. * *

* Nodes in a preference tree are named in a similar fashion to directories in a * hierarchical file system. Every node in a preference tree has a node name * (which is not necessarily unique), a unique absolute path name , * and a path name relative to each ancestor including itself. * *

* The root node has a node name of the empty std::string object (""). * Every other node has an arbitrary node name, specified at the time it is * created. The only restrictions on this name are that it cannot be the empty * string, and it cannot contain the slash character ('/'). * *

* The root node has an absolute path name of "/". Children of the * root node have absolute path names of "/" + <node name> * . All other nodes have absolute path names of <parent's absolute * path name> + "/" + <node name> . Note that * all absolute path names begin with the slash character. * *

* A node n 's path name relative to its ancestor a is simply the * string that must be appended to a 's absolute path name in order to * form n 's absolute path name, with the initial slash character (if * present) removed. Note that: *

    *
  • No relative path names begin with the slash character. *
  • Every node's path name relative to itself is the empty string. *
  • Every node's path name relative to its parent is its node name (except * for the root node, which does not have a parent). *
  • Every node's path name relative to the root is its absolute path name * with the initial slash character removed. *
* *

* Note finally that: *

    *
  • No path name contains multiple consecutive slash characters. *
  • No path name with the exception of the root's absolute path name end in * the slash character. *
  • Any string that conforms to these two rules is a valid path name. *
* *

* Each Preference node has zero or more properties associated with * it, where a property consists of a name and a value. The bundle writer is * free to choose any appropriate names for properties. Their values can be of * type std::string,long,int,bool, * std::vector,float, or double but they can * always be accessed as if they were std::string objects. * *

* All node name and property name comparisons are case-sensitive. * *

* All of the methods that modify preference data are permitted to operate * asynchronously; they may return immediately, and changes will eventually * propagate to the persistent backing store, with an implementation-dependent * delay. The flush method may be used to synchronously force updates * to the backing store. * *

* Implementations must automatically attempt to flush to the backing store any * pending updates for a bundle's preferences when the bundle is stopped or * otherwise ungets the IPreferences Service. * *

* The methods in this class may be invoked concurrently by multiple threads in * a single Java Virtual Machine (JVM) without the need for external * synchronization, and the results will be equivalent to some serial execution. * If this class is used concurrently by multiple JVMs that store their * preference data in the same backing store, the data store will not be * corrupted, but no other guarantees are made concerning the consistency of the * preference data. * * * @version $Revision$ */ struct BERRY_RUNTIME IPreferences : virtual public Object { berryInterfaceMacro(IPreferences, berry) + virtual ~IPreferences(); + /** * Associates the specified value with the specified key in this node. * * @param key key with which the specified value is to be associated. * @param value value to be associated with the specified key. * @throws NullPointerException if key or value is * null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. */ virtual void Put(std::string key, std::string value) = 0; /** * Returns the value associated with the specified key in this * node. Returns the specified default if there is no value associated with * the key, or the backing store is inaccessible. * * @param key key whose associated value is to be returned. * @param def the value to be returned in the event that this node has no * value associated with key or the backing store is * inaccessible. * @return the value associated with key, or def if * no value is associated with key. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @throws NullPointerException if key is null. (A * null default is permitted.) */ virtual std::string Get(std::string key, std::string def) const = 0; /** * Removes the value associated with the specified key in this * node, if any. * * @param key key whose mapping is to be removed from this node. * @see #get(std::string,std::string) * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. */ virtual void Remove(std::string key) = 0; /** * Removes all of the properties (key-value associations) in this node. This * call has no effect on any descendants of this node. * * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #remove(std::string) */ virtual void Clear() throw(Poco::Exception, BackingStoreException) = 0; /** * Associates a std::string object representing the specified * int value with the specified key in this node. The * associated string is the one that would be returned if the int * value were passed to Integer.toString(int). This method is * intended for use in conjunction with {@link #getInt}method. * *

* Implementor's note: it is not necessary that the property value * be represented by a std::string object in the backing store. If the * backing store supports integer values, it is not unreasonable to use * them. This implementation detail is not visible through the * IPreferences API, which allows the value to be read as an * int (with getInt or a std::string (with * get) type. * * @param key key with which the string form of value is to be associated. * @param value value whose string form is to be associated with * key. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #getInt(std::string,int) */ virtual void PutInt(std::string key, int value) = 0; /** * Returns the int value represented by the std::string * object associated with the specified key in this node. The * std::string object is converted to an int as by * Integer.parseInt(std::string). Returns the specified default if * there is no value associated with the key, the backing store * is inaccessible, or if Integer.parseInt(std::string) would throw a * NumberFormatException if the associated value were * passed. This method is intended for use in conjunction with the * {@link #putInt}method. * * @param key key whose associated value is to be returned as an * int. * @param def the value to be returned in the event that this node has no * value associated with key or the associated value * cannot be interpreted as an int or the backing store is * inaccessible. * @return the int value represented by the std::string * object associated with key in this node, or * def if the associated value does not exist or cannot * be interpreted as an int type. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #putInt(std::string,int) * @see #get(std::string,std::string) */ virtual int GetInt(std::string key, int def) const = 0; /** * Associates a std::string object representing the specified * long value with the specified key in this node. The * associated std::string object is the one that would be returned if * the long value were passed to Long.toString(long). * This method is intended for use in conjunction with the {@link #getLong} * method. * *

* Implementor's note: it is not necessary that the value * be represented by a std::string type in the backing store. If the * backing store supports long values, it is not unreasonable to * use them. This implementation detail is not visible through the * IPreferences API, which allows the value to be read as a * long (with getLong or a std::string (with * get) type. * * @param key key with which the string form of value * is to be associated. * @param value value whose string form is to be associated with * key. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #getLong(std::string,long) */ virtual void PutLong(std::string key, long value) = 0; /** * Returns the long value represented by the std::string * object associated with the specified key in this node. The * std::string object is converted to a long as by * Long.parseLong(std::string). Returns the specified default if * there is no value associated with the key, the backing store * is inaccessible, or if Long.parseLong(std::string) would throw a * NumberFormatException if the associated value were * passed. This method is intended for use in conjunction with the * {@link #putLong}method. * * @param key key whose associated value is to be returned as a * long value. * @param def the value to be returned in the event that this node has no * value associated with key or the associated value * cannot be interpreted as a long type or the backing * store is inaccessible. * @return the long value represented by the std::string * object associated with key in this node, or * def if the associated value does not exist or cannot * be interpreted as a long type. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #putLong(std::string,long) * @see #get(std::string,std::string) */ virtual long GetLong(std::string key, long def) const = 0; /** * Associates a std::string object representing the specified * bool value with the specified key in this node. The * associated string is "true" if the value is true, and "false" * if it is false. This method is intended for use in * conjunction with the {@link #getBool}method. * *

* Implementor's note: it is not necessary that the value be * represented by a string in the backing store. If the backing store * supports bool values, it is not unreasonable to use them. * This implementation detail is not visible through the IPreferences * API, which allows the value to be read as a bool * (with getBool) or a std::string (with get) * type. * * @param key key with which the string form of value is to be * associated. * @param value value whose string form is to be associated with * key. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #getBool(std::string,bool) * @see #get(std::string,std::string) */ virtual void PutBool(std::string key, bool value) = 0; /** * Returns the bool value represented by the std::string * object associated with the specified key in this node. Valid * strings are "true", which represents true, and "false", which * represents false. Case is ignored, so, for example, "TRUE" * and "False" are also valid. This method is intended for use in * conjunction with the {@link #putBool}method. * *

* Returns the specified default if there is no value associated with the * key, the backing store is inaccessible, or if the associated * value is something other than "true" or "false", ignoring case. * * @param key key whose associated value is to be returned as a * bool. * @param def the value to be returned in the event that this node has no * value associated with key or the associated value * cannot be interpreted as a bool or the backing store * is inaccessible. * @return the bool value represented by the std::string * object associated with key in this node, or * null if the associated value does not exist or cannot * be interpreted as a bool. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #get(std::string,std::string) * @see #putBool(std::string,bool) */ virtual bool GetBool(std::string key, bool def) const = 0; /** * Associates a std::string object representing the specified * float value with the specified key in this node. * The associated std::string object is the one that would be returned * if the float value were passed to * Float.toString(float). This method is intended for use in * conjunction with the {@link #getFloat}method. * *

* Implementor's note: it is not necessary that the value be * represented by a string in the backing store. If the backing store * supports float values, it is not unreasonable to use them. * This implementation detail is not visible through the IPreferences * API, which allows the value to be read as a float (with * getFloat) or a std::string (with get) type. * * @param key key with which the string form of value is to be * associated. * @param value value whose string form is to be associated with * key. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #getFloat(std::string,float) */ virtual void PutFloat(std::string key, float value) = 0; /** * Returns the float value represented by the std::string * object associated with the specified key in this node. The * std::string object is converted to a float value as by * Float.parseFloat(std::string). Returns the specified default if * there is no value associated with the key, the backing store * is inaccessible, or if Float.parseFloat(std::string) would throw a * NumberFormatException if the associated value were passed. * This method is intended for use in conjunction with the {@link #putFloat} * method. * * @param key key whose associated value is to be returned as a * float value. * @param def the value to be returned in the event that this node has no * value associated with key or the associated value * cannot be interpreted as a float type or the backing * store is inaccessible. * @return the float value represented by the string associated * with key in this node, or def if the * associated value does not exist or cannot be interpreted as a * float type. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @throws NullPointerException if key is null. * @see #putFloat(std::string,float) * @see #get(std::string,std::string) */ virtual float GetFloat(std::string key, float def) const = 0; /** * Associates a std::string object representing the specified * double value with the specified key in this node. * The associated std::string object is the one that would be returned * if the double value were passed to * Double.toString(double). This method is intended for use in * conjunction with the {@link #getDouble}method * *

* Implementor's note: it is not necessary that the value be * represented by a string in the backing store. If the backing store * supports double values, it is not unreasonable to use them. * This implementation detail is not visible through the IPreferences * API, which allows the value to be read as a double (with * getDouble) or a std::string (with get) * type. * * @param key key with which the string form of value is to be * associated. * @param value value whose string form is to be associated with * key. * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #getDouble(std::string,double) */ virtual void PutDouble(std::string key, double value) = 0; /** * Returns the double value represented by the std::string * object associated with the specified key in this node. The * std::string object is converted to a double value as by * Double.parseDouble(std::string). Returns the specified default if * there is no value associated with the key, the backing store * is inaccessible, or if Double.parseDouble(std::string) would throw * a NumberFormatException if the associated value were passed. * This method is intended for use in conjunction with the * {@link #putDouble}method. * * @param key key whose associated value is to be returned as a * double value. * @param def the value to be returned in the event that this node has no * value associated with key or the associated value * cannot be interpreted as a double type or the backing * store is inaccessible. * @return the double value represented by the std::string * object associated with key in this node, or * def if the associated value does not exist or cannot * be interpreted as a double type. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the the {@link #removeNode()}method. * @throws NullPointerException if key is null. * @see #putDouble(std::string,double) * @see #get(std::string,std::string) */ virtual double GetDouble(std::string key, double def) const = 0; /** * Associates a std::string object representing the specified * std::vector with the specified key in this node. The * associated std::string object the Base64 encoding of the * std::vector, as defined in RFC 2045 , Section 6.8, * with one minor change: the string will consist solely of characters from * the Base64 Alphabet ; it will not contain any newline characters. * This method is intended for use in conjunction with the * {@link #getByteArray}method. * *

* Implementor's note: it is not necessary that the value be * represented by a std::string type in the backing store. If the * backing store supports std::vector values, it is not unreasonable * to use them. This implementation detail is not visible through the * IPreferences API, which allows the value to be read as an a * std::vector object (with getByteArray) or a * std::string object (with get). * * @param key key with which the string form of value * is to be associated. * @param value value whose string form is to be associated with * key. * @throws NullPointerException if key or value is * null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #getByteArray(std::string,std::vector) * @see #get(std::string,std::string) */ virtual void PutByteArray(std::string key, std::string value) = 0; /** * Returns the std::vector value represented by the std::string * object associated with the specified key in this node. Valid * std::string objects are Base64 encoded binary data, as * defined in RFC 2045 , * Section 6.8, with one minor change: the string must consist solely of * characters from the Base64 Alphabet ; no newline characters or * extraneous characters are permitted. This method is intended for use in * conjunction with the {@link #putByteArray}method. * *

* Returns the specified default if there is no value associated with the * key, the backing store is inaccessible, or if the associated * value is not a valid Base64 encoded byte array (as defined above). * * @param key key whose associated value is to be returned as a * std::vector object. * @param def the value to be returned in the event that this node has no * value associated with key or the associated value * cannot be interpreted as a std::vector type, or the backing * store is inaccessible. * @return the std::vector value represented by the std::string * object associated with key in this node, or * def if the associated value does not exist or cannot * be interpreted as a std::vector. * @throws NullPointerException if key is null. (A * null value for def is permitted.) * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #get(std::string,std::string) * @see #putByteArray(std::string,std::vector) */ virtual std::string GetByteArray(std::string key, std::string def) const = 0; /** * Returns all of the keys that have an associated value in this node. (The * returned array will be of size zero if this node has no preferences and * not null!) * * @return an array of the keys that have an associated value in this node. * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. */ virtual std::vector Keys() const throw(Poco::Exception, BackingStoreException) = 0; /** * Returns the names of the children of this node. (The returned array will * be of size zero if this node has no children and not null!) * * @return the names of the children of this node. * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. */ virtual std::vector ChildrenNames() const throw(Poco::Exception, BackingStoreException) = 0; /** * Returns the parent of this node, or null if this is the root. * * @return the parent of this node. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. */ virtual IPreferences::Pointer Parent() const = 0; /** * Returns a named IPreferences object (node), creating it and any * of its ancestors if they do not already exist. Accepts a relative or * absolute pathname. Absolute pathnames (which begin with '/') * are interpreted relative to the root of this node. Relative pathnames * (which begin with any character other than '/') are * interpreted relative to this node itself. The empty string ("") * is a valid relative pathname, referring to this node itself. * *

* If the returned node did not exist prior to this call, this node and any * ancestors that were created by this call are not guaranteed to become * persistent until the flush method is called on the returned * node (or one of its descendants). * * @param pathName the path name of the IPreferences object to * return. * @return the specified IPreferences object. * @throws IllegalArgumentException if the path name is invalid. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @throws NullPointerException if path name is null. * @see #flush() */ virtual IPreferences::Pointer Node(std::string pathName) = 0; /** * Returns true if the named node exists. Accepts a relative or absolute * pathname. Absolute pathnames (which begin with '/') are * interpreted relative to the root of this node. Relative pathnames (which * begin with any character other than '/') are interpreted * relative to this node itself. The pathname "" is valid, and * refers to this node itself. * *

* If this node (or an ancestor) has already been removed with the * {@link #removeNode()}method, it is legal to invoke this method, * but only with the pathname ""; the invocation will return * false. Thus, the idiom p.nodeExists("") may be * used to test whether p has been removed. * * @param pathName the path name of the node whose existence is to be * checked. * @return true if the specified node exists. * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method and * pathname is not the empty string (""). * @throws IllegalArgumentException if the path name is invalid (i.e., it * contains multiple consecutive slash characters, or ends with a * slash character and is more than one character long). */ virtual bool NodeExists(std::string pathName) const throw(Poco::Exception, BackingStoreException) = 0; /** * Removes this node and all of its descendants, invalidating any properties * contained in the removed nodes. Once a node has been removed, attempting * any method other than name(),absolutePath() or * nodeExists("") on the corresponding IPreferences * instance will fail with an IllegalStateException. (The * methods defined on Object can still be invoked on a node after * it has been removed; they will not throw IllegalStateException.) * *

* The removal is not guaranteed to be persistent until the flush * method is called on the parent of this node. * * @throws IllegalStateException if this node (or an ancestor) has already * been removed with the {@link #removeNode()}method. * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @see #flush() */ virtual void RemoveNode() throw(Poco::Exception, BackingStoreException) = 0; /** * Returns this node's name, relative to its parent. * * @return this node's name, relative to its parent. */ virtual std::string Name() const = 0; /** * Returns this node's absolute path name. Note that: *

    *
  • Root node - The path name of the root node is "/". *
  • Slash at end - Path names other than that of the root node may not * end in slash ('/'). *
  • Unusual names -"." and ".." have no * special significance in path names. *
  • Illegal names - The only illegal path names are those that contain * multiple consecutive slashes, or that end in slash and are not the root. *
* * @return this node's absolute path name. */ virtual std::string AbsolutePath() const = 0; /** * Forces any changes in the contents of this node and its descendants to * the persistent store. * *

* Once this method returns successfully, it is safe to assume that all * changes made in the subtree rooted at this node prior to the method * invocation have become permanent. * *

* Implementations are free to flush changes into the persistent store at * any time. They do not need to wait for this method to be called. * *

* When a flush occurs on a newly created node, it is made persistent, as * are any ancestors (and descendants) that have yet to be made persistent. * Note however that any properties value changes in ancestors are not * guaranteed to be made persistent. * * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #sync() */ virtual void Flush() throw(Poco::Exception, BackingStoreException) = 0; /** * Ensures that future reads from this node and its descendants reflect any * changes that were committed to the persistent store (from any VM) prior * to the sync invocation. As a side-effect, forces any changes * in the contents of this node and its descendants to the persistent store, * as if the flush method had been invoked on this node. * * @throws BackingStoreException if this operation cannot be completed due * to a failure in the backing store, or inability to communicate * with it. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()}method. * @see #flush() */ virtual void Sync() throw(Poco::Exception, BackingStoreException) = 0; }; } // namespace berry #endif /*BERRYIPREFERENCES_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.osgi/src/internal/.DS_Store b/BlueBerry/Bundles/org.blueberry.osgi/src/internal/.DS_Store new file mode 100644 index 0000000000..5008ddfcf5 Binary files /dev/null and b/BlueBerry/Bundles/org.blueberry.osgi/src/internal/.DS_Store differ diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake b/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake index 8cfc15cbac..72f1b63a50 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/files.cmake @@ -1,114 +1,118 @@ set(SRC_CPP_FILES berryIQtPreferencePage.cpp berryIQtStyleManager.cpp berryQCHPluginListener.cpp berryQtAssistantUtil.cpp berryQModelIndexObject.cpp berryQtEditorPart.cpp berryQtItemSelection.cpp berryQtIntroPart.cpp berryQtPreferences.cpp berryQtSelectionProvider.cpp berryQtViewPart.cpp # application application/berryQtWorkbenchAdvisor.cpp ) set(INTERNAL_CPP_FILES defaultpresentation/berryEmptyTabFolder.cpp defaultpresentation/berryEmptyTabItem.cpp defaultpresentation/berryNativeTabFolder.cpp defaultpresentation/berryNativeTabItem.cpp defaultpresentation/berryQCTabBar.cpp defaultpresentation/berryQtWorkbenchPresentationFactory.cpp util/berryAbstractTabFolder.cpp + util/berryAbstractTabItem.cpp + util/berryIPresentablePartList.cpp util/berryLeftToRightTabOrder.cpp util/berryPartInfo.cpp util/berryPresentablePartFolder.cpp util/berryReplaceDragHandler.cpp util/berryTabbedStackPresentation.cpp + util/berryTabDragHandler.cpp util/berryTabFolderEvent.cpp + util/berryTabOrder.cpp berryQtDisplay.cpp berryQtDnDTweaklet.cpp berryQtFileImageDescriptor.cpp berryQtGlobalEventFilter.cpp berryQtIconImageDescriptor.cpp berryQtImageTweaklet.cpp berryQtMainWindowControl.cpp berryQtMessageDialogTweaklet.cpp berryQtMissingImageDescriptor.cpp berryQtOpenPerspectiveAction.cpp berryQtPerspectiveSwitcher.cpp berryQtPluginActivator.cpp berryQtSafeApplication.cpp berryQtSash.cpp berryQtShell.cpp berryQtShowViewAction.cpp berryQtShowViewDialog.cpp berryQtStyleManager.cpp berryQtStylePreferencePage.cpp berryQtTracker.cpp berryQtWidgetsTweaklet.cpp berryQtWidgetsTweakletImpl.cpp berryQtWorkbenchPageTweaklet.cpp berryQtWorkbenchTweaklet.cpp berryQtWorkbenchWindow.cpp ) set(MOC_H_FILES src/berryQCHPluginListener.h src/berryQtSelectionProvider.h src/internal/defaultpresentation/berryNativeTabFolder.h src/internal/defaultpresentation/berryNativeTabItem.h src/internal/defaultpresentation/berryQCTabBar.h src/internal/defaultpresentation/berryQtWorkbenchPresentationFactory.h src/internal/berryQtDisplay.h src/internal/berryQtDnDTweaklet.h src/internal/berryQtGlobalEventFilter.h src/internal/berryQtImageTweaklet.h src/internal/berryQtMainWindowControl.h src/internal/berryQtMessageDialogTweaklet.h src/internal/berryQtOpenPerspectiveAction.h src/internal/berryQtPerspectiveSwitcher.h src/internal/berryQtSash.h src/internal/berryQtShowViewAction.h src/internal/berryQtStyleManager.h src/internal/berryQtStylePreferencePage.h src/internal/berryQtTracker.h src/internal/berryQtWidgetsTweaklet.h src/internal/berryQtWidgetsTweakletImpl.h src/internal/berryQtWorkbenchTweaklet.h src/internal/berryQtWorkbenchPageTweaklet.h src/internal/berryQtPluginActivator.h ) set(UI_FILES src/internal/berryQtShowViewDialog.ui src/internal/berryQtStylePreferencePage.ui src/internal/berryQtStatusPart.ui ) set(QRC_FILES resources/org_blueberry_ui_qt.qrc ) set(CACHED_RESOURCE_FILES plugin.xml ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.cpp new file mode 100644 index 0000000000..7492fda906 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryAbstractTabItem.h" + +namespace berry +{ + +AbstractTabItem::~AbstractTabItem() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.h index 2a327131df..d42d4b2082 100755 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryAbstractTabItem.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYABSTRACTTABITEM_H_ #define BERRYABSTRACTTABITEM_H_ #include #include #include "berryPartInfo.h" namespace berry { struct AbstractTabItem { - virtual ~AbstractTabItem() {} + virtual ~AbstractTabItem(); virtual QRect GetBounds() = 0; virtual void SetInfo(const PartInfo& info) = 0; virtual void Dispose() = 0; virtual void SetBusy(bool /*busy*/) {} virtual void SetBold(bool /*bold*/) {} virtual Object::Pointer GetData() = 0; virtual void SetData(Object::Pointer data) = 0; virtual bool IsShowing() { return true; } }; } #endif /* BERRYABSTRACTTABITEM_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.cpp new file mode 100644 index 0000000000..a65a686c11 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPresentablePartList.h" + + +namespace berry { + +IPresentablePartList::~IPresentablePartList () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.h index 0838eb86c3..69e6e73e19 100755 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryIPresentablePartList.h @@ -1,48 +1,46 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPRESENTABLEPARTLIST_H_ #define BERRYIPRESENTABLEPARTLIST_H_ #include #include namespace berry { struct IPresentablePartList { - virtual ~IPresentablePartList() - { - } + virtual ~IPresentablePartList(); virtual void Insert(IPresentablePart::Pointer part, int idx) = 0; virtual void Remove(IPresentablePart::Pointer part) = 0; virtual void Move(IPresentablePart::Pointer part, int newIndex) = 0; virtual std::size_t Size() = 0; virtual void Select(IPresentablePart::Pointer part) = 0; virtual std::vector GetPartList() = 0; }; } #endif /* BERRYIPRESENTABLEPARTLIST_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.cpp new file mode 100644 index 0000000000..2d512e5b13 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryTabDragHandler.h" + +namespace berry +{ + +TabDragHandler::~TabDragHandler() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.h index 16a65a4c60..140bae65fc 100755 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabDragHandler.h @@ -1,48 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYTABDRAGHANDLER_H_ #define BERRYTABDRAGHANDLER_H_ #include #include #include namespace berry { struct TabDragHandler { - virtual ~TabDragHandler() {} + virtual ~TabDragHandler(); + /** * Returns the StackDropResult for the location being dragged over. * * @param currentControl control being dragged over * @param location mouse position (display coordinates) * @param initialTab the index of the tab in this stack being dragged, * or -1 if dragging a tab from another stack. * @return the StackDropResult for this drag location */ virtual StackDropResult::Pointer DragOver(QWidget* currentControl, const Point& location, int initialTab) = 0; virtual int GetInsertionPosition(Object::Pointer cookie) = 0; }; } #endif /* BERRYTABDRAGHANDLER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.cpp new file mode 100644 index 0000000000..e4be2be73d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryTabOrder.h" + +namespace berry +{ + +TabOrder::~TabOrder() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.h index bce922769f..7aa594b204 100755 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/internal/util/berryTabOrder.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYTABORDER_H_ #define BERRYTABORDER_H_ #include #include #include namespace berry { struct TabOrder { - virtual ~TabOrder() {} + virtual ~TabOrder(); /** * Adds a part due to a user action that opened a part * * @param newPart part being added */ virtual void Add(IPresentablePart::Pointer newPart) = 0; /** * Adds a part at initialization-time (the part was added as * part of a perspective, rather than by a user action) * * @param newPart the part being added */ virtual void AddInitial(IPresentablePart::Pointer newPart) = 0; virtual void RestoreState(IPresentationSerializer* serializer, IMemento::Pointer savedState) = 0; virtual void SaveState(IPresentationSerializer* serializer, IMemento::Pointer memento) = 0; /** * Adds a part at a particular index due to a drag/drop operation. * * @param added part being added * @param index index where the part is added at */ virtual void Insert(IPresentablePart::Pointer added, int index) = 0; virtual void Move(IPresentablePart::Pointer toMove, int newIndex) = 0; /** * Removes a part * * @param removed part being removed */ virtual void Remove(IPresentablePart::Pointer removed) = 0; /** * Selects a part * * @param selected part being selected */ virtual void Select(IPresentablePart::Pointer selected) = 0; virtual std::vector GetPartList() = 0; }; } #endif /* BERRYTABORDER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/files.cmake b/BlueBerry/Bundles/org.blueberry.ui/files.cmake index b96e6039e1..48db465ead 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/files.cmake +++ b/BlueBerry/Bundles/org.blueberry.ui/files.cmake @@ -1,235 +1,304 @@ set(MOC_H_FILES src/internal/berryWorkbenchPlugin.h src/internal/intro/berryEditorIntroAdapterPart.h src/berryWorkbenchPart.h src/berryEditorPart.h src/berryViewPart.h src/intro/berryIntroPart.h ) set(CACHED_RESOURCE_FILES plugin.xml ) set(SRC_CPP_FILES berryAbstractSourceProvider.cpp berryAbstractUIPlugin.cpp berryAbstractUICTKPlugin.cpp berryConstants.cpp berryDisplay.cpp berryEditorPart.cpp berryFileEditorInput.cpp berryGeometry.cpp berryIDropTargetListener.cpp + berryIEditorDescriptor.cpp + berryIEditorInput.cpp + berryIEditorMatchingStrategy.cpp + berryIEditorPart.cpp + berryIEditorReference.cpp berryIEditorRegistry.cpp + berryIEditorSite.cpp + berryIFileEditorMapping.cpp + berryIFolderLayout.cpp berryImageDescriptor.cpp berryIMemento.cpp + berryINullSelectionListener.cpp berryIPageLayout.cpp berryIPartListener.cpp + berryIPageService.cpp + berryIPartService.cpp + berryIPathEditorInput.cpp + berryIPerspectiveDescriptor.cpp + berryIPerspectiveFactory.cpp berryIPerspectiveListener.cpp + berryIPerspectiveRegistry.cpp + berryIPlaceholderFolderLayout.cpp + berryIPostSelectionProvider.cpp + berryIPreferencePage.cpp berryIPropertyChangeListener.cpp + berryIReusableEditor.cpp berryISaveablePart.cpp berryISaveablesLifecycleListener.cpp + berryISaveablesSource.cpp + berryISelection.cpp berryISelectionChangedListener.cpp berryISelectionListener.cpp + berryISelectionProvider.cpp + berryISelectionService.cpp berryIShellListener.cpp + berryIShellProvider.cpp berryISizeProvider.cpp + berryISourceProvider.cpp berryISourceProviderListener.cpp berryISources.cpp + berryIStickyViewDescriptor.cpp berryIStructuredSelection.cpp + berryIViewCategory.cpp + berryIViewDescriptor.cpp + berryIViewLayout.cpp + berryIViewPart.cpp + berryIViewReference.cpp + berryIViewRegistry.cpp + berryIViewSite.cpp berryIWindowListener.cpp + berryIWorkbench.cpp berryIWorkbenchListener.cpp berryIWorkbenchPage.cpp + berryIWorkbenchPart.cpp berryIWorkbenchPartConstants.cpp + berryIWorkbenchPartDescriptor.cpp + berryIWorkbenchPartReference.cpp + berryIWorkbenchPartSite.cpp + berryIWorkbenchSite.cpp + berryIWorkbenchWindow.cpp berryPlatformUI.cpp berryPoint.cpp berryPropertyChangeEvent.cpp berryRectangle.cpp berrySameShellProvider.cpp berrySaveable.cpp berrySaveablesLifecycleEvent.cpp berrySelectionChangedEvent.cpp berryShell.cpp berryShellEvent.cpp berryUIException.cpp berryViewPart.cpp berryWindow.cpp berryWorkbenchPart.cpp berryWorkbenchPreferenceConstants.cpp berryXMLMemento.cpp #application application/berryActionBarAdvisor.cpp + application/berryIActionBarConfigurer.cpp + application/berryIWorkbenchConfigurer.cpp + application/berryIWorkbenchWindowConfigurer.cpp application/berryWorkbenchAdvisor.cpp application/berryWorkbenchWindowAdvisor.cpp #commands #commands/berryAbstractContributionFactory.cpp #commands/berryCommandContributionItem.cpp #commands/berryCommandContributionItemParameter.cpp #commands/berryContributionItem.cpp #commands/berryContributionManager.cpp #commands/berryICommandImageService.cpp #commands/berryICommandService.cpp #commands/berryIContributionManagerOverrides.cpp #commands/berryIMenuItem.cpp #commands/berryIMenuItemListener.cpp #commands/berryIMenuListener.cpp #commands/berryIToolItemListener.cpp #commands/berryIUIElementListener.cpp #commands/berryMenuManager.cpp #commands/berrySubContributionItem.cpp #commands/berryUIElement.cpp #dialogs dialogs/berryIDialog.cpp + dialogs/berryIShowViewDialog.cpp dialogs/berryMessageDialog.cpp #guitk guitk/berryGuiTkControlEvent.cpp guitk/berryGuiTkEvent.cpp guitk/berryGuiTkIControlListener.cpp guitk/berryGuiTkIMenuListener.cpp guitk/berryGuiTkISelectionListener.cpp guitk/berryGuiTkSelectionEvent.cpp #handlers handlers/berryHandlerUtil.cpp handlers/berryIHandlerActivation.cpp handlers/berryShowViewHandler.cpp #src + intro/berryIIntroManager.cpp intro/berryIntroPart.cpp + intro/berryIIntroPart.cpp + intro/berryIIntroSite.cpp + + #services + services/berryIDisposable.cpp + services/berryINestable.cpp + services/berryIServiceFactory.cpp + services/berryIServiceLocator.cpp + services/berryIServiceWithSources.cpp #tweaklets tweaklets/berryDnDTweaklet.cpp tweaklets/berryGuiWidgetsTweaklet.cpp tweaklets/berryImageTweaklet.cpp tweaklets/berryMessageDialogTweaklet.cpp + tweaklets/berryITracker.cpp tweaklets/berryWorkbenchPageTweaklet.cpp tweaklets/berryWorkbenchTweaklet.cpp #presentations presentations/berryIPresentablePart.cpp presentations/berryIPresentationFactory.cpp + presentations/berryIPresentationSerializer.cpp presentations/berryIStackPresentationSite.cpp presentations/berryStackDropResult.cpp presentations/berryStackPresentation.cpp #testing testing/berryTestableObject.cpp #util + util/berryISafeRunnableRunner.cpp util/berrySafeRunnable.cpp ) set(INTERNAL_CPP_FILES #intro intro/berryEditorIntroAdapterPart.cpp + intro/berryIIntroDescriptor.cpp + intro/berryIIntroRegistry.cpp intro/berryIntroConstants.cpp intro/berryIntroDescriptor.cpp intro/berryIntroPartAdapterSite.cpp intro/berryIntroRegistry.cpp intro/berryViewIntroAdapterPart.cpp intro/berryWorkbenchIntroManager.cpp berryAbstractPartSelectionTracker.cpp berryAbstractSelectionService.cpp berryBundleUtility.cpp berryContainerPlaceholder.cpp berryDetachedPlaceHolder.cpp berryDefaultSaveable.cpp berryDefaultStackPresentationSite.cpp berryDetachedWindow.cpp berryDragUtil.cpp berryEditorAreaHelper.cpp berryEditorDescriptor.cpp berryEditorManager.cpp berryEditorReference.cpp berryEditorRegistry.cpp berryEditorRegistryReader.cpp berryEditorSashContainer.cpp berryEditorSite.cpp berryErrorViewPart.cpp berryFileEditorMapping.cpp berryFolderLayout.cpp berryIDragOverListener.cpp + berryIDropTarget.cpp + berryIEvaluationResultCache.cpp + berryIEvaluationResultCache.cpp + berryILayoutContainer.cpp + berryILayoutContainer.cpp + berryIServiceLocatorCreator.cpp + berryIStackableContainer.cpp + berryIStickyViewManager.cpp + berryIWorkbenchLocationService.cpp + berryIWorkbenchLocationService.cpp berryLayoutHelper.cpp berryLayoutPart.cpp berryLayoutPartSash.cpp berryLayoutTree.cpp berryLayoutTreeNode.cpp berryNullEditorInput.cpp berryPageLayout.cpp berryPagePartSelectionTracker.cpp berryPageSelectionService.cpp berryPartList.cpp berryPartPane.cpp berryPartPlaceholder.cpp berryPartSashContainer.cpp berryPartService.cpp berryPartSite.cpp berryPartStack.cpp berryPartTester.cpp berryPerspective.cpp berryPerspectiveDescriptor.cpp berryPerspectiveExtensionReader.cpp berryPerspectiveHelper.cpp berryPerspectiveRegistry.cpp berryPerspectiveRegistryReader.cpp berryPlaceholderFolderLayout.cpp berryPreferenceConstants.cpp berryPresentablePart.cpp berryPresentationFactoryUtil.cpp berryPresentationSerializer.cpp berryQtControlWidget.cpp berryQtDnDControlWidget.cpp berryQtWidgetController.cpp berryRegistryReader.cpp berrySaveablesList.cpp berryServiceLocator.cpp berryServiceLocatorCreator.cpp berryShellPool.cpp berrySourcePriorityNameMapping.cpp berryStackablePart.cpp berryStickyViewDescriptor.cpp berryStickyViewManager.cpp berryTweaklets.cpp berryViewDescriptor.cpp berryViewFactory.cpp berryViewLayout.cpp berryViewReference.cpp berryViewRegistry.cpp berryViewRegistryReader.cpp berryViewSashContainer.cpp berryViewSite.cpp berryWorkbenchPage.cpp berryWindowManager.cpp berryWindowPartSelectionTracker.cpp berryWindowSelectionService.cpp berryWorkbench.cpp berryWorkbenchConfigurer.cpp berryWorkbenchConstants.cpp berryWorkbenchPagePartList.cpp berryWorkbenchPartReference.cpp berryWorkbenchPlugin.cpp berryWorkbenchRegistryConstants.cpp berryWorkbenchServiceRegistry.cpp berryWorkbenchTestable.cpp berryWorkbenchWindow.cpp berryWorkbenchWindowConfigurer.cpp berryWWinPartService.cpp ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.cpp new file mode 100644 index 0000000000..4f66c20cdb --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIActionBarConfigurer.h" + + +namespace berry { + +IActionBarConfigurer::~IActionBarConfigurer () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.h b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.h index 4747f76828..b2e52e6757 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIActionBarConfigurer.h @@ -1,99 +1,101 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIACTIONBARCONFIGURER_H_ #define BERRYIACTIONBARCONFIGURER_H_ #include #include #include "berryIWorkbenchWindowConfigurer.h" namespace berry { /** * Interface providing special access for configuring the action bars * of a workbench window. *

* Note that these objects are only available to the main application * (the plug-in that creates and owns the workbench). *

*

* This interface is not intended to be implemented by clients. *

* * @see org.blueberry.ui.application.WorkbenchAdvisor#fillActionBars * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IActionBarConfigurer : public Object { berryInterfaceMacro(IActionBarConfigurer, berry); + ~IActionBarConfigurer(); + /** * Returns the workbench window configurer for the window * containing this configurer's action bars. * * @return the workbench window configurer * @since 3.1 */ virtual IWorkbenchWindowConfigurer::Pointer GetWindowConfigurer() = 0; /** * Returns the menu manager for the main menu bar of a workbench window. * * @return the menu manager */ virtual void* GetMenuManager() = 0; /** * Returns the status line manager of a workbench window. * * @return the status line manager */ //virtual IStatusLineManager GetStatusLineManager() = 0; /** * Returns the cool bar manager of the workbench window. * * @return the cool bar manager */ //virtual ICoolBarManager GetCoolBarManager() = 0; /** * Register the action as a global action with a workbench * window. *

* For a workbench retarget action * ({@link org.blueberry.ui.actions.RetargetAction RetargetAction}) * to work, it must be registered. * You should also register actions that will participate * in custom key bindings. *

* * @param action the global action * @see org.blueberry.ui.actions.RetargetAction */ //virtual void RegisterGlobalAction(IAction action) = 0; }; } #endif /*BERRYIACTIONBARCONFIGURER_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.cpp new file mode 100644 index 0000000000..7442e68838 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchConfigurer.h" + + +namespace berry { + +IWorkbenchConfigurer::~IWorkbenchConfigurer () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.h b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.h index a56cfb5451..847c9fcfb6 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchConfigurer.h @@ -1,258 +1,260 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHCONFIGURER_H_ #define BERRYIWORKBENCHCONFIGURER_H_ #include #include #include "berryIWorkbench.h" #include "berryIWorkbenchWindowConfigurer.h" namespace berry { /** * Interface providing special access for configuring the workbench. *

* Note that these objects are only available to the main application * (the plug-in that creates and owns the workbench). *

*

* This interface is not intended to be implemented by clients. *

* * @see WorkbenchAdvisor#Initialize() * @note This interface is not intended to be implemented by clients. */ struct BERRY_UI IWorkbenchConfigurer : public Object { berryInterfaceMacro(IWorkbenchConfigurer, berry); + ~IWorkbenchConfigurer(); + /** * Restore status code indicating that the saved state * could not be restored, but that startup should continue * with a reset state. * * @see #RestoreState() */ static const int RESTORE_CODE_RESET = 1; /** * Restore status code indicating that the saved state * could not be restored, and that the application * must exit immediately without modifying any previously * saved workbench state. */ static const int RESTORE_CODE_EXIT = 2; /** * Returns the underlying workbench. * * @return the workbench */ virtual IWorkbench* GetWorkbench() = 0; /** * Returns whether the workbench state should be saved on close and * restored on subsequent open. *

* The initial value is false. *

* * @return true to save and restore workbench state, or * false to forget current workbench state on close. */ virtual bool GetSaveAndRestore() = 0; /** * Sets whether the workbench state should be saved on close and * restored on subsequent open. * * @param enabled true to save and restore workbench state, or * false to forget current workbench state on close. */ virtual void SetSaveAndRestore(bool enabled) = 0; /** * Restores a workbench window from the given memento. * * @param memento the memento from which to restore the window's state * @return the configurer for the restored window * @throws WorkbenchException if an error occurred during the restore * @see IWorkbenchWindowConfigurer#SaveState(IMemento::Pointer) */ virtual IWorkbenchWindowConfigurer::Pointer RestoreWorkbenchWindow(IMemento::Pointer memento) = 0; /* * Declares a workbench image. *

* The workbench remembers the given image descriptor under the given name, * and makes the image available to plug-ins via * {@link IWorkbench#GetSharedImages() IWorkbench.getSharedImages()}. * For "shared" images, the workbench remembers the image descriptor and * will manages the image object create from it; clients retrieve "shared" * images via * {@link org.blueberry.ui.ISharedImages#getImage ISharedImages.getImage()}. * For the other, "non-shared" images, the workbench remembers only the * image descriptor; clients retrieve the image descriptor via * {@link org.blueberry.ui.ISharedImages#getImageDescriptor * ISharedImages.getImageDescriptor()} and are entirely * responsible for managing the image objects they create from it. * (This is made confusing by the historical fact that the API interface * is called "ISharedImages".) *

* * @param symbolicName the symbolic name of the image * @param descriptor the image descriptor * @param shared true if this is a shared image, and * false if this is not a shared image * @see org.blueberry.ui.ISharedImages#getImage * @see org.blueberry.ui.ISharedImages#getImageDescriptor */ // virtual void declareImage(String symbolicName, ImageDescriptor descriptor, // boolean shared); /** * Forces the workbench to close due to an emergency. This method should * only be called when the workbench is in dire straights and cannot * continue, and cannot even risk a normal workbench close (think "out of * memory" or "unable to create shell"). When this method is called, an * abbreviated workbench shutdown sequence is performed (less critical * steps may be skipped). The workbench advisor is still called; however, * it must not attempt to communicate with the user. While an emergency * close is in progress, EmergencyClosing() returns * true. %Workbench advisor methods should always check this * flag before communicating with the user. * * @see #EmergencyClosing() */ virtual void EmergencyClose() = 0; /** * Returns whether the workbench is being closed due to an emergency. * When this method returns true, the workbench is in dire * straights and cannot continue. Indeed, things are so bad that we cannot * even risk a normal workbench close. %Workbench advisor methods should * always check this flag before attempting to communicate with the user. * * @return true if the workbench is in the process of being * closed under emergency conditions, and false otherwise */ virtual bool EmergencyClosing() = 0; /** * Returns an object that can be used to configure the given window. * * @param window a workbench window * @return a workbench window configurer */ virtual IWorkbenchWindowConfigurer::Pointer GetWindowConfigurer( IWorkbenchWindow::Pointer window) = 0; /** * Returns the data associated with the workbench at the given key. * * @param key the key * @return the data, or null if there is no data at the given * key */ virtual Object::Pointer GetData(const std::string& key) const = 0; /** * Sets the data associated with the workbench at the given key. * * @param key the key * @param data the data, or null to delete existing data */ virtual void SetData(const std::string& key, Object::Pointer data) = 0; /** * Restores the workbench state saved from the previous session, if any. * This includes any open windows and their open perspectives, open views * and editors, layout information, and any customizations to the open * perspectives. *

* This is typically called from the advisor's WorkbenchAdvisor#OpenWindows() * method. *

* * @return a status object indicating whether the restore was successful * @see #RESTORE_CODE_RESET * @see #RESTORE_CODE_EXIT * @see WorkbenchAdvisor#OpenWindows() */ virtual bool RestoreState() = 0; /** * Opens the first time window, using the default perspective and * default page input. *

* This is typically called from the advisor's WorkbenchAdvisor#OpenWindows() * method. *

* * @see WorkbenchAdvisor#OpenWindows() */ virtual void OpenFirstTimeWindow() = 0; /** * Returns true if the workbench should exit when the last * window is closed, false if the window should just be * closed, leaving the workbench (and its event loop) running. *

* If true, the last window's state is saved before closing, * so that it will be restored in the next session. This applies only if * #GetSaveAndRestore() returns true). *

*

* If false, the window is simply closed, losing its state. *

*

* If the workbench is left running, it can be closed using * IWorkbench#Close(), or a new window can be opened using * IWorkbench#OpenWorkbenchWindow(const std::string&, IAdaptable*). *

*

* The initial value is true. *

* * @return true if the workbench will exit when the last * window is closed, false if the window should just * be closed */ virtual bool GetExitOnLastWindowClose() = 0; /** * Sets whether the workbench should exit when the last window is closed, or * whether the window should just be closed, leaving the workbench (and its * event loop) running. *

* For more details, see #GetExitOnLastWindowClose(). *

* * @param enabled * true if the workbench should exit when the last * window is closed, false if the window should * just be closed */ virtual void SetExitOnLastWindowClose(bool enabled) = 0; }; } #endif /*BERRYIWORKBENCHCONFIGURER_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.cpp new file mode 100644 index 0000000000..87bdca6a95 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchWindowConfigurer.h" + + +namespace berry { + +IWorkbenchWindowConfigurer::~IWorkbenchWindowConfigurer () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h index dbed6b2637..48abdb9bfd 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/application/berryIWorkbenchWindowConfigurer.h @@ -1,374 +1,376 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHWINDOWCONFIGURER_H_ #define BERRYIWORKBENCHWINDOWCONFIGURER_H_ #include #include #include "berryShell.h" #include "berryIMemento.h" #include "berryPoint.h" #include "berryIDropTargetListener.h" namespace berry { struct IWorkbenchConfigurer; struct IWorkbenchWindow; /** * Interface providing special access for configuring workbench windows. *

* %Window configurer objects are in 1-1 correspondence with the workbench * windows they configure. Clients may use Get/SetData to * associate arbitrary state with the window configurer object. *

*

* Note that these objects are only available to the main application * (the plug-in that creates and owns the workbench). *

*

* This interface is not intended to be implemented by clients. *

* * @see IWorkbenchConfigurer#GetWindowConfigurer() * @see WorkbenchAdvisor#PreWindowOpen() * @note This interface is not intended to be implemented by clients. */ struct BERRY_UI IWorkbenchWindowConfigurer : public Object { berryInterfaceMacro(IWorkbenchWindowConfigurer, berry); + ~IWorkbenchWindowConfigurer(); + /** * Returns the underlying workbench window. * * @return the workbench window */ virtual SmartPointer GetWindow() = 0; /** * Returns the workbench configurer. * * @return the workbench configurer */ virtual SmartPointer GetWorkbenchConfigurer() = 0; /* * Returns the action bar configurer for this workbench * window. * * @return the action bar configurer */ //virtual IActionBarConfigurer GetActionBarConfigurer() = 0; /** * Returns the title of the underlying workbench window. * * @return the window title */ virtual std::string GetTitle() = 0; /** * Sets the title of the underlying workbench window. * * @param title the window title */ virtual void SetTitle(const std::string& title) = 0; /** * Returns whether the underlying workbench window has a menu bar. *

* The initial value is true. *

* * @return true for a menu bar, and false * for no menu bar */ virtual bool GetShowMenuBar() = 0; /** * Sets whether the underlying workbench window has a menu bar. * * @param show true for a menu bar, and false * for no menu bar */ virtual void SetShowMenuBar(bool show) = 0; /** * Returns whether the underlying workbench window has a cool bar. *

* The initial value is true. *

* * @return true for a cool bar, and false * for no cool bar */ virtual bool GetShowCoolBar() = 0; /** * Sets whether the underlying workbench window has a cool bar. * * @param show true for a cool bar, and false * for no cool bar */ virtual void SetShowCoolBar(bool show) = 0; /** * Returns whether the underlying workbench window has a status line. *

* The initial value is true. *

* * @return true for a status line, and false * for no status line */ virtual bool GetShowStatusLine() = 0; /** * Sets whether the underlying workbench window has a status line. * * @param show true for a status line, and false * for no status line */ virtual void SetShowStatusLine(bool show) = 0; /** * Returns whether the underlying workbench window has a perspective bar (the * perspective bar provides buttons to quickly switch between perspectives). *

* The initial value is false. *

* * @return true for a perspective bar, and false * for no perspective bar */ virtual bool GetShowPerspectiveBar() = 0; /** * Sets whether the underlying workbench window has a perspective bar (the * perspective bar provides buttons to quickly switch between perspectives). * * @param show true for a perspective bar, and * false for no perspective bar */ virtual void SetShowPerspectiveBar(bool show) = 0; /** * Returns whether the underlying workbench window has a progress indicator. *

* The initial value is false. *

* * @return true for a progress indicator, and false * for no progress indicator */ virtual bool GetShowProgressIndicator() = 0; /** * Sets whether the underlying workbench window has a progress indicator. * * @param show true for a progress indicator, and false * for no progress indicator */ virtual void SetShowProgressIndicator(bool show) = 0; /** * Returns the style bits to use for the window's shell when it is created. * The default is SWT.SHELL_TRIM. * * @return the shell style bits */ virtual int GetShellStyle() = 0; /** * Sets the style bits to use for the window's shell when it is created. * This method has no effect after the shell is created. * That is, it must be called within the WorkbenchAdvisor#PreWindowOpen() * callback. *

* For more details on the applicable shell style bits, see the * documentation for Shell. *

* * @param shellStyle the shell style bits */ virtual void SetShellStyle(int shellStyle) = 0; /** * Returns the size to use for the window's shell when it is created. * * @return the initial size to use for the shell */ virtual Point GetInitialSize() = 0; /** * Sets the size to use for the window's shell when it is created. * This method has no effect after the shell is created. * That is, it must be called within the WorkbenchAdvisor#PreWindowOpen() * callback. * * @param initialSize the initial size to use for the shell */ virtual void SetInitialSize(Point initialSize) = 0; /* * Returns the data associated with this workbench window at the given key. * * @param key the key * @return the data, or null if there is no data at the given * key */ //virtual Object getData(String key); /* * Sets the data associated with this workbench window at the given key. * * @param key the key * @param data the data, or null to delete existing data */ //virtual void setData(String key, Object data); /** * Adds the given drag and drop Mime types to the ones * supported for drag and drop on the editor area of this workbench window. *

* The workbench advisor would ordinarily call this method from the * PreWindowOpen callback. * A newly-created workbench window supports no drag and drop transfer * types. *

*

* Note that drag and drop to the editor area requires adding one or more * transfer types (using AddEditorAreaTransfer) and * configuring a drop target listener * (with ConfigureEditorAreaDropListener) * capable of handling any of those transfer types. *

* * @param transfer a drag and drop transfer object * @see #configureEditorAreaDropListener * @see org.blueberry.ui.part.EditorInputTransfer */ virtual void AddEditorAreaTransfer(const QStringList& transferTypes) = 0; /** * Configures the drop target listener for the editor area of this workbench window. *

* The workbench advisor ordinarily calls this method from the * PreWindowOpen callback. * A newly-created workbench window has no configured drop target listener for its * editor area. *

*

* Note that drag and drop to the editor area requires adding one or more * transfer types (using AddEditorAreaTransfer) and * configuring a drop target listener * (with ConfigureEditorAreaDropListener) * capable of handling any of those transfer types. *

* * @param dropTargetListener the drop target listener that will handle * requests to drop an object on to the editor area of this window * * @see #AddEditorAreaTransfer */ virtual void ConfigureEditorAreaDropListener(const IDropTargetListener::Pointer& dropTargetListener) = 0; /* * Creates the menu bar for the window's shell. *

* This should only be called if the advisor is defining custom window contents * in createWindowContents, and may only be called once. * The caller must set it in the shell using Shell.setMenuBar(Menu) * but must not make add, remove or change items in the result. * The menu bar is populated by the window's menu manager. * The application can add to the menu manager in the advisor's * fillActionBars method instead. *

* * @return the menu bar, suitable for setting in the shell */ //virtual Menu createMenuBar(); /* * Creates the cool bar control. *

* This should only be called if the advisor is defining custom window contents * in createWindowContents, and may only be called once. * The caller must lay out the cool bar appropriately within the parent, * but must not add, remove or change items in the result (hence the * return type of Control). * The cool bar is populated by the window's cool bar manager. * The application can add to the cool bar manager in the advisor's * fillActionBars method instead. *

* * @param parent the parent composite * @return the cool bar control, suitable for laying out in the parent */ //virtual Control createCoolBarControl(Composite parent); /* * Creates the status line control. *

* This should only be called if the advisor is defining custom window contents * in createWindowContents, and may only be called once. * The caller must lay out the status line appropriately within the parent, * but must not add, remove or change items in the result (hence the * return type of Control). * The status line is populated by the window's status line manager. * The application can add to the status line manager in the advisor's * fillActionBars method instead. *

* * @param parent the parent composite * @return the status line control, suitable for laying out in the parent */ //virtual Control createStatusLineControl(Composite parent); /** * Creates the page composite, in which the window's pages, and their * views and editors, appear. *

* This should only be called if the advisor is defining custom window contents * in WorkbenchWindowAdvisor#CreateWindowContents(), and may only be called once. * The caller must lay out the page composite appropriately within the parent, * but must not add, remove or change items in the result. * The page composite is populated by the workbench. *

* * @param parent the parent composite * @return the page composite, suitable for laying out in the parent */ virtual void* CreatePageComposite(void* parent) = 0; /** * Saves the current state of the window using the specified memento. * * @param memento the memento in which to save the window's state * @return a status object indicating whether the save was successful * @see IWorkbenchConfigurer#RestoreWorkbenchWindow(IMemento::Pointer) */ virtual bool SaveState(IMemento::Pointer memento) = 0; }; } #endif /*BERRYIWORKBENCHWINDOWCONFIGURER_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.cpp index 86756474c6..d47e2e62ec 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.cpp @@ -1,31 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryDisplay.h" #include namespace berry { Display* Display::instance = 0; +Display::~Display() +{ + +} + Display* Display::GetDefault() { poco_assert(instance); return instance; } } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.h index 94df4ecef9..9be41705a7 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryDisplay.h @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYDISPLAY_H_ #define BERRYDISPLAY_H_ #include #include namespace berry { class BERRY_UI Display { public: - virtual ~Display() {} + virtual ~Display(); static Display* GetDefault(); /** * Returns true if the calling thread is the same thread * who created this Display instance. * @return */ virtual bool InDisplayThread() = 0; virtual void AsyncExec(Poco::Runnable*) = 0; virtual void SyncExec(Poco::Runnable*) = 0; virtual int RunEventLoop() = 0; virtual void ExitEventLoop(int code) = 0; protected: /** * This method must be called from within the UI thread * and should create the Display instance and initialize * variables holding implementation specific thread data. */ virtual void CreateDisplay() = 0; static Display* instance; }; } #endif /* BERRYDISPLAY_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.cpp new file mode 100644 index 0000000000..8923778bde --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEditorDescriptor.h" + + +namespace berry { + +IEditorDescriptor::~IEditorDescriptor () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.h index 03b827b013..fb55e2c6cb 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorDescriptor.h @@ -1,124 +1,123 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEDITORDESCRIPTOR_H_ #define BERRYIEDITORDESCRIPTOR_H_ #include #include "berryIWorkbenchPartDescriptor.h" #include "berryIEditorMatchingStrategy.h" namespace berry { /** * \ingroup org_blueberry_ui * * Description of an editor in the workbench editor registry. The * editor descriptor contains the information needed to create editor instances. *

* An editor descriptor typically represents one of three types of editors: *

    *
  • a file editor extension for a specific file extension.
  • *
  • a file editor added by the user (via the workbench preference page)
  • *
  • a general editor extension which works on objects other than files.
  • *
*

*

* This interface is not intended to be implemented or extended by clients. *

* * @see IEditorRegistry * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IEditorDescriptor : public IWorkbenchPartDescriptor { berryInterfaceMacro(IEditorDescriptor, berry); - virtual ~IEditorDescriptor() - {} + virtual ~IEditorDescriptor(); /** * Returns the editor id. *

* For internal editors, this is the extension id as defined in the workbench * registry; for external editors, it is path and file name of the external * program. *

* * @return the id of the editor */ virtual std::string GetId() const = 0; /** * Returns the descriptor of the image for this editor. * * @return the descriptor of the image to display next to this editor */ //ImageDescriptor getImageDescriptor() = 0; /** * Returns the label to show for this editor. * * @return the editor label */ virtual std::string GetLabel() const = 0; /** * Returns whether this editor descriptor will open a regular editor * part inside the editor area. * * @return true if editor is inside editor area, and * false otherwise * @since 3.0 */ virtual bool IsInternal() const = 0; /** * Returns whether this editor descriptor will open an external * editor in-place inside the editor area. * * @return true if editor is in-place, and false * otherwise * @since 3.0 */ virtual bool IsOpenInPlace() const = 0; /** * Returns whether this editor descriptor will open an external editor * in a new window outside the workbench. * * @return true if editor is external, and false * otherwise * @since 3.0 */ virtual bool IsOpenExternal() const = 0; /** * Returns the editor matching strategy object for editors * represented by this editor descriptor, or null * if there is no explicit matching strategy specified. * * @return the editor matching strategy, or null if none * @since 3.1 */ virtual IEditorMatchingStrategy::Pointer GetEditorMatchingStrategy() = 0; }; } #endif /*BERRYIEDITORDESCRIPTOR_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.cpp new file mode 100644 index 0000000000..9afc98c060 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEditorInput.h" + +namespace berry { + +IEditorInput::~IEditorInput () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.h index 8d812f2b5f..2453e77e81 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorInput.h @@ -1,141 +1,143 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEDITORINPUT_H_ #define BERRYIEDITORINPUT_H_ #include #include #include namespace berry { /** * \ingroup org_blueberry_ui * * IEditorInput is a light weight descriptor of editor input, * like a file name but more abstract. It is not a model. It is a description of * the model source for an IEditorPart. *

* Clients implementing this editor input interface must override * Object#operator==(const Object*) to answer true * for two inputs that are * the same. The IWorbenchPage.openEditor APIs are dependent on * this to find an editor with the same input. *

*

* Clients should extend this interface to declare new types of editor inputs. *

*

* An editor input is passed to an editor via the IEditorPart.init * method. Due to the wide range of valid editor inputs, it is not possible to * define generic methods for getting and setting bytes. *

*

* Editor input must implement the IAdaptable interface; * extensions are managed by the platform's adapter manager. *

*

* Please note that it is important that the editor input be light weight. * Within the workbench, the navigation history tends to hold on to editor * inputs as a means of reconstructing the editor at a later time. The * navigation history can hold on to quite a few inputs (i.e., the default is * fifty). The actual data model should probably not be held in the input. *

* * * @see org.blueberry.ui.IEditorPart * @see org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String) * @see org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String, boolean) */ struct BERRY_UI IEditorInput : public Object // public IAdaptable { berryInterfaceMacro(IEditorInput, berry); + ~IEditorInput(); + /** * Returns whether the editor input exists. *

* This method is primarily used to determine if an editor input should * appear in the "File Most Recently Used" menu. An editor input will appear * in the list until the return value of exists becomes * false or it drops off the bottom of the list. * * @return true if the editor input exists; * false otherwise */ virtual bool Exists() const = 0; /** * Returns the image descriptor for this input. * *

* Note: although a null return value has never been permitted from this * method, there are many known buggy implementations that return null. * Clients that need the image for an editor are advised to use * IWorkbenchPart.getImage() instead of IEditorInput.getImageDescriptor(), * or to recover from a null return value in a manner that records the ID of * the problematic editor input. Implementors that have been returning null * from this method should pick some other default return value (such as * ImageDescriptor.getMissingImageDescriptor()). *

* * @return the image descriptor for this input; may be null if * there is no image. */ //virtual ImageDescriptor GetImageDescriptor() = 0; /** * Returns the name of this editor input for display purposes. *

* For instance, when the input is from a file, the return value would * ordinarily be just the file name. * * @return the name string; never null; */ virtual std::string GetName() const = 0; /** * Returns an object that can be used to save the state of this editor * input. * * @return the persistable element, or null if this editor * input cannot be persisted */ //virtual IPersistableElement GetPersistable() = 0; /** * Returns the tool tip text for this editor input. This text is used to * differentiate between two input with the same name. For instance, * MyClass.java in folder X and MyClass.java in folder Y. The format of the * text varies between input types. *

* * @return the tool tip text; never null. */ virtual std::string GetToolTipText() const = 0; /** * Returns true if two editor inputs are the same * */ virtual bool operator==(const Object* o) const = 0; }; } #endif /*BERRYIEDITORINPUT_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.cpp new file mode 100644 index 0000000000..24e7d1c048 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEditorMatchingStrategy.h" + + +namespace berry { + +IEditorMatchingStrategy::~IEditorMatchingStrategy() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.h index fcd39d688f..d94ed9fc6f 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorMatchingStrategy.h @@ -1,66 +1,66 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEDITORMATCHINGSTRATEGY_H_ #define BERRYIEDITORMATCHINGSTRATEGY_H_ #include #include "berryIEditorReference.h" #include "berryIEditorInput.h" namespace berry { /** * \ingroup org_blueberry_ui * * An editor matching strategy allows editor extensions to provide their own * algorithm for matching the input of an open editor of that type to a * given editor input. This is used to find a matching editor during * {@link org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String, boolean)} and * {@link org.blueberry.ui.IWorkbenchPage#findEditor(IEditorInput)}. * * @since 3.1 */ struct BERRY_UI IEditorMatchingStrategy : public Object { berryInterfaceMacro(IEditorMatchingStrategy, berry); - ~IEditorMatchingStrategy() {} + ~IEditorMatchingStrategy(); /** * Returns whether the editor represented by the given editor reference * matches the given editor input. *

* Implementations should inspect the given editor input first, * and try to reject it early before calling IEditorReference.getEditorInput(), * since that method may be expensive. *

* * @param editorRef the editor reference to match against * @param input the editor input to match * @return true if the editor matches the given editor input, * false if it does not match */ virtual bool Matches(IEditorReference::Pointer editorRef, IEditorInput::Pointer input) = 0; }; } Q_DECLARE_INTERFACE(berry::IEditorMatchingStrategy, "org.blueberry.IEditorMatchingStrategy") #endif /*BERRYIEDITORMATCHINGSTRATEGY_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.cpp new file mode 100644 index 0000000000..74b0f5bd5d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEditorPart.h" + + +namespace berry { + +IEditorPart::~IEditorPart() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.h index 61180111b2..04ced89282 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorPart.h @@ -1,132 +1,130 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEDITORPART_H_ #define BERRYIEDITORPART_H_ #include "berryIWorkbenchPart.h" #include "berryISaveablePart.h" #include namespace berry { struct IEditorInput; struct IEditorSite; /** * \ingroup org_blueberry_ui * * An editor is a visual component within a workbench page. It is * typically used to edit or browse a document or input object. The input * is identified using an IEditorInput. Modifications made * in an editor part follow an open-save-close lifecycle model (in contrast * to a view part, where modifications are saved to the workbench * immediately). *

* An editor is document or input-centric. Each editor has an input, and only * one editor can exist for each editor input within a page. This policy has * been designed to simplify part management. *

* An editor should be used in place of a view whenever more than one instance * of a document type can exist. *

* This interface may be implemented directly. For convenience, a base * implementation is defined in EditorPart. *

*

* An editor part is added to the workbench in two stages: *

    *
  1. An editor extension is contributed to the workbench registry. This * extension defines the extension id, extension class, and the file * extensions which are supported by the editor.
  2. *
  3. An editor part based upon the extension is created and added to the * workbench when the user opens a file with one of the supported file * extensions (or some other suitable form of editor input).
  4. *
*

*

* All editor parts implement the IAdaptable interface; extensions * are managed by the platform's adapter manager. *

* * @see org.blueberry.ui.IWorkbenchPage#openEditor(IEditorInput, String) * @see org.blueberry.ui.part.EditorPart */ struct BERRY_UI IEditorPart : public virtual IWorkbenchPart, public ISaveablePart { - berryInterfaceMacro(IEditorPart, berry); + berryInterfaceMacro(IEditorPart, berry) - virtual ~IEditorPart() - { - } + virtual ~IEditorPart(); /** * The property id for getEditorInput. */ //static const int PROP_INPUT = IWorkbenchPartConstants.PROP_INPUT; /** * Returns the input for this editor. If this value changes the part must * fire a property listener event with PROP_INPUT. * * @return the editor input */ virtual SmartPointer GetEditorInput() const = 0; /** * Returns the site for this editor. * This method is equivalent to (IEditorSite) getSite(). *

* The site can be null while the editor is being initialized. * After the initialization is complete, this value must be non-null * for the remainder of the editor's life cycle. *

* * @return the editor site; this value may be null if the editor * has not yet been initialized */ virtual SmartPointer GetEditorSite() const = 0; /** * Initializes this editor with the given editor site and input. *

* This method is automatically called shortly after the part is instantiated. * It marks the start of the part's lifecycle. The * {@link IWorkbenchPart#dispose IWorkbenchPart.dispose} method will be called * automically at the end of the lifecycle. Clients must not call this method. *

* Implementors of this method must examine the editor input object type to * determine if it is understood. If not, the implementor must throw * a PartInitException *

* @param site the editor site * @param input the editor input * @exception PartInitException if this editor was not initialized successfully */ virtual void Init(SmartPointer site, SmartPointer input) = 0; }; } Q_DECLARE_INTERFACE(berry::IEditorPart, "org.blueberry.IEditorPart") #endif /*BERRYIEDITORPART_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.cpp new file mode 100644 index 0000000000..cde6e10dd9 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEditorReference.h" + + +namespace berry { + +IEditorReference::~IEditorReference() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.h index 173202b63d..3834656499 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorReference.h @@ -1,80 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEDITORREFERENCE_H_ #define BERRYIEDITORREFERENCE_H_ #include "berryIWorkbenchPartReference.h" #include "berryIEditorPart.h" #include "berryIEditorInput.h" namespace berry { /** * \ingroup org_blueberry_ui * * Implements a reference to a editor. * The IEditorPart will not be instanciated until * the editor becomes visible or the API getEditor * is sent with true; *

* This interface is not intended to be implemented by clients. *

*/ struct BERRY_UI IEditorReference : public virtual IWorkbenchPartReference { - berryInterfaceMacro(IEditorReference, berry); + berryInterfaceMacro(IEditorReference, berry) + + ~IEditorReference(); /** * Returns the factory id of the factory used to * restore this editor. Returns null if the editor * is not persistable. */ virtual std::string GetFactoryId() = 0; /** * Returns the editor input name. May return null is the * name is not available or if the editor failed to be * restored. */ virtual std::string GetName() = 0; /** * Returns the editor referenced by this object. * Returns null if the editor was not instantiated or * it failed to be restored. Tries to restore the editor * if restore is true. */ virtual IEditorPart::Pointer GetEditor(bool restore) = 0; /** * Returns the editor input for the editor referenced by this object. *

* Unlike most of the other methods on this type, this method * can trigger plug-in activation. *

* * @return the editor input for the editor referenced by this object * @throws PartInitException if there was an error restoring the editor input * @since 3.1 */ virtual IEditorInput::Pointer GetEditorInput() = 0; }; } // namespace berry #endif /*BERRYIEDITORREFERENCE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.cpp new file mode 100644 index 0000000000..2664399425 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEditorSite.h" + + +namespace berry { + +IEditorSite::~IEditorSite () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.h index d0be8b5b57..32bda01919 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIEditorSite.h @@ -1,133 +1,133 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEDITORSITE_H_ #define BERRYIEDITORSITE_H_ #include "berryIWorkbenchPartSite.h" namespace berry { /** * \ingroup org_blueberry_ui * * The primary interface between an editor part and the workbench. *

* The workbench exposes its implemention of editor part sites via this * interface, which is not intended to be implemented or extended by clients. *

* @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IEditorSite : public virtual IWorkbenchPartSite { berryInterfaceMacro(IEditorSite, berry); - virtual ~IEditorSite() {} + virtual ~IEditorSite(); /** * Returns the action bar contributor for this editor. *

* An action contributor is responsable for the creation of actions. * By design, this contributor is used for one or more editors of the same type. * Thus, the contributor returned by this method is not owned completely * by the editor - it is shared. *

* * @return the editor action bar contributor, or null if none exists */ //virtual IEditorActionBarContributor getActionBarContributor(); /** * Returns the action bars for this part site. Editors of the same type (and * in the same window) share the same action bars. Contributions to the * action bars are done by the IEditorActionBarContributor. * * @return the action bars * @since 2.1 */ //virtual IActionBars getActionBars(); /** *

* Registers a pop-up menu with the default id for extension. The default id * is defined as the part id. *

*

* By default, context menus include object contributions based on the * editor input for the current editor. It is possible to override this * behaviour by calling this method with includeEditorInput * as false. This might be desirable for editors that * present a localized view of an editor input (e.g., a node in a model * editor). *

*

* For a detailed description of context menu registration see * {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)} *

* * @param menuManager * the menu manager; must not be null. * @param selectionProvider * the selection provider; must not be null. * @param includeEditorInput * Whether the editor input should be included when adding object * contributions to this context menu. * @see IWorkbenchPartSite#registerContextMenu(MenuManager, * ISelectionProvider) * @since 3.1 */ // virtual void registerContextMenu(MenuManager menuManager, // ISelectionProvider selectionProvider, boolean includeEditorInput); /** *

* Registers a pop-up menu with a particular id for extension. This method * should only be called if the target part has more than one context menu * to register. *

*

* By default, context menus include object contributions based on the * editor input for the current editor. It is possible to override this * behaviour by calling this method with includeEditorInput * as false. This might be desirable for editors that * present a localized view of an editor input (e.g., a node in a model * editor). *

*

* For a detailed description of context menu registration see * {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)} *

* * @param menuId * the menu id; must not be null. * @param menuManager * the menu manager; must not be null. * @param selectionProvider * the selection provider; must not be null. * @param includeEditorInput * Whether the editor input should be included when adding object * contributions to this context menu. * @see IWorkbenchPartSite#registerContextMenu(MenuManager, * ISelectionProvider) * @since 3.1 */ // virtual void registerContextMenu(String menuId, MenuManager menuManager, // ISelectionProvider selectionProvider, boolean includeEditorInput); }; } #endif /*BERRYIEDITORSITE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.cpp new file mode 100644 index 0000000000..045c0e2785 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIFileEditorMapping.h" + +namespace berry +{ + +IFileEditorMapping::~IFileEditorMapping() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.h index c504a350c7..bd55734c35 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFileEditorMapping.h @@ -1,113 +1,113 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIFILEEDITORMAPPING_H_ #define BERRYIFILEEDITORMAPPING_H_ #include #include "berryIEditorDescriptor.h" #include #include #include namespace berry { /** * \ingroup org_blueberry_ui * * An association between a file name/extension and a list of known editors for * files of that type. *

* The name and extension can never empty or null. The name may contain * the single wild card character (*) to indicate the editor applies to * all files with the same extension (e.g. *.doc). The name can never * embed the wild card character within itself (i.e. rep*) *

*

* This interface is not intended to be implemented by clients. *

* * @see IEditorRegistry#getFileEditorMappings * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IFileEditorMapping : public Object { berryInterfaceMacro(IFileEditorMapping, berry) - virtual ~IFileEditorMapping() {} + virtual ~IFileEditorMapping(); /** * Returns the default editor registered for this type mapping. * * @return the descriptor of the default editor, or null if there * is no default editor registered. Will also return null if * the default editor exists but fails the Expressions check. */ virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0; /** * Returns the list of editors registered for this type mapping. * * @return a possibly empty list of editors. */ virtual std::list GetEditors() const = 0; /** * Returns the list of editors formerly registered for this type mapping * which have since been deleted. * * @return a possibly empty list of editors */ virtual std::list GetDeletedEditors() const = 0; /** * Returns the file's extension for this type mapping. * * @return the extension for this mapping */ virtual std::string GetExtension() const = 0; /** * Returns the descriptor of the image to use for a file of this type. *

* The image is obtained from the default editor. A default file image is * returned if no default editor is available. *

* * @return the descriptor of the image to use for a resource of this type */ //virtual ImageDescriptor GetImageDescriptor() = 0; /** * Returns the label to use for this mapping. * Labels have the form "name.extension". * * @return the label to use for this mapping */ virtual std::string GetLabel() const = 0; /** * Returns the file's name for this type mapping. * * @return the name for this mapping */ virtual std::string GetName() const = 0; }; } #endif /*BERRYIFILEEDITORMAPPING_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.cpp new file mode 100644 index 0000000000..0527326b18 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIFolderLayout.h" + + +namespace berry { + +IFolderLayout::~IFolderLayout() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.h index 8e1e790e92..66eaecd83c 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIFolderLayout.h @@ -1,54 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIFOLDERLAYOUT_H_ #define BERRYIFOLDERLAYOUT_H_ #include "berryIPlaceholderFolderLayout.h" namespace berry { /** * \ingroup org_blueberry_ui * * An IFolderLayout is used to define the initial views within a folder. * The folder itself is contained within an IPageLayout. *

* This interface is not intended to be implemented by clients. *

* * @see IPageLayout#createFolder * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IFolderLayout : public IPlaceholderFolderLayout { berryInterfaceMacro(IFolderLayout, berry) + ~IFolderLayout(); + /** * Adds a view with the given compound id to this folder. * See the {@link IPageLayout} type documentation for more details about compound ids. * The primary id must name a view contributed to the workbench's view extension point * (named "org.blueberry.ui.views"). * * @param viewId the view id */ virtual void AddView(const std::string& viewId) = 0; }; } #endif /*BERRYIFOLDERLAYOUT_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.cpp index 9299dc0c16..7908c82f7f 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.cpp @@ -1,23 +1,27 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIMemento.h" namespace berry { const std::string IMemento::TAG_ID = "IMemento.internal.id"; +IMemento::~IMemento() +{ +} + } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.h index 93982de615..37c3fb6d68 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIMemento.h @@ -1,253 +1,250 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIMEMENTO_H_ #define BERRYIMEMENTO_H_ #include #include #include #include namespace berry { /** * \ingroup org_blueberry_ui * * Interface to a memento used for saving the important state of an object * in a form that can be persisted in the file system. *

* Mementos were designed with the following requirements in mind: *

    *
  1. Certain objects need to be saved and restored across platform sessions. *
  2. *
  3. When an object is restored, an appropriate class for an object might not * be available. It must be possible to skip an object in this case.
  4. *
  5. When an object is restored, the appropriate class for the object may be * different from the one when the object was originally saved. If so, the * new class should still be able to read the old form of the data.
  6. *
*

*

* Mementos meet these requirements by providing support for storing a * mapping of arbitrary string keys to primitive values, and by allowing * mementos to have other mementos as children (arranged into a tree). * A robust external storage format based on XML is used. *

* The key for an attribute may be any alpha numeric value. However, the * value of TAG_ID is reserved for internal use. *

* This interface is not intended to be implemented or extended by clients. *

* * @see IPersistableElement * @see IElementFactory * @noimplement This interface is not intended to be implemented by clients. * **/ struct BERRY_UI IMemento: public Object { berryInterfaceMacro(IMemento, berry) /** * Special reserved key used to store the memento id * (value "IMemento.internal.id"). * * @see #getID() */ static const std::string TAG_ID; // = "IMemento.internal.id"; /** * Creates a new child of this memento with the given type. *

* The GetChild and GetChildren methods * are used to retrieve children of a given type. *

* * @param type the type * @return a new child memento * @see #GetChild * @see #GetChildren */ virtual IMemento::Pointer CreateChild(const std::string& type) = 0; /** * Creates a new child of this memento with the given type and id. * The id is stored in the child memento (using a special reserved * key, TAG_ID) and can be retrieved using GetID. *

* The GetChild and GetChildren methods * are used to retrieve children of a given type. *

* * @param type the type * @param id the child id * @return a new child memento with the given type and id * @see #GetID */ virtual IMemento::Pointer CreateChild(const std::string& type, const std::string& id) = 0; /** * Returns the first child with the given type id. * * @param type the type id * @return the first child with the given type */ virtual IMemento::Pointer GetChild(const std::string& type) const = 0; /** * Returns all children with the given type id. * * @param type the type id * @return an array of children with the given type */ virtual std::vector GetChildren(const std::string& type) const = 0; /** * Gets the floating point value of the given key. * * @param key the key * @param value the value of the given key * @return false if the key was not found or was found * but was not a floating point number, else true */ virtual bool GetFloat(const std::string& key, double& value) const = 0; /** * Gets the integer value of the given key. * * @param key the key * @param value the value of the given key * @return false if the key was not found or was found * but was not an integer, else true */ virtual bool GetInteger(const std::string& key, int& value) const = 0; /** * Gets the string value of the given key. * * @param key the key * @param value the value of the given key * @return false if the key was not found, else true */ virtual bool GetString(const std::string& key, std::string& value) const = 0; /** * Gets the boolean value of the given key. * * @param key the key * @param value the value of the given key * @return false if the key was not found, else true */ virtual bool GetBoolean(const std::string& key, bool& value) const = 0; /** * Returns the data of the Text node of the memento. Each memento is allowed * only one Text node. * * @return the data of the Text node of the memento, or null * if the memento has no Text node. */ virtual const std::string& GetTextData() const = 0; /** * Returns an array of all the attribute keys of the memento. This will not * be null. If there are no keys, an array of length zero will * be returned. * @return an array with all the attribute keys of the memento */ virtual std::vector GetAttributeKeys() const = 0; /** * Returns the type for this memento. * * @return the memento type * @see #CreateChild(const std::string&) * @see #CreateChild(const std::string&, const std::string&) */ virtual std::string GetType() const = 0; /** * Returns the id for this memento. * * @return the memento id, or "" if none * @see #CreateChild(const std::string&, const std::string&) */ virtual std::string GetID() const = 0; /** * Sets the value of the given key to the given floating point number. * * @param key the key * @param value the value */ virtual void PutFloat(const std::string& key, double value) = 0; /** * Sets the value of the given key to the given integer. * * @param key the key * @param value the value */ virtual void PutInteger(const std::string& key, int value) = 0; /** * Copy the attributes and children from memento * to the receiver. * * @param memento the IMemento to be copied. */ virtual void PutMemento(IMemento::Pointer memento) = 0; /** * Sets the value of the given key to the given const std::string&. * * @param key the key * @param value the value */ virtual void PutString(const std::string& key, const std::string& value) = 0; /** * Sets the value of the given key to the given boolean value. * * @param key the key * @param value the value */ virtual void PutBoolean(const std::string& key, bool value) = 0; /** * Sets the memento's Text node to contain the given data. Creates the Text node if * none exists. If a Text node does exist, it's current contents are replaced. * Each memento is allowed only one text node. * * @param data the data to be placed on the Text node */ virtual void PutTextData(const std::string& data) = 0; - virtual ~IMemento() - { - } - ; + virtual ~IMemento(); }; } // namespace berry #endif /*BERRYIMEMENTO_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.cpp new file mode 100644 index 0000000000..4c139c39cf --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryINullSelectionListener.h" + + +namespace berry { + +INullSelectionListener::~INullSelectionListener() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.h index 872e925fb6..6c3a05636b 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryINullSelectionListener.h @@ -1,99 +1,101 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYINULLSELECTIONLISTENER_H_ #define BERRYINULLSELECTIONLISTENER_H_ #include "berryISelectionListener.h" namespace berry { /** * Interface for listening to null selection changes. *

* This interface should be implemented by selection listeners * that want to be notified when the selection becomes null. * It has no methods. It simply indicates the desire to receive * null selection events through the existing * SelectionChanged() method. Either the part or the * selection may be null. *

* * @see ISelectionListener#SelectionChanged() * @see IActionDelegate#SelectionChanged() * @see ISelectionListener * */ struct INullSelectionListener : public ISelectionListener { berryInterfaceMacro(INullSelectionListener, berry) + + ~INullSelectionListener(); }; /** * \ingroup org_blueberry_ui * * This template can be used like this: * * * class MyClass { * * private: * void HandleSelectionChanged(berry::IWorkbenchPart::Pointer part, berry::ISelection::ConstPointer selection) * { // do something } * * berry::INullSelectionListener::Pointer m_SelectionListener; * * public: * MyClass() * : m_SelectionListener(new berry::NullSelectionChangedAdapter(this, &MyClass::HandleSelectionChanged)) * { * // get the selection service * // ... * service->AddPostSelectionListener(m_SelectionListener); * } * }; * */ template struct NullSelectionChangedAdapter: public INullSelectionListener { typedef R Listener; typedef void (R::*Callback)(IWorkbenchPart::Pointer, ISelection::ConstPointer); NullSelectionChangedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } void SelectionChanged(IWorkbenchPart::Pointer part, ISelection::ConstPointer selection) { (listener->*callback)(part, selection); } private: Listener* listener; Callback callback; }; } #endif /* BERRYINULLSELECTIONLISTENER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.cpp new file mode 100644 index 0000000000..3041f13b53 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.cpp @@ -0,0 +1,25 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPageService.h" + +namespace berry { + +IPageService::~IPageService(){ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.h index 6eb2361818..809e2d5c6a 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPageService.h @@ -1,107 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPAGESERVICE_H_ #define BERRYIPAGESERVICE_H_ #include #include "berryIPerspectiveListener.h" namespace berry { struct IWorkbenchPage; /** * A page service tracks the page and perspective lifecycle events * within a workbench window. *

* This service can be acquired from your service locator: *

  *  IPageService service = (IPageService) getSite().getService(IPageService.class);
  * 
*
    *
  • This service is not available globally, only from the workbench window level down.
  • *
*

* * @see IWorkbenchWindow * @see IPageListener * @see IPerspectiveListener * @see org.blueberry.ui.services.IServiceLocator#getService(Class) * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IPageService { - virtual ~IPageService() {} - /** + virtual ~IPageService(); + + /** * Adds the given listener for page lifecycle events. * Has no effect if an identical listener is already registered. *

* Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *

* * @param listener a page listener * @see #removePageListener(IPageListener) */ //virtual void AddPageListener(IPageListener listener); /** * Adds the given listener for a page's perspective lifecycle events. * Has no effect if an identical listener is already registered. *

* Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *

* * @param listener a perspective listener * @see #removePerspectiveListener(IPerspectiveListener) */ virtual void AddPerspectiveListener(IPerspectiveListener::Pointer listener) = 0; /** * Returns the active page. * * @return the active page, or null if no page is currently active */ virtual SmartPointer GetActivePage() = 0; /** * Removes the given page listener. * Has no affect if an identical listener is not registered. * * @param listener a page listener */ //virtual void RemovePageListener(IPageListener listener); /** * Removes the given page's perspective listener. * Has no affect if an identical listener is not registered. * * @param listener a perspective listener */ virtual void RemovePerspectiveListener(IPerspectiveListener::Pointer listener) = 0; virtual IPerspectiveListener::Events& GetPerspectiveEvents() = 0; }; } #endif /* BERRYIPAGESERVICE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.cpp new file mode 100644 index 0000000000..fc629fecd2 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPartService.h" + +namespace berry +{ + +IPartService::~IPartService() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.h index ffa75a9811..2a45c3c68d 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPartService.h @@ -1,84 +1,84 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPARTSERVICE_H_ #define BERRYIPARTSERVICE_H_ #include #include "berryIWorkbenchPart.h" #include "berryIWorkbenchPartReference.h" #include "berryIPartListener.h" namespace berry { /** * \ingroup org_blueberry_ui * * A part service tracks the creation and activation of parts within a * workbench page. *

* This interface is not intended to be implemented by clients. *

* * @see IWorkbenchPage */ struct BERRY_UI IPartService { - virtual ~IPartService() {} + virtual ~IPartService(); /** * Adds the given observer for part lifecycle events. * Has no effect if an identical listener is already registered. *

* Note: listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. *

* * @param listener a part listener * @see #removePartListener(IPartListener) */ virtual void AddPartListener(IPartListener::Pointer listener) = 0; /** * Returns the active part. * * @return the active part, or null if no part is currently active */ virtual IWorkbenchPart::Pointer GetActivePart() = 0; /** * Returns the active part reference. * * @return the active part reference, or null if no part * is currently active */ virtual IWorkbenchPartReference::Pointer GetActivePartReference() = 0; /** * Removes the given part listener. * Has no affect if an identical listener is not registered. * * @param listener a part listener */ virtual void RemovePartListener(IPartListener::Pointer listener) = 0; }; } // namespace berry #endif /*BERRYIPARTSERVICE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.cpp new file mode 100644 index 0000000000..fa8e6eb451 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPathEditorInput.h" + +namespace berry +{ + +IPathEditorInput::~IPathEditorInput() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.h index 4d48f6fc8a..0ebbc60625 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPathEditorInput.h @@ -1,63 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPATHEDITORINPUT_H_ #define BERRYIPATHEDITORINPUT_H_ #include "berryIEditorInput.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * This interface defines an editor input based on the local file system path * of a file. *

* Clients implementing this editor input interface should override * Object.equals(Object) to answer true for two inputs * that are the same. The IWorkbenchPage.openEditor APIs * are dependent on this to find an editor with the same input. *

* Path-oriented editors should support this as a valid input type, and * can allow full read-write editing of its content. *

* All editor inputs must implement the IAdaptable interface; * extensions are managed by the platform's adapter manager. *

* * @see org.blueberry.core.runtime.IPath * @since 3.0 */ struct BERRY_UI IPathEditorInput : public IEditorInput { berryInterfaceMacro(IPathEditorInput, berry) - virtual ~IPathEditorInput() {} + virtual ~IPathEditorInput(); /** * Returns the local file system path of the file underlying this editor input. * * @return a local file system path */ virtual Poco::Path GetPath() const = 0; }; } #endif /*BERRYIPATHEDITORINPUT_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.cpp new file mode 100644 index 0000000000..c753d860a4 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPerspectiveDescriptor.h" + +namespace berry +{ + +IPerspectiveDescriptor::~IPerspectiveDescriptor() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h index 171368a335..9b1db23b1d 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h @@ -1,106 +1,106 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPERSPECTIVEDESCRIPTOR_H_ #define BERRYIPERSPECTIVEDESCRIPTOR_H_ #include #include #include #include "berryImageDescriptor.h" namespace berry { /** * \ingroup org_blueberry_ui * * A perspective descriptor describes a perspective in an * IPerspectiveRegistry. *

* A perspective is a template for view visibility, layout, and action visibility * within a workbench page. There are two types of perspective: a predefined * perspective and a custom perspective. *

    *
  • A predefined perspective is defined by an extension to the workbench's * perspective extension point ("org.blueberry.ui.perspectives"). * The extension defines a id, label, and IPerspectiveFactory. * A perspective factory is used to define the initial layout for a page. *
  • *
  • A custom perspective is defined by the user. In this case a predefined * perspective is modified to suit a particular task and saved as a new * perspective. The attributes for the perspective are stored in a separate file * in the workbench's metadata directory. *
  • *
*

*

* Within a page the user can open any of the perspectives known * to the workbench's perspective registry, typically by selecting one from the * workbench's Open Perspective menu. When selected, the views * and actions within the active page rearrange to reflect the perspective. *

*

* This interface is not intended to be implemented by clients. *

* @see IPerspectiveRegistry * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IPerspectiveDescriptor : public Object { berryInterfaceMacro(IPerspectiveDescriptor, berry) - virtual ~IPerspectiveDescriptor() {} + virtual ~IPerspectiveDescriptor(); /** * Returns the description of this perspective. * This is the value of its "description" attribute. * * @return the description * @since 3.0 */ virtual std::string GetDescription() const = 0; /** * Returns this perspective's id. For perspectives declared via an extension, * this is the value of its "id" attribute. * * @return the perspective id */ virtual std::string GetId() const = 0; /** * Returns the descriptor of the image to show for this perspective. * If the extension for this perspective specifies an image, the descriptor * for it is returned. Otherwise a default image is returned. * * @return the descriptor of the image to show for this perspective */ virtual ImageDescriptor::Pointer GetImageDescriptor() const = 0; /** * Returns this perspective's label. For perspectives declared via an extension, * this is the value of its "label" attribute. * * @return the label */ virtual std::string GetLabel() const = 0; }; } #endif /*BERRYIPERSPECTIVEDESCRIPTOR_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.cpp new file mode 100644 index 0000000000..8f15f2fc2d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPerspectiveFactory.h" + +namespace berry { + +IPerspectiveFactory::~IPerspectiveFactory() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.h index c1b29f3ed7..901aea322a 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveFactory.h @@ -1,109 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPERSPECTIVEFACTORY_H_ #define BERRYIPERSPECTIVEFACTORY_H_ #include #include #include "berryIPageLayout.h" #include namespace berry { /** * A perspective factory generates the initial page layout and visible * action set for a page. *

* When a new page is created in the workbench a perspective is used to define * the initial page layout. If this is a predefined perspective (based on an extension to * the workbench's perspective extension point) an IPerspectiveFactory * is used to define the initial page layout. *

* The factory for the perspective is created and passed an IPageLayout * where views can be added. The default layout consists of the editor area with no * additional views. Additional views are added to the layout using * the editor area as the initial point of reference. The factory is used only briefly * while a new page is created; then discarded. *

* To define a perspective clients should implement this interface and * include the name of their class in an extension to the workbench's perspective * extension point (named "org.blueberry.ui.perspectives"). For example, * the plug-in's XML markup might contain: *

  * <extension point="org.blueberry.ui.perspectives">
  *   <perspective
  *       id="com.example.plugin.perspective"
  *       name="My Perspective"
  *       class="namespaze::MyPerspective">
  *   </perspective>
  * </extension>
  * 
*

* Example of populating a page with standard workbench views: *

  * public: void CreateInitialLayout(IPageLayout layout) {
  *    // Get the editor area.
  *    std::string editorArea = layout->GetEditorArea();
  *
  *    // Top left: Resource Navigator view and Bookmarks view placeholder
  *    IFolderLayout::Pointer topLeft = layout->CreateFolder("topLeft", IPageLayout::LEFT, 0.25f,
  *      editorArea);
  *    topLeft->AddView(IPageLayout::ID_RES_NAV);
  *    topLeft->AddPlaceholder(IPageLayout::ID_BOOKMARKS);
  *
  *    // Bottom left: Outline view and Property Sheet view
  *    IFolderLayout::Pointer bottomLeft = layout->CreateFolder("bottomLeft", IPageLayout::BOTTOM, 0.50f,
  *      "topLeft");
  *    bottomLeft->AddView(IPageLayout::ID_OUTLINE);
  *    bottomLeft->AddView(IPageLayout::ID_PROP_SHEET);
  *
  *    // Bottom right: Task List view
  *    layout->AddView(IPageLayout::ID_TASK_LIST, IPageLayout::BOTTOM, 0.66f, editorArea);
  *  }
  * 
*

* Within the workbench a user may override the visible views, layout and * action sets of a predefined perspective to create a custom perspective. In such cases * the layout is persisted by the workbench and the factory is not used. *

*/ struct BERRY_UI IPerspectiveFactory : public Object { - berryInterfaceMacro(IPerspectiveFactory, berry); + berryInterfaceMacro(IPerspectiveFactory, berry) + + ~IPerspectiveFactory(); /** * Creates the initial layout for a page. *

* Implementors of this method may add additional views to a * perspective. The perspective already contains an editor folder * identified by the result of IPageLayout.getEditorArea(). * Additional views should be added to the layout using this value as * the initial point of reference. *

* * @param layout the page layout */ virtual void CreateInitialLayout(IPageLayout::Pointer layout) = 0; }; } Q_DECLARE_INTERFACE(berry::IPerspectiveFactory, "org.blueberry.IPerspectiveFactory") #endif /* BERRYIPERSPECTIVEFACTORY_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.cpp new file mode 100644 index 0000000000..68fbc9f2c6 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPerspectiveRegistry.h" + +namespace berry +{ + +IPerspectiveRegistry::~IPerspectiveRegistry() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.h index adf4156105..521f515768 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveRegistry.h @@ -1,130 +1,130 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPERSPECTIVEREGISTRY_H_ #define BERRYIPERSPECTIVEREGISTRY_H_ #include "berryIPerspectiveDescriptor.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * The workbench's global registry of perspectives. *

* This registry contains a descriptor for each perspectives in the workbench. * It is initially populated with stock perspectives from the workbench's * perspective extension point ("org.blueberry.ui.perspectives") and * with custom perspectives defined by the user. *

* This interface is not intended to be implemented by clients. *

* @see IWorkbench#getPerspectiveRegistry * @noimplement This interface is not intended to be implemented by clients. */ struct IPerspectiveRegistry { - virtual ~IPerspectiveRegistry() {} + virtual ~IPerspectiveRegistry(); /** * Clones an existing perspective. * * @param id the id for the cloned perspective, which must not already be used by * any registered perspective * @param label the label assigned to the cloned perspective * @param desc the perspective to clone * @return the cloned perspective descriptor * @throws IllegalArgumentException if there is already a perspective with the given id * * @since 3.0 */ virtual IPerspectiveDescriptor::Pointer ClonePerspective(const std::string& id, const std::string& label, IPerspectiveDescriptor::Pointer desc) = 0; /** * Deletes a perspective. Has no effect if the perspective is defined in an * extension. * * @param persp the perspective to delete * @since 3.2 */ virtual void DeletePerspective(IPerspectiveDescriptor::Pointer persp) = 0; /** * Finds and returns the registered perspective with the given perspective id. * * @param perspectiveId the perspective id * @return the perspective, or null if none * @see IPerspectiveDescriptor#getId */ virtual IPerspectiveDescriptor::Pointer FindPerspectiveWithId(const std::string& perspectiveId) = 0; /** * Finds and returns the registered perspective with the given label. * * @param label the label * @return the perspective, or null if none * @see IPerspectiveDescriptor#getLabel */ virtual IPerspectiveDescriptor::Pointer FindPerspectiveWithLabel(const std::string& label) = 0; /** * Returns the id of the default perspective for the workbench. This identifies one * perspective extension within the workbench's perspective registry. *

* Returns null if there is no default perspective. *

* * @return the default perspective id, or null */ virtual std::string GetDefaultPerspective() = 0; /** * Returns a list of the perspectives known to the workbench. * * @return a list of perspectives */ virtual std::vector GetPerspectives() = 0; /** * Sets the default perspective for the workbench to the given perspective id. * If non-null, the id must correspond to a perspective extension * within the workbench's perspective registry. *

* A null id indicates no default perspective. *

* * @param id a perspective id, or null */ virtual void SetDefaultPerspective(const std::string& id) = 0; /** * Reverts a perspective back to its original definition * as specified in the plug-in manifest. * * @param perspToRevert the perspective to revert * * @since 3.0 */ virtual void RevertPerspective(IPerspectiveDescriptor::Pointer perspToRevert) = 0; }; } #endif /*BERRYIPERSPECTIVEREGISTRY_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.cpp new file mode 100644 index 0000000000..3b08a6cc4a --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPlaceholderFolderLayout.h" + +namespace berry +{ + +IPlaceholderFolderLayout::~IPlaceholderFolderLayout() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.h index f2b41a09c1..ecee818d7d 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPlaceholderFolderLayout.h @@ -1,101 +1,101 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPLACEHOLDERFOLDERLAYOUT_H_ #define BERRYIPLACEHOLDERFOLDERLAYOUT_H_ #include #include #include namespace berry { /** * \ingroup org_blueberry_ui * * An IPlaceholderFolderLayout is used to define the initial * view placeholders within a folder. * The folder itself is contained within an IPageLayout. *

* This interface is not intended to be implemented by clients. *

* * @see IPageLayout#createPlaceholderFolder * @since 2.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IPlaceholderFolderLayout : public Object { berryInterfaceMacro(IPlaceholderFolderLayout, berry) - virtual ~IPlaceholderFolderLayout() {} + virtual ~IPlaceholderFolderLayout(); /** * Adds a view placeholder to this folder. * A view placeholder is used to define the position of a view before the view * appears. Initially, it is invisible; however, if the user ever opens a view * whose compound id matches the placeholder, the view will appear at the same * location as the placeholder. * See the {@link IPageLayout} type documentation for more details about compound ids. * If the placeholder contains wildcards, it remains in the layout, otherwise * it is replaced by the view. * If the primary id of the placeholder has no wildcards, it must refer to a view * contributed to the workbench's view extension point * (named "org.blueberry.ui.views"). * * @param viewId the compound view id (wildcards allowed) */ virtual void AddPlaceholder(const std::string& viewId) = 0; /** * Returns the property with the given id or null. Folder * properties are an extensible mechanism for perspective authors to * customize the appearance of view stacks. The list of customizable * properties is determined by the presentation factory. * * @param id * Must not be null. * @return property value, or null if the property is not * set. * @since 3.3 */ virtual std::string GetProperty(const std::string& id) = 0; /** * Sets the given property to the given value. Folder properties are an * extensible mechanism for perspective authors to customize the appearance * of view stacks. The list of customizable properties is determined by the * presentation factory. *

* These folder properties are intended to be set during * IPerspectiveFactory#createInitialLayout. Any subsequent * changes to property values after this method completes will not fire * change notifications and will not be reflected in the presentation. *

* * @param id * property id. Must not be null. * @param value * property value. null will clear the property. * @since 3.3 */ virtual void SetProperty(const std::string& id, const std::string& value) = 0; }; } #endif /*BERRYIPLACEHOLDERFOLDERLAYOUT_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.cpp new file mode 100644 index 0000000000..b38979b107 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPostSelectionProvider.h" + + +namespace berry { + +IPostSelectionProvider::~IPostSelectionProvider() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.h index 8679ed9021..92c9017e15 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPostSelectionProvider.h @@ -1,65 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPOSTSELECTIONPROVIDER_H_ #define BERRYIPOSTSELECTIONPROVIDER_H_ #include "berryISelectionProvider.h" namespace berry { /** * \ingroup org_blueberry_ui * * Selection provider extension interface to allow providers * to notify about post selection changed events. * A post selection changed event is equivalent to selection changed event * if the selection change was triggered by the mouse, but it has a delay * if the selection change is triggered by keyboard navigation. * * @see ISelectionProvider * * @since 3.0 */ struct BERRY_UI IPostSelectionProvider : public ISelectionProvider { - berryInterfaceMacro(IPostSelectionProvider, berry); + berryInterfaceMacro(IPostSelectionProvider, berry) + + ~IPostSelectionProvider(); /** * Adds a listener for post selection changes in this selection provider. * Has no effect if an identical listener is already registered. * * @param listener a selection changed listener */ virtual void AddPostSelectionChangedListener( ISelectionChangedListener::Pointer listener) = 0; /** * Removes the given listener for post selection changes from this selection * provider. * Has no affect if an identical listener is not registered. * * @param listener a selection changed listener */ virtual void RemovePostSelectionChangedListener( ISelectionChangedListener::Pointer listener) = 0; }; } #endif /*BERRYIPOSTSELECTIONPROVIDER_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.cpp new file mode 100644 index 0000000000..0cf5cf30c5 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPreferencePage.h" + + +namespace berry { + +IPreferencePage::~IPreferencePage() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.h index fab0f85fd0..43b164425c 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPreferencePage.h @@ -1,107 +1,109 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPREFERENCEPAGE_H_ #define BERRYIPREFERENCEPAGE_H_ #include "berryObject.h" #include "berryIPreferences.h" #include "berryIWorkbench.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * Interface for workbench preference pages. *

* Clients should implement this interface and include the name of their class * in an extension contributed to the workbench's preference extension point * (named "org.blueberry.ui.preferencePages"). * For example, the plug-in's XML markup might contain: *

  * <extension point="org.blueberry.ui.preferencePages">
  *      <page id="com.example.myplugin.prefs"
  *         name="Knobs"
  *         class="ns::MyPreferencePage" />
  * </extension>
  * 
*

*/ struct IPreferencePage: virtual public Object { berryInterfaceMacro(IPreferencePage, berry) + ~IPreferencePage(); + /** * Initializes this preference page for the given workbench. *

* This method is called automatically as the preference page is being created * and initialized. Clients must not call this method. *

* * @param workbench the workbench */ virtual void Init(IWorkbench::Pointer workbench) = 0; /** * Creates the top level control for this preference * page under the given parent widget. *

* Implementors are responsible for ensuring that * the created control can be accessed via GetControl *

* * @param parent the parent widget */ virtual void CreateControl(void* parent) = 0; /** * Returns the top level control for this dialog page. *

* May return null if the control * has not been created yet. *

* * @return the top level control or null */ virtual void* GetControl() const = 0; /// /// Invoked when the OK button was clicked in the preferences dialog /// virtual bool PerformOk() = 0; /// /// Invoked when the Cancel button was clicked in the preferences dialog /// virtual void PerformCancel() = 0; /// /// Invoked when the user performed an import. As the values of the preferences may have changed /// you should read all values again from the preferences service. /// virtual void Update() = 0; }; } Q_DECLARE_INTERFACE(berry::IPreferencePage, "org.blueberry.IPreferencePage") #endif /*BERRYIPREFERENCEPAGE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.cpp index 07acd737da..5bcd1161ca 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.cpp @@ -1,50 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIPropertyChangeListener.h" #include "berryIWorkbenchPartConstants.h" #include namespace berry { +IPropertyChangeListener::~IPropertyChangeListener() +{ +} + void IPropertyChangeListener::Events ::AddListener(IPropertyChangeListener::Pointer listener) { if (listener.IsNull()) return; this->propertyChange += Delegate(listener.GetPointer(), &IPropertyChangeListener::PropertyChange); } void IPropertyChangeListener::Events ::RemoveListener(IPropertyChangeListener::Pointer listener) { if (listener.IsNull()) return; this->propertyChange -= Delegate(listener.GetPointer(), &IPropertyChangeListener::PropertyChange); } void IPropertyChangeListener::PropertyChange(PropertyChangeEvent::Pointer event) { if (event->GetProperty() == IWorkbenchPartConstants::INTEGER_PROPERTY) { this->PropertyChange(event->GetSource(), event->GetNewValue().Cast()->GetValue()); } } } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.h index f33856d63d..0d41ef34e0 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPropertyChangeListener.h @@ -1,142 +1,140 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPROPERTYCHANGELISTENER_H_ #define BERRYIPROPERTYCHANGELISTENER_H_ #include #include #include #include "berryPropertyChangeEvent.h" namespace berry { /** * Listener for property changes. *

* Usage: *

  * IPropertyChangeListener listener =
  *   new IPropertyChangeListener() {
  *      public void propertyChange(PropertyChangeEvent event) {
  *         ... // code to deal with occurrence of property change
  *      }
  *   };
  * emitter.addPropertyChangeListener(listener);
  * ...
  * emitter.removePropertyChangeListener(listener);
  * 
*

*/ struct BERRY_UI IPropertyChangeListener: public virtual Object { berryInterfaceMacro(IPropertyChangeListener, berry); - virtual ~IPropertyChangeListener() - { - } + virtual ~IPropertyChangeListener(); struct BERRY_UI Events { typedef Message1 EventType; EventType propertyChange; void AddListener(IPropertyChangeListener::Pointer listener); void RemoveListener(IPropertyChangeListener::Pointer listener); private: typedef MessageDelegate1 Delegate; }; /** * Notification that a property has changed. *

* This method gets called when the observed object fires a property * change event. *

* * @param event the property change event object describing which property * changed and how */ virtual void PropertyChange(PropertyChangeEvent::Pointer event); virtual void PropertyChange(Object::Pointer /*source*/, int /*propId*/) {} }; template struct PropertyChangeAdapter: public IPropertyChangeListener { typedef R Listener; typedef void (R::*Callback)(PropertyChangeEvent::Pointer); PropertyChangeAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } using IPropertyChangeListener::PropertyChange; void PropertyChange(PropertyChangeEvent::Pointer event) { (listener->*callback)(event); } private: Listener* listener; Callback callback; }; template struct PropertyChangeIntAdapter: public IPropertyChangeListener { typedef R Listener; typedef void (R::*Callback)(Object::Pointer, int); PropertyChangeIntAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } using IPropertyChangeListener::PropertyChange; void PropertyChange(Object::Pointer source, int propId) { (listener->*callback)(source, propId); } private: Listener* listener; Callback callback; }; } #endif /* BERRYIPROPERTYCHANGELISTENER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.cpp new file mode 100644 index 0000000000..c423d1132b --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIReusableEditor.h" + +namespace berry +{ + +IReusableEditor::~IReusableEditor() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.h index 8b08096a69..5189d37c8e 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIReusableEditor.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIREUSABLEEDITOR_H_ #define BERRYIREUSABLEEDITOR_H_ #include "berryIEditorPart.h" #include "berryIEditorInput.h" namespace berry { /** * \ingroup org_blueberry_ui * * Interface for reusable editors. * * An editors may support changing its input so that * the workbench may change its contents instead of * opening a new editor. */ struct BERRY_UI IReusableEditor : public virtual IEditorPart { berryInterfaceMacro(IReusableEditor, berry) - virtual ~IReusableEditor() {} + virtual ~IReusableEditor(); /** * Sets the input to this editor. * *

Note: Clients must fire the {@link IEditorPart#PROP_INPUT } * property change within their implementation of * setInput().

* * @param input the editor input */ virtual void SetInput(IEditorInput::Pointer input) = 0; }; } #endif /*BERRYIREUSABLEEDITOR_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.cpp new file mode 100644 index 0000000000..cf7e6b695d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryISaveablesSource.h" + + +namespace berry { + +ISaveablesSource::~ISaveablesSource() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.h index bd63bfc35f..1e280bac1b 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISaveablesSource.h @@ -1,122 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISAVEABLESSOURCE_H_ #define BERRYISAVEABLESSOURCE_H_ #include #include #include "berrySaveable.h" namespace berry { /** * Represents a source of Saveable objects (units of saveability). Workbench * parts that show more than one unit of saveability, or whose units of * saveability change over time, should implement this interface in order to * provide better integration with workbench facilities like the Save command, * prompts to save on part close or shutdown, etc. *

* IMPORTANT: As of 3.2, implementers of ISaveablesSource must * satisfy the following conditions: *

    *
  • If ISaveablesSource is implemented by an IWorkbenchPart: *
      *
    • the part must implement ISaveablePart
    • *
    • if any of its Saveable objects are dirty, the part must return * true from {@link ISaveablePart#isDirty()}
    • *
    • the part must return true from * {@link ISaveablePart#isSaveOnCloseNeeded()} if it is dirty (the default * behaviour implemented by {@link EditorPart})
    • *
    • the part must not implement {@link ISaveablePart2}
    • *
    *
  • *
  • If ISaveablesSource is implemented by a non-part (possible as of 3.2.1 and 3.3): *
      *
    • the Workbench's {@link ISaveablesLifecycleListener} (obtained from the * Workbench by calling * workbench.getService(ISaveablesLifecycleListener.class)) must * be notified of any change to the result of {@link #getSaveables()}
    • *
    • getActiveSaveables() should be implemented to return an empty array *
    • *
    *
* If any of these conditions are not met, it is undefined whether the Workbench * will prompt to save dirty Saveables when closing parts or the Workbench. *

*

* These conditions may be relaxed in future releases. *

* * @since 3.2 */ struct BERRY_UI ISaveablesSource : public virtual Object { - berryInterfaceMacro(ISaveablesSource, berry); + berryInterfaceMacro(ISaveablesSource, berry) + + ~ISaveablesSource(); /** * Returns the saveables presented by the workbench part. If the return * value of this method changes during the lifetime of * this part (i.e. after initialization and control creation but before disposal) * the part must notify an implicit listener using * {@link ISaveablesLifecycleListener#handleLifecycleEvent(SaveablesLifecycleEvent)}. *

* Additions of saveables to the list of saveables of this part are * announced using an event of type * {@link SaveablesLifecycleEvent#POST_OPEN}. Removals are announced in a * two-stage process, first using an event of type * {@link SaveablesLifecycleEvent#PRE_CLOSE} followed by an event of type * {@link SaveablesLifecycleEvent#POST_CLOSE}. Since firing the * PRE_CLOSE event may trigger prompts to save dirty * saveables, the cancellation status of the event must be checked by the * part after the notification. When removing only non-dirty saveables, * POST_CLOSE notification is sufficient. *

*

* The listener is obtained from the part site by calling * partSite.getService(ISaveablesLifecycleListener.class). *

*

* The part must not notify from its initialization methods (e.g. init * or createPartControl), or from its dispose method. Parts that * implement {@link IReusableEditor} must notify when their input is changed * through {@link IReusableEditor#setInput(IEditorInput)}. *

* * @return the saveables presented by the workbench part * * @see ISaveablesLifecycleListener */ virtual std::vector GetSaveables() = 0; /** * Returns the saveables currently active in the workbench part. *

* Certain workbench actions, such as Save, target only the active saveables * in the active part. For example, the active saveables could be determined * based on the current selection in the part. *

* * @return the saveables currently active in the workbench part */ virtual std::vector GetActiveSaveables() = 0; }; } #endif /* BERRYISAVEABLESSOURCE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.cpp new file mode 100644 index 0000000000..5e34a30950 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryISelection.h" + + +namespace berry { + +ISelection::~ISelection() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.h index ab04e9b4fd..f49838585a 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelection.h @@ -1,53 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISELECTION_H_ #define BERRYISELECTION_H_ #include #include #include namespace berry { /** * \ingroup org_blueberry_ui * * Interface for a selection. * * @see ISelectionProvider * @see ISelectionChangedListener * @see SelectionChangedEvent * **/ struct ISelection : public Object { - berryInterfaceMacro(ISelection, berry); + berryInterfaceMacro(ISelection, berry) + + ~ISelection(); /** * Returns whether this selection is empty. * * @return true if this selection is empty, * and false otherwise */ virtual bool IsEmpty() const = 0; }; } #endif /*BERRYISELECTION_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.cpp new file mode 100644 index 0000000000..caa9ed7867 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryISelectionProvider.h" + + +namespace berry { + +ISelectionProvider::~ISelectionProvider() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.h index 85fe5a918a..dce3da6c98 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionProvider.h @@ -1,75 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISELECTIONPROVIDER_H_ #define BERRYISELECTIONPROVIDER_H_ #include #include "berryISelectionChangedListener.h" #include "berryISelection.h" namespace berry { /** * \ingroup org_blueberry_ui * * Interface common to all objects that provide a selection. * * @see ISelection * @see ISelectionChangedListener * @see SelectionChangedEvent */ struct BERRY_UI ISelectionProvider : public virtual Object { - berryInterfaceMacro(ISelectionProvider, berry); + berryInterfaceMacro(ISelectionProvider, berry) + + ~ISelectionProvider(); /** * Adds a listener for selection changes in this selection provider. * Has no effect if an identical listener is already registered. * * @param listener a selection changed listener */ virtual void AddSelectionChangedListener(ISelectionChangedListener::Pointer listener) = 0; /** * Returns the current selection for this provider. * * @return the current selection */ virtual ISelection::ConstPointer GetSelection() const = 0; /** * Removes the given selection change listener from this selection provider. * Has no affect if an identical listener is not registered. * * @param listener a selection changed listener */ virtual void RemoveSelectionChangedListener( ISelectionChangedListener::Pointer listener) = 0; /** * Sets the current selection for this selection provider. * * @param selection the new selection */ virtual void SetSelection(ISelection::Pointer selection) = 0; }; } #endif /*BERRYISELECTIONPROVIDER_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.cpp new file mode 100644 index 0000000000..3a355f3412 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryISelectionService.h" + +namespace berry +{ + +ISelectionService::~ISelectionService() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.h index 1faa42f2bf..76c5e1f380 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISelectionService.h @@ -1,183 +1,183 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISELECTIONSERVICE_H_ #define BERRYISELECTIONSERVICE_H_ #include #include "berryISelection.h" #include "berryISelectionListener.h" #include "berryIWorkbenchPart.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * A selection service tracks the selection within an object. *

* A listener that wants to be notified when the selection becomes * null must implement the INullSelectionListener * interface. *

*

* This interface is not intended to be implemented by clients. *

* @see org.blueberry.ui.ISelectionListener * @see org.blueberry.ui.INullSelectionListener */ struct BERRY_UI ISelectionService { struct SelectionEvents { typedef Message2 SelectionEvent; typedef MessageDelegate2 Delegate; SelectionEvent selectionChanged; SelectionEvent postSelectionChanged; }; - virtual ~ISelectionService() {} + virtual ~ISelectionService(); //virtual SelectionEvents& GetSelectionEvents(const std::string& partId = "") = 0; /** * Adds the given selection listener. * Has no effect if an identical listener is already registered. * * @param listener a selection listener */ virtual void AddSelectionListener(ISelectionListener::Pointer listener) = 0; /** * Adds a part-specific selection listener which is notified when selection changes * in the part with the given id. This is independent of part activation - the part * need not be active for notification to be sent. *

* When the part is created, the listener is passed the part's initial selection. * When the part is disposed, the listener is passed a null selection, * but only if the listener implements INullSelectionListener. *

*

* Note: This will not correctly track editor parts as each editor does * not have a unique partId. *

* * @param partId the id of the part to track * @param listener a selection listener * @since 2.0 */ virtual void AddSelectionListener(const std::string& partId, ISelectionListener::Pointer listener) = 0; /** * Adds the given post selection listener.It is equivalent to selection * changed if the selection was triggered by the mouse but it has a * delay if the selection is triggered by the keyboard arrows. * Has no effect if an identical listener is already registered. * * Note: Works only for StructuredViewer(s). * * @param listener a selection listener */ virtual void AddPostSelectionListener(ISelectionListener::Pointer listener) = 0; /** * Adds a part-specific selection listener which is notified when selection changes * in the part with the given id. This is independent of part activation - the part * need not be active for notification to be sent. *

* When the part is created, the listener is passed the part's initial selection. * When the part is disposed, the listener is passed a null selection, * but only if the listener implements INullSelectionListener. *

*

* Note: This will not correctly track editor parts as each editor does * not have a unique partId. *

* * @param partId the id of the part to track * @param listener a selection listener * @since 2.0 */ virtual void AddPostSelectionListener(const std::string& partId, ISelectionListener::Pointer listener) = 0; /** * Returns the current selection in the active part. If the selection in the * active part is undefined (the active part has no selection provider) * the result will be null. * * @return the current selection, or null if undefined */ virtual ISelection::ConstPointer GetSelection() const = 0; /** * Returns the current selection in the part with the given id. If the part is not open, * or if the selection in the active part is undefined (the active part has no selection provider) * the result will be null. * * @param partId the id of the part * @return the current selection, or null if undefined * @since 2.0 */ virtual ISelection::ConstPointer GetSelection(const std::string& partId) = 0; /** * Removes the given selection listener. * Has no effect if an identical listener is not registered. * * @param listener a selection listener */ virtual void RemoveSelectionListener(ISelectionListener::Pointer listener) = 0; /** * Removes the given part-specific selection listener. * Has no effect if an identical listener is not registered for the given part id. * * @param partId the id of the part to track * @param listener a selection listener * @since 2.0 */ virtual void RemoveSelectionListener(const std::string& partId, ISelectionListener::Pointer listener) = 0; /** * Removes the given post selection listener. * Has no effect if an identical listener is not registered. * * @param listener a selection listener */ virtual void RemovePostSelectionListener(ISelectionListener::Pointer listener) = 0; /** * Removes the given part-specific post selection listener. * Has no effect if an identical listener is not registered for the given part id. * * @param partId the id of the part to track * @param listener a selection listener * @since 2.0 */ virtual void RemovePostSelectionListener(const std::string& partId, ISelectionListener::Pointer listener) = 0; }; } // namespace berry #endif /*BERRYISELECTIONSERVICE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.cpp new file mode 100644 index 0000000000..a2917f01ec --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIShellProvider.h" + + +namespace berry { + +IShellProvider::~IShellProvider() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.h index 34768ac09c..f5f712d762 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIShellProvider.h @@ -1,51 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISHELLPROVIDER_H_ #define BERRYISHELLPROVIDER_H_ #include #include "berryShell.h" #include namespace berry { /** * Interface for objects that can return a shell. This is normally used for * opening child windows. An object that wants to open child shells can take * an IShellProvider in its constructor, and the object that implements IShellProvider * can dynamically choose where child shells should be opened. * * @since 3.1 */ struct BERRY_UI IShellProvider : public virtual Object { berryInterfaceMacro(IShellProvider, berry); + ~IShellProvider(); + /** * Returns the current shell (or null if none). This return value may * change over time, and should not be cached. * * @return the current shell or null if none */ virtual Shell::Pointer GetShell() = 0; }; } #endif /* BERRYISHELLPROVIDER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.cpp new file mode 100644 index 0000000000..6ed390614b --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryISourceProvider.h" + + +namespace berry { + +ISourceProvider::~ISourceProvider() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.h index 2fa8bd1dd5..552210650d 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryISourceProvider.h @@ -1,105 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISOURCEPROVIDER_H_ #define BERRYISOURCEPROVIDER_H_ #include #include "berryISourceProviderListener.h" #include #include #include #include namespace berry { /** *

* A provider of notifications for when a change has occurred to a particular * type of source. These providers can be given to the appropriate service, and * this service will then re-evaluate the appropriate pieces of its internal * state in response to these changes. *

*

* It is recommended that clients subclass AbstractSourceProvider * instead, as this provides some common support for listeners. *

* * @since 3.1 * @see org.blueberry.ui.handlers.IHandlerService * @see org.blueberry.ui.ISources */ struct BERRY_UI ISourceProvider : public virtual Object { berryInterfaceMacro(ISourceProvider, berry); typedef std::map StateMapType; + ~ISourceProvider(); + /** * Adds a listener to this source provider. This listener will be notified * whenever the corresponding source changes. * * @param listener * The listener to add; must not be null. */ virtual void AddSourceProviderListener(ISourceProviderListener::Pointer listener) = 0; /** * Returns the current state of the sources tracked by this provider. This * is used to provide a view of the world if the event loop is busy and * things are some state has already changed. *

* For use with core expressions, this map should contain * IEvaluationContext#UNDEFINED_VARIABLE for properties which * are only sometimes available. *

* * @return A map of variable names (String) to variable * values (Object). This may be empty, and may be * null. */ virtual StateMapType GetCurrentState() = 0; /** * Returns the names of those sources provided by this class. This is used * by clients of source providers to determine which source providers they * actually need. * * @return An array of source names. This value should never be * null or empty. */ virtual std::vector GetProvidedSourceNames() = 0; /** * Removes a listener from this source provider. This listener will be * notified whenever the corresponding source changes. * * @param listener * The listener to remove; must not be null. */ virtual void RemoveSourceProviderListener(ISourceProviderListener::Pointer listener) = 0; }; } Q_DECLARE_INTERFACE(berry::ISourceProvider, "org.blueberry.ISourceProvider") #endif /* BERRYISOURCEPROVIDER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.cpp new file mode 100644 index 0000000000..eb84661ecd --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIStickyViewDescriptor.h" + +namespace berry { + +IStickyViewDescriptor::~IStickyViewDescriptor() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.h index ffbe572813..e22c072a65 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIStickyViewDescriptor.h @@ -1,77 +1,79 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISTICKYVIEWDESCRIPTOR_H_ #define BERRYISTICKYVIEWDESCRIPTOR_H_ #include #include #include namespace berry { /** * Supplemental view interface that describes various sticky characteristics * that a view may possess. *

* This interface is not intended to be implemented by clients. *

* * @see org.eclipse.ui.views.IViewRegistry * @see org.eclipse.ui.views.IViewDescriptor * @since 3.1 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IStickyViewDescriptor : public Object { berryObjectMacro(IStickyViewDescriptor) + ~IStickyViewDescriptor(); + /** * Return the id of the view to be made sticky. * * @return the id of the view to be made sticky */ virtual std::string GetId() const = 0; /** * Return the location of this sticky view. Must be one of * IPageLayout.LEFT, IPageLayout.RIGHT, * IPageLayout.TOP, or IPageLayout.BOTTOM. * * @return the location constant */ virtual int GetLocation() const = 0; /** * Return whether this view should be closeable. * * @return whether this view should be closeeable */ virtual bool IsCloseable() const = 0; /** * Return whether this view should be moveable. * * @return whether this view should be moveable */ virtual bool IsMoveable() const = 0; }; } #endif /* BERRYISTICKYVIEWDESCRIPTOR_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.cpp new file mode 100644 index 0000000000..b0b070729b --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewCategory.h" + +namespace berry +{ + +IViewCategory::~IViewCategory() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.h index e5ce20b99d..1ac673083f 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewCategory.h @@ -1,46 +1,46 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWCATEGORY_H_ #define BERRYIVIEWCATEGORY_H_ #include "berryIViewDescriptor.h" #include #include namespace berry { /** * \ingroup org_blueberry_ui * */ struct BERRY_UI IViewCategory : public Object { berryInterfaceMacro(IViewCategory, berry) virtual const std::string& GetId() const = 0; virtual std::string GetLabel() const = 0; virtual std::vector GetPath() const = 0; virtual const std::vector& GetViews() const = 0; - virtual ~IViewCategory() {} + virtual ~IViewCategory(); }; } #endif /*BERRYIVIEWCATEGORY_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.cpp new file mode 100644 index 0000000000..0bd88bfb0d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewDescriptor.h" + + +namespace berry { + +IViewDescriptor::~IViewDescriptor() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.h index 7726f5ba05..b82e02a9c0 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewDescriptor.h @@ -1,105 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWDESCRIPTOR_H_ #define BERRYIVIEWDESCRIPTOR_H_ #include #include "berryIWorkbenchPartDescriptor.h" #include "berryIViewPart.h" #include #include #include "berryImageDescriptor.h" #include #include namespace berry { /** * \ingroup org_blueberry_ui * * This is a view descriptor. It provides a "description" of a given * given view so that the view can later be constructed. *

* The view registry provides facilities to map from an extension * to a IViewDescriptor. *

*

* This interface is not intended to be implemented by clients. *

* * @see org.blueberry.ui.IViewRegistry */ struct BERRY_UI IViewDescriptor : public IWorkbenchPartDescriptor, public IAdaptable { berryInterfaceMacro(IViewDescriptor, berry); + ~IViewDescriptor(); + /** * Creates an instance of the view defined in the descriptor. * * @return the view part * @throws CoreException thrown if there is a problem creating the part */ virtual IViewPart::Pointer CreateView() = 0; /** * Returns an array of strings that represent * view's category path. This array will be used * for hierarchical presentation of the * view in places like submenus. * @return array of category tokens or null if not specified. */ virtual const std::vector& GetCategoryPath() const = 0; /** * Returns the description of this view. * * @return the description */ virtual std::string GetDescription() const = 0; /** * Returns the descriptor for the icon to show for this view. */ virtual SmartPointer GetImageDescriptor() const = 0; /** * Returns whether this view allows multiple instances. * * @return whether this view allows multiple instances */ virtual bool GetAllowMultiple() const = 0; /** * Returns whether this view can be restored upon workbench restart. * * @return whether whether this view can be restored upon workbench restart */ virtual bool IsRestorable() const = 0; virtual bool operator==(const Object*) const = 0; }; } #endif /*BERRYIVIEWDESCRIPTOR_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.cpp new file mode 100644 index 0000000000..7a245aab7d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewLayout.h" + +namespace berry +{ + +IViewLayout::~IViewLayout () +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.h index 0dfecc5b91..076f88ff19 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewLayout.h @@ -1,90 +1,92 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWLAYOUT_H_ #define BERRYIVIEWLAYOUT_H_ +#include + #include #include namespace berry { /** * \ingroup org_blueberry_ui * * Represents the layout info for a view or placeholder in an {@link IPageLayout}. *

* This interface is not intended to be implemented by clients. *

* * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IViewLayout : public Object { berryInterfaceMacro(IViewLayout, berry) - virtual ~IViewLayout() {} + virtual ~IViewLayout(); /** * Returns whether the view is closeable. * The default is true. * * @return true if the view is closeable, false if not */ virtual bool IsCloseable() = 0; /** * Sets whether the view is closeable. * * @param closeable true if the view is closeable, false if not */ virtual void SetCloseable(bool closeable) = 0; /** * Returns whether the view is moveable. * The default is true. * * @return true if the view is moveable, false if not */ virtual bool IsMoveable() = 0; /** * Sets whether the view is moveable. * * @param moveable true if the view is moveable, false if not */ virtual void SetMoveable(bool moveable) = 0; /** * Returns whether the view is a standalone view. * * @see IPageLayout#addStandaloneView */ virtual bool IsStandalone() = 0; /** * Returns whether the view shows its title. * This is only applicable to standalone views. * * @see IPageLayout#addStandaloneView */ virtual bool GetShowTitle() = 0; }; } #endif /*BERRYIVIEWLAYOUT_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.cpp new file mode 100644 index 0000000000..92379fbf41 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewPart.h" + +namespace berry +{ + +IViewPart::~IViewPart() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.h index 2531190b54..c412b95a4c 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewPart.h @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWPART_H_ #define BERRYIVIEWPART_H_ #include #include "berryMacros.h" #include "berryIMemento.h" #include "berryIWorkbenchPart.h" #include "berryIViewSite.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * A view is a visual component within a workbench page. It is typically used to * navigate a hierarchy of information (like the workspace), open an editor, or * display properties for the active editor. Modifications made in a view are * saved immediately (in contrast to an editor part, which conforms to a more * elaborate open-save-close lifecycle). *

* Only one instance of a particular view type may exist within a workbench * page. This policy is designed to simplify part management for a user. *

*

* This interface may be implemented directly. For convenience, a base * implementation is defined in ViewPart. *

*

* A view is added to the workbench in two steps: *

    *
  1. A view extension is contributed to the workbench registry. This * extension defines the extension id and extension class.
  2. *
  3. The view is included in the default layout for a perspective. * Alternatively, the user may open the view from the Perspective menu.
  4. *
*

*

* Views implement the IAdaptable interface; extensions are * managed by the platform's adapter manager. *

*

* As of 3.4, views may optionally adapt to {@link ISizeProvider} if they have * a preferred size. The default presentation will make a best effort to * allocate the preferred size to a view if it is the only part in a stack. If * there is more than one part in the stack, the constraints will be disabled * for that stack. The size constraints are adjusted for the size of the tab and * border trim. Note that this is considered to be a hint to the presentation, * and not all presentations may honor size constraints. *

* * @see IWorkbenchPage#showView * @see org.blueberry.ui.part.ViewPart * @see ISizeProvider */ struct BERRY_UI IViewPart : public virtual IWorkbenchPart { berryInterfaceMacro(IViewPart, berry) - virtual ~IViewPart() {} + virtual ~IViewPart(); /** * Returns the site for this view. * This method is equivalent to (IViewSite) getSite(). *

* The site can be null while the view is being initialized. * After the initialization is complete, this value must be non-null * for the remainder of the view's life cycle. *

* * @return the view site; this value may be null if the view * has not yet been initialized */ virtual IViewSite::Pointer GetViewSite() = 0; /** * Initializes this view with the given view site. A memento is passed to * the view which contains a snapshot of the views state from a previous * session. Where possible, the view should try to recreate that state * within the part controls. *

* This method is automatically called by the workbench shortly after the part * is instantiated. It marks the start of the views's lifecycle. Clients must * not call this method. *

* * @param site the view site * @param memento the IViewPart state or null if there is no previous saved state * @exception PartInitException if this view was not initialized successfully */ virtual void Init(IViewSite::Pointer site, IMemento::Pointer memento = IMemento::Pointer(0)) = 0; /** * Saves the object state within a memento. * * @param memento a memento to receive the object state */ virtual void SaveState(IMemento::Pointer memento) = 0; }; } Q_DECLARE_INTERFACE(berry::IViewPart, "org.blueberry.IViewPart") #endif /*BERRYIVIEWPART_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.cpp new file mode 100644 index 0000000000..fbefa6339e --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewReference.h" + + +namespace berry { + +IViewReference::~IViewReference() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.h index 7f07097dbf..32d418c651 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewReference.h @@ -1,58 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWREFERENCE_H_ #define BERRYIVIEWREFERENCE_H_ #include "berryIWorkbenchPartReference.h" #include "berryIViewPart.h" namespace berry { /** * \ingroup org_blueberry_ui * * Defines a reference to an IViewPart. *

* This interface is not intended to be implemented by clients. *

*/ struct BERRY_UI IViewReference : virtual public IWorkbenchPartReference { berryInterfaceMacro(IViewReference, berry); + ~IViewReference(); + /** * Returns the secondary ID for the view. * * @return the secondary ID, or null if there is no secondary id * @see IWorkbenchPage#showView(String, String, int) * @since 3.0 */ virtual std::string GetSecondaryId() = 0; /** * Returns the IViewPart referenced by this object. * Returns null if the view was not instantiated or * it failed to be restored. Tries to restore the view * if restore is true. */ virtual IViewPart::Pointer GetView(bool restore) = 0; }; } // namespace berry #endif /*BERRYIVIEWREFERENCE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.cpp new file mode 100644 index 0000000000..9f2940652f --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewRegistry.h" + +namespace berry +{ + +IViewRegistry::~IViewRegistry() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.h index 2521639e12..9105e1ad8e 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewRegistry.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWREGISTRY_H_ #define BERRYIVIEWREGISTRY_H_ #include #include "berryIViewDescriptor.h" #include "berryIViewCategory.h" #include "berryIStickyViewDescriptor.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * The view registry maintains a list of views explicitly registered * against the view extension point. *

* The description of a given view is kept in a IViewDescriptor. *

*

* This interface is not intended to be implemented by clients. *

* * @see IViewDescriptor * @see IStickyViewDescriptor * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IViewRegistry { /** * Return a view descriptor with the given extension id. If no view exists * with the id return null. * Will also return null if the view descriptor exists, but * is filtered by an expression-based activity. * * @param id the id to search for * @return the descriptor or null */ virtual IViewDescriptor::Pointer Find(const std::string& id) const = 0; /** * Returns an array of view categories. * * @return the categories. */ virtual std::vector GetCategories() = 0; /** * Return a list of views defined in the registry. * * @return the views. */ virtual const std::vector& GetViews() const = 0; /** * Return a list of sticky views defined in the registry. * * @return the sticky views. Never null. */ virtual std::vector GetStickyViews() const = 0; - virtual ~IViewRegistry() {} + virtual ~IViewRegistry(); }; } #endif /*BERRYIVIEWREGISTRY_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.cpp new file mode 100644 index 0000000000..29b25a9681 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIViewSite.h" + +namespace berry +{ + +IViewSite::~IViewSite() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.h index a381318992..771de796ce 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIViewSite.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIVIEWSITE_H_ #define BERRYIVIEWSITE_H_ #include "berryIWorkbenchPartSite.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * The primary interface between a view part and the workbench. *

* The workbench exposes its implemention of view part sites via this interface, * which is not intended to be implemented or extended by clients. *

* @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IViewSite : public virtual IWorkbenchPartSite { berryInterfaceMacro(IViewSite, berry) - virtual ~IViewSite() {} + virtual ~IViewSite(); /** * Returns the action bars for this part site. * Views have exclusive use of their site's action bars. * * @return the action bars */ //IActionBars getActionBars(); /** * Returns the secondary id for this part site's part, * or null if it has none. * * @see IWorkbenchPage#showView(String, String, int) * @since 3.0 */ virtual std::string GetSecondaryId() = 0; }; } #endif /*BERRYIVIEWSITE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.cpp new file mode 100644 index 0000000000..c0c70880d9 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbench.h" + +namespace berry +{ + +IWorkbench::~IWorkbench() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.h index 1292966164..ab665654af 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbench.h @@ -1,400 +1,400 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCH_H_ #define BERRYIWORKBENCH_H_ #include #include "services/berryIServiceLocator.h" #include "dialogs/berryIDialog.h" #include "berryIViewRegistry.h" #include "berryIEditorRegistry.h" #include "intro/berryIIntroManager.h" #include "berryIPerspectiveRegistry.h" #include "berryIWorkbenchWindow.h" #include "berryIWorkbenchListener.h" #include "berryIWindowListener.h" #include "berryDisplay.h" namespace berry { struct IWorkbenchPage; /** * \ingroup org_blueberry_ui * * A workbench is the root object for the BlueBerry Platform user interface. *

* A workbench has one or more main windows which present to the end * user information based on some underlying model, typically on resources in an * underlying workspace. A workbench usually starts with a single open window, * and automatically closes when its last window closes. *

*

* Each workbench window has a collection of pages; the active * page is the one that is being presented to the end user; at most one page is * active in a window at a time. *

*

* Each workbench page has a collection of workbench parts, of which * there are two kinds: views and editors. A page's parts are arranged (tiled or * stacked) for presentation on the screen. The arrangement is not fixed; the * user can arrange the parts as they see fit. A perspective is a * template for a page, capturing a collection of parts and their arrangement. *

*

* The platform creates a workbench when the workbench plug-in is activated; * since this happens at most once during the life of the running platform, * there is only one workbench instance. Due to its singular nature, it is * commonly referred to as the workbench. *

*

* The workbench supports a few {@link IServiceLocator services} by default. If * these services are used to allocate resources, it is important to remember to * clean up those resources after you are done with them. Otherwise, the * resources will exist until the workbench shuts down. The supported services * are: *

*
    *
  • {@link IBindingService}
  • *
  • {@link ICommandService}
  • *
  • {@link IContextService}
  • *
  • {@link IHandlerService}
  • *
*

* This interface is not intended to be implemented by clients. *

* * @see PlatformUI#getWorkbench * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IWorkbench : public IServiceLocator { berryInterfaceMacro(IWorkbench, berry) - virtual ~IWorkbench() {} + virtual ~IWorkbench(); /** * Returns the display for this workbench. *

* Code should always ask the workbench for the display rather than rely on * {@link Display#getDefault Display.getDefault()}. *

* * @return the display to be used for all UI interactions with this * workbench */ virtual Display* GetDisplay() = 0; /** * Adds a workbench listener. * * @param listener * the workbench listener to add * @since 3.2 */ virtual void AddWorkbenchListener(IWorkbenchListener::Pointer listener) = 0; /** * Removes a workbench listener. * * @param listener * the workbench listener to remove * @since 3.2 */ virtual void RemoveWorkbenchListener(IWorkbenchListener::Pointer listener) = 0; /** * Returns the workbench events object */ virtual IWorkbenchListener::Events& GetWorkbenchEvents() = 0; /** * Adds a window listener. * * @param listener * the window listener to add * @since 2.0 */ virtual void AddWindowListener(IWindowListener::Pointer listener) = 0; /** * Removes a window listener. * * @param listener * the window listener to remove * @since 2.0 */ virtual void RemoveWindowListener(IWindowListener::Pointer listener) = 0; /** * Returns the window events object * */ virtual IWindowListener::Events& GetWindowEvents() = 0; /** * Closes this workbench and all its open windows. *

* If the workbench has an open editor with unsaved content, the user will * be given the opportunity to save it. *

* * @return true if the workbench was successfully closed, and * false if it is still open */ virtual bool Close() = 0; /** * Returns the currently active window for this workbench (if any). Returns * null if there is no active workbench window. Returns * null if called from a non-UI thread. * * @return the active workbench window, or null if there is * no active workbench window or if called from a non-UI thread */ virtual IWorkbenchWindow::Pointer GetActiveWorkbenchWindow() = 0; /** * Returns the perspective registry for the workbench. * * @return the workbench perspective registry */ virtual IPerspectiveRegistry* GetPerspectiveRegistry() = 0; /** * Returns the view registry for the workbench. * * @return the workbench view registry * @since 3.1 */ virtual IViewRegistry* GetViewRegistry() = 0; /** * Returns the editor registry for the workbench. * * @return the workbench editor registry */ virtual IEditorRegistry* GetEditorRegistry() = 0; /** * Returns the number of open main windows associated with this workbench. * Note that wizards and dialogs are not included in this list since they * are not considered main windows. * * @return the number of open windows * @since 3.0 */ virtual std::size_t GetWorkbenchWindowCount() = 0; /** * Returns a list of the open main windows associated with this workbench. * Note that wizards and dialogs are not included in this list since they * are not considered main windows. * * @return a list of open windows */ virtual std::vector GetWorkbenchWindows() = 0; /** * Creates and opens a new workbench window with one page. The perspective * of the new page is defined by the specified perspective ID. The new * window and new page become active. *

* Note: The caller is responsible to ensure the action using this * method will explicitly inform the user a new window will be opened. * Otherwise, callers are strongly recommended to use the * openPerspective APIs to programmatically show a * perspective to avoid confusing the user. *

*

* In most cases where this method is used the caller is tightly coupled to * a particular perspective. They define it in the registry and contribute * some user interface action to open or activate it. In situations like * this a static variable is often used to identify the perspective ID. *

* * @param perspectiveId * the perspective id for the window's initial page, or * null for no initial page * @param input * the page input, or null if there is no current * input. This is used to seed the input for the new page's * views. * @return the new workbench window * @exception WorkbenchException * if a new window and page could not be opened * * @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable) */ virtual IWorkbenchWindow::Pointer OpenWorkbenchWindow(const std::string& perspectiveId, IAdaptable* input) = 0; /** * Creates and opens a new workbench window with one page. The perspective * of the new page is defined by the default perspective ID. The new window * and new page become active. *

* Note: The caller is responsible to ensure the action using this * method will explicitly inform the user a new window will be opened. * Otherwise, callers are strongly recommended to use the * openPerspective APIs to programmatically show a * perspective to avoid confusing the user. *

* * @param input * the page input, or null if there is no current * input. This is used to seed the input for the new page's * views. * @return the new workbench window * @exception WorkbenchException * if a new window and page could not be opened * * @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable) */ virtual IWorkbenchWindow::Pointer OpenWorkbenchWindow(IAdaptable* input) = 0; /** * Shows the specified perspective to the user. The caller should use this * method when the perspective to be shown is not dependent on the page's * input. That is, the perspective can open in any page depending on user * preferences. *

* The perspective may be shown in the specified window, in another existing * window, or in a new window depending on user preferences. The exact * policy is controlled by the workbench to ensure consistency to the user. * The policy is subject to change. The current policy is as follows: *

    *
  • If the specified window has the requested perspective open, then the * window is given focus and the perspective is shown. The page's input is * ignored.
  • *
  • If another window that has the workspace root as input and the * requested perspective open and active, then the window is given focus. *
  • *
  • Otherwise the requested perspective is opened and shown in the * specified window or in a new window depending on the current user * preference for opening perspectives, and that window is given focus. *
  • *
*

*

* The workbench also defines a number of menu items to activate or open * each registered perspective. A complete list of these perspectives is * available from the perspective registry found on IWorkbench. *

* * @param perspectiveId * the perspective ID to show * @param window * the workbench window of the action calling this method. * @return the workbench page that the perspective was shown * @exception WorkbenchException * if the perspective could not be shown * * @since 2.0 */ virtual SmartPointer ShowPerspective(const std::string& perspectiveId, IWorkbenchWindow::Pointer window) = 0; /** * Shows the specified perspective to the user. The caller should use this * method when the perspective to be shown is dependent on the page's input. * That is, the perspective can only open in any page with the specified * input. *

* The perspective may be shown in the specified window, in another existing * window, or in a new window depending on user preferences. The exact * policy is controlled by the workbench to ensure consistency to the user. * The policy is subject to change. The current policy is as follows: *

    *
  • If the specified window has the requested perspective open and the * same requested input, then the window is given focus and the perspective * is shown.
  • *
  • If another window has the requested input and the requested * perspective open and active, then that window is given focus.
  • *
  • If the specified window has the same requested input but not the * requested perspective, then the window is given focus and the perspective * is opened and shown on condition that the user preference is not to open * perspectives in a new window.
  • *
  • Otherwise the requested perspective is opened and shown in a new * window, and the window is given focus.
  • *
*

*

* The workbench also defines a number of menu items to activate or open * each registered perspective. A complete list of these perspectives is * available from the perspective registry found on IWorkbench. *

* * @param perspectiveId * the perspective ID to show * @param window * the workbench window of the action calling this method. * @param input * the page input, or null if there is no current * input. This is used to seed the input for the page's views * @return the workbench page that the perspective was shown * @exception WorkbenchException * if the perspective could not be shown * * @since 2.0 */ virtual SmartPointer ShowPerspective(const std::string& perspectiveId, IWorkbenchWindow::Pointer window, IAdaptable* input) = 0; /** * Save all dirty editors in the workbench. Opens a dialog to prompt the * user if confirm is true. Return true if successful. Return * false if the user has canceled the command. * * @param confirm true to ask the user before saving unsaved * changes (recommended), and false to save * unsaved changes without asking * @return true if the command succeeded, and * false if the operation was canceled by the user or * an error occurred while saving */ virtual bool SaveAllEditors(bool confirm) = 0; /** * Return the intro manager for this workbench. * * @return the intro manager for this workbench. Guaranteed not to be * null. */ virtual IIntroManager* GetIntroManager() = 0; /** * Returns a boolean indicating whether the workbench is in the process of * closing. * * @return true if the workbench is in the process of * closing, false otherwise * @since 3.1 */ virtual bool IsClosing() = 0; /** * Applies changes of the current theme to the user interface. */ virtual void UpdateTheme() = 0; }; } #endif /*BERRYIWORKBENCH_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.cpp index 0b11d4e215..324a2e7049 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.cpp @@ -1,55 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIWorkbenchPage.h" namespace berry { const std::string IWorkbenchPage::EDITOR_ID_ATTR = "org.blueberry.ui.editorID"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_RESET = "reset"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_RESET_COMPLETE = "resetComplete"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_VIEW_SHOW = "viewShow"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_VIEW_HIDE = "viewHide"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_EDITOR_OPEN = "editorOpen"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_EDITOR_CLOSE = "editorClose"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_EDITOR_AREA_SHOW = "editorAreaShow"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_EDITOR_AREA_HIDE = "editorAreaHide"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_ACTION_SET_SHOW = "actionSetShow"; //$NON-NLS-1$ const std::string IWorkbenchPage::CHANGE_ACTION_SET_HIDE = "actionSetHide"; //$NON-NLS-1$ const int IWorkbenchPage::VIEW_ACTIVATE = 1; const int IWorkbenchPage::VIEW_VISIBLE = 2; const int IWorkbenchPage::VIEW_CREATE = 3; const int IWorkbenchPage::MATCH_NONE = 0; const int IWorkbenchPage::MATCH_INPUT = 1; const int IWorkbenchPage::MATCH_ID = 2; + IWorkbenchPage::~IWorkbenchPage() + { + + } } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.h index a6d792fa99..23b49b463d 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPage.h @@ -1,858 +1,860 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHPAGE_H_ #define BERRYIWORKBENCHPAGE_H_ #include #include "berryIEditorReference.h" #include "berryIViewReference.h" #include "berryIPerspectiveDescriptor.h" #include "berryIEditorPart.h" #include "berryIViewPart.h" #include "berryIEditorInput.h" #include "berryIPartService.h" #include "berryISelectionService.h" #include "berryIReusableEditor.h" #include "berryIWorkbenchWindow.h" #include #include /** * \ingroup org_blueberry_ui * */ namespace berry { /** * A workbench page consists of an arrangement of views and editors intended to * be presented together to the user in a single workbench window. *

* A page can contain 0 or more views and 0 or more editors. These views and * editors are contained wholly within the page and are not shared with other * pages. The layout and visible action set for the page is defined by a * perspective. *

* The number of views and editors within a page is restricted to simplify part * management for the user. In particular: *

    *
  • Unless a view explicitly allows for multiple instances in its plugin * declaration there will be only one instance in a given workbench page.
  • *
  • Only one editor can exist for each editor input within a page. *
  • *
*

*

* This interface is not intended to be implemented by clients. *

* * @see IPerspectiveDescriptor * @see IEditorPart * @see IViewPart */ struct BERRY_UI IWorkbenchPage : public IPartService, public ISelectionService, public Object { berryInterfaceMacro(IWorkbenchPage, berry); /** * An optional attribute within a workspace marker (IMarker) * which identifies the preferred editor type to be opened when * openEditor is called. * * @see #openEditor(IEditorInput, String) * @see #openEditor(IEditorInput, String, boolean) * @deprecated in 3.0 since the notion of markers this is not generally * applicable. Use the IDE-specific constant * IDE.EDITOR_ID_ATTR. */ static const std::string EDITOR_ID_ATTR; // = "org.blueberry.ui.editorID"; //$NON-NLS-1$ /** * Change event id when the perspective is reset to its original state. * * @see IPerspectiveListener */ static const std::string CHANGE_RESET; // = "reset"; //$NON-NLS-1$ /** * Change event id when the perspective has completed a reset to its * original state. * * @since 3.0 * @see IPerspectiveListener */ static const std::string CHANGE_RESET_COMPLETE; // = "resetComplete"; //$NON-NLS-1$ /** * Change event id when one or more views are shown in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_VIEW_SHOW; // = "viewShow"; //$NON-NLS-1$ /** * Change event id when one or more views are hidden in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_VIEW_HIDE; // = "viewHide"; //$NON-NLS-1$ /** * Change event id when one or more editors are opened in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_EDITOR_OPEN; // = "editorOpen"; //$NON-NLS-1$ /** * Change event id when one or more editors are closed in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_EDITOR_CLOSE; // = "editorClose"; //$NON-NLS-1$ /** * Change event id when the editor area is shown in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_EDITOR_AREA_SHOW; // = "editorAreaShow"; //$NON-NLS-1$ /** * Change event id when the editor area is hidden in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_EDITOR_AREA_HIDE; // = "editorAreaHide"; //$NON-NLS-1$ /** * Change event id when an action set is shown in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_ACTION_SET_SHOW; // = "actionSetShow"; //$NON-NLS-1$ /** * Change event id when an action set is hidden in a perspective. * * @see IPerspectiveListener */ static const std::string CHANGE_ACTION_SET_HIDE; // = "actionSetHide"; //$NON-NLS-1$ /** * Show view mode that indicates the view should be made visible and * activated. Use of this mode has the same effect as calling * {@link #showView(String)}. * * @since 3.0 */ static const int VIEW_ACTIVATE; // = 1; /** * Show view mode that indicates the view should be made visible. If the * view is opened in the container that contains the active view then this * has the same effect as VIEW_CREATE. * * @since 3.0 */ static const int VIEW_VISIBLE; // = 2; /** * Show view mode that indicates the view should be made created but not * necessarily be made visible. It will only be made visible in the event * that it is opened in its own container. In other words, only if it is not * stacked with another view. * * @since 3.0 */ static const int VIEW_CREATE; // = 3; /** * Editor opening match mode specifying that no matching against existing * editors should be done. * * @since 3.2 */ static const int MATCH_NONE; // = 0; /** * Editor opening match mode specifying that the editor input should be * considered when matching against existing editors. * * @since 3.2 */ static const int MATCH_INPUT; // = 1; /** * Editor opening match mode specifying that the editor id should be * considered when matching against existing editors. * * @since 3.2 */ static const int MATCH_ID; // = 2; + ~IWorkbenchPage(); + /** * Activates the given part. The part will be brought to the front and given * focus. The part must belong to this page. * * @param part * the part to activate */ virtual void Activate(IWorkbenchPart::Pointer part) = 0; /** * Adds a property change listener. * * @param listener * the property change listener to add * @since 2.0 */ //virtual void addPropertyChangeListener(IPropertyChangeListener listener); /** * Moves the given part forward in the Z order of this page so as to make it * visible, without changing which part has focus. The part must belong to * this page. * * @param part * the part to bring forward */ virtual void BringToTop(IWorkbenchPart::Pointer part) = 0; /** * Closes this workbench page. If this page is the active one, this honor is * passed along to one of the window's other pages if possible. *

* If the page has an open editor with unsaved content, the user will be * given the opportunity to save it. *

* * @return true if the page was successfully closed, and * false if it is still open */ virtual bool Close() = 0; /** * Closes all of the editors belonging to this workbench page. *

* If the page has open editors with unsaved content and save * is true, the user will be given the opportunity to save * them. *

* * @param save * * @return true if all editors were successfully closed, and * false if at least one is still open */ virtual bool CloseAllEditors(bool save) = 0; /** * Closes the given Array of editor references. The editors * must belong to this workbench page. *

* If any of the editors have unsaved content and save is * true, the user will be given the opportunity to save * them. *

* * @param editorRefs * the editors to close * @param save * true to save the editor contents if required * (recommended), and false to discard any unsaved * changes * @return true if the editors were successfully closed, and * false if the editors are still open * @since 3.0 */ virtual bool CloseEditors(const std::list& editorRefs, bool save) = 0; /** * Closes the given editor. The editor must belong to this workbench page. *

* If the editor has unsaved content and save is * true, the user will be given the opportunity to save it. *

* * @param editor * the editor to close * @param save * true to save the editor contents if required * (recommended), and false to discard any unsaved * changes * @return true if the editor was successfully closed, and * false if the editor is still open */ virtual bool CloseEditor(IEditorPart::Pointer editor, bool save) = 0; /** * Returns the view in this page with the specified id. There is at most one * view in the page with the specified id. * * @param viewId * the id of the view extension to use * @return the view, or null if none is found */ virtual IViewPart::Pointer FindView(const std::string& viewId) = 0; /** * Returns the view reference with the specified id. * * @param viewId * the id of the view extension to use * @return the view reference, or null if none is found * @since 3.0 */ virtual IViewReference::Pointer FindViewReference(const std::string& viewId) = 0; /** * Returns the view reference with the specified id and secondary id. * * @param viewId * the id of the view extension to use * @param secondaryId * the secondary id to use, or null for no * secondary id * @return the view reference, or null if none is found * @since 3.0 */ virtual IViewReference::Pointer FindViewReference(const std::string& viewId, const std::string& secondaryId) = 0; /** * Returns the active editor open in this page. *

* This is the visible editor on the page, or, if there is more than one * visible editor, this is the one most recently brought to top. *

* * @return the active editor, or null if no editor is active */ virtual IEditorPart::Pointer GetActiveEditor() = 0; /** * Returns the editor with the specified input. Returns null if there is no * opened editor with that input. * * @param input * the editor input * @return an editor with input equals to input */ virtual IEditorPart::Pointer FindEditor(IEditorInput::Pointer input) = 0; /** * Returns an array of editor references that match the given input and/or * editor id, as specified by the given match flags. Returns an empty array * if there are no matching editors, or if matchFlags is MATCH_NONE. * * @param input * the editor input, or null if MATCH_INPUT is not * specified in matchFlags * @param editorId * the editor id, or null if MATCH_ID is not * specified in matchFlags * @param matchFlags * a bit mask consisting of zero or more of the MATCH_* constants * OR-ed together * @return the references for the matching editors * * @see #MATCH_NONE * @see #MATCH_INPUT * @see #MATCH_ID * @since 3.2 */ virtual std::vector FindEditors(IEditorInput::Pointer input, const std::string& editorId, int matchFlags) = 0; /** * Returns a list of the editors open in this page. *

* Note that each page has its own editors; editors are never shared between * pages. *

* * @return a list of open editors * * @deprecated use #getEditorReferences() instead */ virtual std::vector GetEditors() = 0; /** * Returns an array of references to open editors in this page. *

* Note that each page has its own editors; editors are never shared between * pages. *

* * @return a list of open editors */ virtual std::list GetEditorReferences() = 0; /** * Returns a list of dirty editors in this page. * * @return a list of dirty editors */ virtual std::vector GetDirtyEditors() = 0; /** * Returns the input for this page. * * @return the input for this page, or null if none */ virtual IAdaptable* GetInput() = 0; /** * Returns the page label. This will be a unique identifier within the * containing workbench window. * * @return the page label */ virtual std::string GetLabel() = 0; /** * Returns the current perspective descriptor for this page, or * null if there is no current perspective. * * @return the current perspective descriptor or null * @see #setPerspective * @see #savePerspective */ virtual IPerspectiveDescriptor::Pointer GetPerspective() = 0; /** * Returns a list of the reference to views visible on this page. *

* Note that each page has its own views; views are never shared between * pages. *

* * @return a list of references to visible views */ virtual std::vector GetViewReferences() = 0; /** * Returns a list of the views visible on this page. *

* Note that each page has its own views; views are never shared between * pages. *

* * @return a list of visible views * * @deprecated use #getViewReferences() instead. */ virtual std::vector GetViews() = 0; /** * Returns the workbench window of this page. * * @return the workbench window */ virtual IWorkbenchWindow::Pointer GetWorkbenchWindow() = 0; /** * Hides the given view. The view must belong to this page. * * @param view * the view to hide */ virtual void HideView(IViewPart::Pointer view) = 0; /** * Hides the given view that belongs to the reference, if any. * * @param view * the references whos view is to be hidden * @since 3.0 */ virtual void HideView(IViewReference::Pointer view) = 0; /** * Returns whether the specified part is visible. * * @param part * the part to test * @return boolean true if part is visible */ virtual bool IsPartVisible(IWorkbenchPart::Pointer part) = 0; /** * Reuses the specified editor by setting its new input. * * @param editor * the editor to be reused * @param input * the new input for the reusable editor */ virtual void ReuseEditor(IReusableEditor::Pointer editor, IEditorInput::Pointer input) = 0; /** * Opens an editor on the given input. *

* If this page already has an editor open on the target input that editor * is activated; otherwise, a new editor is opened. Two editor inputs, * input1 and input2, are considered the same if * *

    * input1.equals(input2) == true
    * 
. *

*

* The editor type is determined by mapping editorId to an * editor extension registered with the workbench. An editor id is passed * rather than an editor object to prevent the accidental creation of more * than one editor for the same input. It also guarantees a consistent * lifecycle for editors, regardless of whether they are created by the user * or restored from saved data. *

* * @param input * the editor input * @param editorId * the id of the editor extension to use * @return an open and active editor, or null if an external * editor was opened * @exception PartInitException * if the editor could not be created or initialized */ virtual IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input, const std::string& editorId) = 0; /** * Opens an editor on the given input. *

* If this page already has an editor open on the target input that editor * is brought to the front; otherwise, a new editor is opened. Two editor * inputs are considered the same if they equal. See * Object.equals(Object) * and IEditorInput. If activate == true the editor * will be activated. *

* The editor type is determined by mapping editorId to an editor * extension registered with the workbench. An editor id is passed rather than * an editor object to prevent the accidental creation of more than one editor * for the same input. It also guarantees a consistent lifecycle for editors, * regardless of whether they are created by the user or restored from saved * data. *

* * @param input the editor input * @param editorId the id of the editor extension to use * @param activate if true the editor will be activated * @return an open editor, or null if an external editor was opened * @exception PartInitException if the editor could not be created or initialized */ virtual IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input, const std::string& editorId, bool activate) = 0; /** * Opens an editor on the given input. *

* If this page already has an editor open that matches the given input * and/or editor id (as specified by the matchFlags argument), that editor * is brought to the front; otherwise, a new editor is opened. Two editor * inputs are considered the same if they equal. See * Object.equals(Object) * and IEditorInput. If activate == true the editor * will be activated. *

* The editor type is determined by mapping editorId to an editor * extension registered with the workbench. An editor id is passed rather than * an editor object to prevent the accidental creation of more than one editor * for the same input. It also guarantees a consistent lifecycle for editors, * regardless of whether they are created by the user or restored from saved * data. *

* * @param input the editor input * @param editorId the id of the editor extension to use * @param activate if true the editor will be activated * @param matchFlags a bit mask consisting of zero or more of the MATCH_* constants OR-ed together * @return an open editor, or null if an external editor was opened * @exception PartInitException if the editor could not be created or initialized * * @see #MATCH_NONE * @see #MATCH_INPUT * @see #MATCH_ID * @since 3.2 */ virtual IEditorPart::Pointer OpenEditor(IEditorInput::Pointer input, const std::string& editorId, bool activate, int matchFlags) = 0; /** * Removes the property change listener. * * @param listener * the property change listener to remove * @since 2.0 */ //virtual void removePropertyChangeListener(IPropertyChangeListener listener); /** * Changes the visible views, their layout, and the visible action sets * within the page to match the current perspective descriptor. This is a * rearrangement of components and not a replacement. The contents of the * current perspective descriptor are unaffected. *

* For more information on perspective change see * setPerspective(). *

*/ virtual void ResetPerspective() = 0; /** * Saves the contents of all dirty editors belonging to this workbench page. * If there are no dirty editors this method returns without effect. *

* If confirm is true the user is prompted to * confirm the command. *

*

* Note that as of 3.2, this method also saves views that implement * ISaveablePart and are dirty. *

* * @param confirm true to ask the user before saving unsaved * changes (recommended), and false to save * unsaved changes without asking * @return true if the command succeeded, and * false if the operation was canceled by the user or * an error occurred while saving */ virtual bool SaveAllEditors(bool confirm) = 0; /** * Saves the contents of the given editor if dirty. If not, this method * returns without effect. *

* If confirm is true the user is prompted to * confirm the command. Otherwise, the save happens without prompt. *

*

* The editor must belong to this workbench page. *

* * @param editor * the editor to close * @param confirm * true to ask the user before saving unsaved * changes (recommended), and false to save * unsaved changes without asking * @return true if the command succeeded, and * false if the editor was not saved */ virtual bool SaveEditor(IEditorPart::Pointer editor, bool confirm) = 0; /** * Saves the visible views, their layout, and the visible action sets for * this page to the current perspective descriptor. The contents of the * current perspective descriptor are overwritten. */ virtual void SavePerspective() = 0; /** * Saves the visible views, their layout, and the visible action sets for * this page to the given perspective descriptor. The contents of the given * perspective descriptor are overwritten and it is made the current one for * this page. * * @param perspective * the perspective descriptor to save to */ virtual void SavePerspectiveAs(IPerspectiveDescriptor::Pointer perspective) = 0; /** * Changes the visible views, their layout, and the visible action sets * within the page to match the given perspective descriptor. This is a * rearrangement of components and not a replacement. The contents of the * old perspective descriptor are unaffected. *

* When a perspective change occurs the old perspective is deactivated * (hidden) and cached for future reference. Then the new perspective is * activated (shown). The views within the page are shared by all existing * perspectives to make it easy for the user to switch between one * perspective and another quickly without loss of context. *

*

* During activation the action sets are modified. If an action set is * specified in the new perspective which is not visible in the old one it * will be created. If an old action set is not specified in the new * perspective it will be disposed. *

*

* The visible views and their layout within the page also change. If a view * is specified in the new perspective which is not visible in the old one a * new instance of the view will be created. If an old view is not specified * in the new perspective it will be hidden. This view may reappear if the * user selects it from the View menu or if they switch to a perspective * (which may be the old one) where the view is visible. *

*

* The open editors are not modified by this method. *

* * @param perspective * the perspective descriptor */ virtual void SetPerspective(IPerspectiveDescriptor::Pointer perspective) = 0; /** * Shows the view identified by the given view id in this page and gives it * focus. If there is a view identified by the given view id (and with no * secondary id) already open in this page, it is given focus. * * @param viewId * the id of the view extension to use * @return the shown view * @exception PartInitException * if the view could not be initialized */ virtual IViewPart::Pointer ShowView(const std::string& viewId) = 0; /** * Shows a view in this page with the given id and secondary id. The * behaviour of this method varies based on the supplied mode. If * VIEW_ACTIVATE is supplied, the view is focus. If * VIEW_VISIBLE is supplied, then it is made visible but not * given focus. Finally, if VIEW_CREATE is supplied the view * is created and will only be made visible if it is not created in a folder * that already contains visible views. *

* This allows multiple instances of a particular view to be created. They * are disambiguated using the secondary id. If a secondary id is given, the * view must allow multiple instances by having specified * allowMultiple="true" in its extension. *

* * @param viewId * the id of the view extension to use * @param secondaryId * the secondary id to use, or null for no * secondary id * @param mode * the activation mode. Must be {@link #VIEW_ACTIVATE}, * {@link #VIEW_VISIBLE} or {@link #VIEW_CREATE} * @return a view * @exception PartInitException * if the view could not be initialized * @exception IllegalArgumentException * if the supplied mode is not valid * @since 3.0 */ virtual IViewPart::Pointer ShowView(const std::string& viewId, const std::string& secondaryId, int mode) = 0; /** * Returns true if the editor is pinned and should not be * reused. * * @param editor * the editor to test * @return boolean whether the editor is pinned */ virtual bool IsEditorPinned(IEditorPart::Pointer editor) = 0; /** * Returns the perspective shortcuts associated with the current * perspective. Returns an empty array if there is no current perspective. * * @see IPageLayout#addPerspectiveShortcut(String) * @return an array of perspective identifiers * @since 3.1 */ virtual std::vector GetPerspectiveShortcuts() = 0; /** * Returns the show view shortcuts associated with the current perspective. * Returns an empty array if there is no current perspective. * * @see IPageLayout#addShowViewShortcut(String) * @return an array of view identifiers * @since 3.1 */ virtual std::vector GetShowViewShortcuts() = 0; /** * Returns the descriptors for the perspectives that are open in this page, * in the order in which they were opened. * * @return the open perspective descriptors, in order of opening * @since 3.1 */ virtual std::vector GetOpenPerspectives() = 0; /** * Returns the descriptors for the perspectives that are open in this page, * in the order in which they were activated (oldest first). * * @return the open perspective descriptors, in order of activation * @since 3.1 */ virtual std::vector GetSortedPerspectives() = 0; /** * Closes the specified perspective in this page. If the last perspective in * this page is closed, then all editors are closed. Views that are not * shown in other perspectives are closed as well. If saveParts * is true, the user will be prompted to save any unsaved * changes for parts that are being closed. The page itself is closed if * closePage is true. * * @param desc * the descriptor of the perspective to be closed * @param saveParts * whether the page's parts should be saved if closed * @param closePage * whether the page itself should be closed if last perspective * @since 3.1 */ virtual void ClosePerspective(IPerspectiveDescriptor::Pointer desc, bool saveParts, bool closePage) = 0; /** * Closes all perspectives in this page. All editors are closed, prompting * to save any unsaved changes if saveEditors is * true. The page itself is closed if closePage * is true. * * @param saveEditors * whether the page's editors should be saved * @param closePage * whether the page itself should be closed * @since 3.1 */ virtual void CloseAllPerspectives(bool saveEditors, bool closePage) = 0; /** * Find the part reference for the given part. A convenience method to * quickly go from part to part reference. * * @param part * The part to search for. It can be null. * @return The reference for the given part, or null if no * reference can be found. * @since 3.2 */ virtual IWorkbenchPartReference::Pointer GetReference(IWorkbenchPart::Pointer part) = 0; }; } // namespace berry #endif /*BERRYIWORKBENCHPAGE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.cpp new file mode 100644 index 0000000000..c6974c633e --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchPart.h" + + +namespace berry { + +IWorkbenchPart::~IWorkbenchPart() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.h index 5f98aa8e56..ce4313b6ad 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPart.h @@ -1,271 +1,271 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef IWORKBENCHPART_H_ #define IWORKBENCHPART_H_ #include #include "berryIPropertyChangeListener.h" #include #include namespace berry { struct IWorkbenchPartSite; /** * \ingroup org_blueberry_ui * * A workbench part is a visual component within a workbench page. There * are two subtypes: view and editor, as defined by IViewPart and * IEditorPart. *

* A view is typically used to navigate a hierarchy of information (like the * workspace), open an editor, or display properties for the active editor. * Modifications made in a view are saved immediately. *

* An editor is typically used to edit or browse a document or input object. * The input is identified using an IEditorInput. Modifications made * in an editor part follow an open-save-close lifecycle model. *

* This interface may be implemented directly. For convenience, a base * implementation is defined in WorkbenchPart. *

* The lifecycle of a workbench part is as follows: *

    *
  • When a part extension is created: *
      *
    • instantiate the part
    • *
    • create a part site
    • *
    • call part.init(site)
    • *
    *
  • When a part becomes visible in the workbench: *
      *
    • add part to presentation by calling * part.createControl(parent) to create actual widgets
    • *
    • fire partOpened event to all listeners
    • *
    *
  • *
  • When a part is activated or gets focus: *
      *
    • call part.setFocus()
    • *
    • fire partActivated event to all listeners
    • *
    *
  • *
  • When a part is closed: *
      *
    • if save is needed, do save; if it fails or is canceled return
    • *
    • if part is active, deactivate part
    • *
    • fire partClosed event to all listeners
    • *
    • remove part from presentation; part controls are disposed as part * of the SWT widget tree *
    • call part.dispose()
    • *
    *
  • *
*

*

* After createPartControl has been called, the implementor may * safely reference the controls created. When the part is closed * these controls will be disposed as part of an SWT composite. This * occurs before the IWorkbenchPart.dispose method is called. * If there is a need to free SWT resources the part should define a dispose * listener for its own control and free those resources from the dispose * listener. If the part invokes any method on the disposed SWT controls * after this point an SWTError will be thrown. *

*

* The last method called on IWorkbenchPart is dispose. * This signals the end of the part lifecycle. *

*

* An important point to note about this lifecycle is that following * a call to init, createControl may never be called. Thus in the dispose * method, implementors must not assume controls were created. *

*

* Workbench parts implement the IAdaptable interface; extensions * are managed by the platform's adapter manager. *

* * @see IViewPart * @see IEditorPart */ struct BERRY_UI IWorkbenchPart : public virtual Object { // public IAdaptable { berryInterfaceMacro(IWorkbenchPart, berry) - virtual ~IWorkbenchPart() {} + virtual ~IWorkbenchPart(); /** * The property id for getTitle, getTitleImage * and getTitleToolTip. */ //static const int PROP_TITLE = IWorkbenchPartConstants.PROP_TITLE; /** * Adds a listener for changes to properties of this workbench part. * Has no effect if an identical listener is already registered. *

* The property ids are defined in {@link IWorkbenchPartConstants}. *

* * @param listener a property listener */ virtual void AddPropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Creates the controls for this workbench part. *

* Clients should not call this method (the workbench calls this method when * it needs to, which may be never). *

*

* For implementors this is a multi-step process: *

    *
  1. Create one or more controls within the parent.
  2. *
  3. Set the parent layout as needed.
  4. *
  5. Register any global actions with the site's IActionBars.
  6. *
  7. Register any context menus with the site.
  8. *
  9. Register a selection provider with the site, to make it available to * the workbench's ISelectionService (optional).
  10. *
*

* * @param parent the parent control */ virtual void CreatePartControl(void* parent) = 0; /** * Returns the site for this workbench part. The site can be * null while the workbench part is being initialized. After * the initialization is complete, this value must be non-null * for the remainder of the part's life cycle. * * @return The part site; this value may be null if the part * has not yet been initialized */ virtual SmartPointer GetSite() const = 0; /** * Returns the name of this part. If this value changes the part must fire a * property listener event with {@link IWorkbenchPartConstants#PROP_PART_NAME}. * * @return the name of this view, or the empty string if the name is being managed * by the workbench (not null) */ virtual std::string GetPartName() const = 0; /** * Returns the content description of this part. The content description is an optional * user-readable string that describes what is currently being displayed in the part. * By default, the workbench will display the content description in a line * near the top of the view or editor. * An empty string indicates no content description * text. If this value changes the part must fire a property listener event * with {@link IWorkbenchPartConstants#PROP_CONTENT_DESCRIPTION}. * * @return the content description of this part (not null) */ virtual std::string GetContentDescription() const = 0; /** * Returns the title image of this workbench part. If this value changes * the part must fire a property listener event with * PROP_TITLE. *

* The title image is usually used to populate the title bar of this part's * visual container. Since this image is managed by the part itself, callers * must not dispose the returned image. *

* * @return the title image */ virtual void* GetTitleImage() const = 0; /** * Returns the title tool tip text of this workbench part. * An empty string result indicates no tool tip. * If this value changes the part must fire a property listener event with * PROP_TITLE. *

* The tool tip text is used to populate the title bar of this part's * visual container. *

* * @return the workbench part title tool tip (not null) */ virtual std::string GetTitleToolTip() const = 0; /** * Removes the given property listener from this workbench part. * Has no affect if an identical listener is not registered. * * @param listener a property listener */ virtual void RemovePropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Return the value for the arbitrary property key, or null. * * @param key * the arbitrary property. Must not be null. * @return the property value, or null. */ virtual std::string GetPartProperty(const std::string& key) const = 0; /** * Set an arbitrary property on the part. It is the implementor's * responsibility to fire the corresponding PropertyChangeEvent. *

* A default implementation has been added to WorkbenchPart. *

* * @param key * the arbitrary property. Must not be null. * @param value * the property value. A null value will remove * that property. */ virtual void SetPartProperty(const std::string& key, const std::string& value) = 0; /** * Return an unmodifiable map of the arbitrary properties. This method can * be used to save the properties during workbench save/restore. * * @return A Map of the properties. Must not be null. */ virtual const std::map& GetPartProperties() const = 0; /** * Asks this part to take focus within the workbench. *

* Clients should not call this method (the workbench calls this method at * appropriate times). To have the workbench activate a part, use * IWorkbenchPage.activate(IWorkbenchPart) instead. *

*/ virtual void SetFocus() = 0; }; } // namespace berry #endif /*IWORKBENCHPART_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.cpp new file mode 100644 index 0000000000..42344190a5 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchPartDescriptor.h" + + +namespace berry { + +IWorkbenchPartDescriptor::~IWorkbenchPartDescriptor () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.h index 8673c09eb2..2ba8e5fdb9 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartDescriptor.h @@ -1,74 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHPARTDESCRIPTOR_H_ #define BERRYIWORKBENCHPARTDESCRIPTOR_H_ #include #include #include #include "berryImageDescriptor.h" #include namespace berry { /** * \ingroup org_blueberry_ui * * Description of a workbench part. The part descriptor contains * the information needed to create part instances. *

* This interface is not intended to be implemented by clients. *

*/ struct BERRY_UI IWorkbenchPartDescriptor : public Object { berryInterfaceMacro(IWorkbenchPartDescriptor, berry); /** * Returns the part id. * * @return the id of the part */ virtual std::string GetId() const = 0; /** * Returns the descriptor of the image for this part. * * @return the descriptor of the image to display next to this part */ virtual SmartPointer GetImageDescriptor() const = 0; /** * Returns the label to show for this part. * * @return the part label */ virtual std::string GetLabel() const = 0; - virtual ~IWorkbenchPartDescriptor() - { - } + virtual ~IWorkbenchPartDescriptor(); }; } // namespace berry #endif /*BERRYIWORKBENCHPARTDESCRIPTOR_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.cpp new file mode 100644 index 0000000000..4dd8dae795 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchPartReference.h" + + +namespace berry { + +IWorkbenchPartReference::~IWorkbenchPartReference() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.h index c2f0211c69..a7eb1d89ad 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartReference.h @@ -1,149 +1,151 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHPARTREFERENCE_H_ #define BERRYIWORKBENCHPARTREFERENCE_H_ #include #include #include "berryIPropertyChangeListener.h" namespace berry { struct IWorkbenchPart; struct IWorkbenchPage; /** * \ingroup org_blueberry_ui * * Implements a reference to a IWorkbenchPart. * The IWorkbenchPart will not be instanciated until the part * becomes visible or the API getPart is sent with true; *

* This interface is not intended to be implemented by clients. *

*/ struct BERRY_UI IWorkbenchPartReference : public Object { berryInterfaceMacro(IWorkbenchPartReference, berry); + ~IWorkbenchPartReference(); + /** * Returns the IWorkbenchPart referenced by this object. * Returns null if the editors was not instantiated or * it failed to be restored. Tries to restore the editor * if restore is true. */ virtual SmartPointer GetPart(bool restore) = 0; /** * @see IWorkbenchPart#getTitleImage */ virtual void* GetTitleImage() = 0; /** * @see IWorkbenchPart#getTitleToolTip */ virtual std::string GetTitleToolTip() const = 0; /** * @see IWorkbenchPartSite#getId */ virtual std::string GetId() const = 0; /** * @see IWorkbenchPart#addPropertyListener */ virtual void AddPropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * @see IWorkbenchPart#removePropertyListener */ virtual void RemovePropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Returns the workbench page that contains this part */ virtual SmartPointer GetPage() const = 0; /** * Returns the name of the part, as it should be shown in tabs. * * @return the part name * * @since 3.0 */ virtual std::string GetPartName() const = 0; /** * Returns the content description for the part (or the empty string if none) * * @return the content description for the part * * @since 3.0 */ virtual std::string GetContentDescription() const = 0; /** * Returns true if the part is pinned otherwise returns false. */ virtual bool IsPinned() const = 0; /** * Returns whether the part is dirty (i.e. has unsaved changes). * * @return true if the part is dirty, false otherwise * * @since 3.2 (previously existed on IEditorReference) */ virtual bool IsDirty() const = 0; /** * Return an arbitrary property from the reference. If the part has been * instantiated, it just delegates to the part. If not, then it looks in its * own cache of properties. If the property is not available or the part has * never been instantiated, it can return null. * * @param key * The property to return. Must not be null. * @return The String property, or null. * @since 3.3 */ virtual std::string GetPartProperty(const std::string& key) const = 0; /** * Add a listener for changes in the arbitrary properties set. * * @param listener * Must not be null. * @since 3.3 */ //virtual void addPartPropertyListener(IPropertyChangeListener listener) = 0; /** * Remove a listener for changes in the arbitrary properties set. * * @param listener * Must not be null. * @since 3.3 */ //virtual void removePartPropertyListener(IPropertyChangeListener listener) = 0; }; } // namespace berry #endif /*BERRYIWORKBENCHPARTREFERENCE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.cpp new file mode 100644 index 0000000000..3a917f1c4b --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchPartSite.h" + + +namespace berry { + +IWorkbenchPartSite::~IWorkbenchPartSite() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.h index dce2a91a5e..88c21286a9 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchPartSite.h @@ -1,83 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef IWORKBENCHPARTSITE_H_ #define IWORKBENCHPARTSITE_H_ #include "berryIWorkbenchSite.h" namespace berry { struct IWorkbenchPart; /** * \ingroup org_blueberry_ui * * The primary interface between a workbench part and the workbench. *

* This interface is not intended to be implemented or extended by clients. *

* @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IWorkbenchPartSite : public IWorkbenchSite { berryInterfaceMacro(IWorkbenchPartSite, berry); + ~IWorkbenchPartSite(); + /** * Returns the part registry extension id for this workbench site's part. *

* The name comes from the id attribute in the configuration * element. *

* * @return the registry extension id */ virtual std::string GetId() = 0; /** * Returns the part associated with this site * * @return the part associated with this site */ virtual SmartPointer GetPart() = 0; /** * Returns the unique identifier of the plug-in that defines this workbench * site's part. * * @return the unique identifier of the declaring plug-in */ virtual std::string GetPluginId() = 0; /** * Returns the registered name for this workbench site's part. *

* The name comes from the name attribute in the configuration * element. *

* * @return the part name */ virtual std::string GetRegisteredName() = 0; }; } // namespace berry #endif /*IWORKBENCHPARTSITE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.cpp new file mode 100644 index 0000000000..b9a99afdbc --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchSite.h" + +namespace berry +{ + +IWorkbenchSite::~IWorkbenchSite() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.h index 15eb1b4440..f086ed141d 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchSite.h @@ -1,109 +1,109 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHSITE_H_ #define BERRYIWORKBENCHSITE_H_ #include #include #include "services/berryIServiceLocator.h" namespace berry { struct IWorkbenchPage; struct ISelectionProvider; struct IWorkbenchWindow; class Shell; /** * \ingroup org_blueberry_ui * * The common interface between the workbench and its parts, including pages * within parts. *

* The workbench site supports a few {@link IServiceLocator services} by * default. If these services are used to allocate resources, it is important to * remember to clean up those resources after you are done with them. Otherwise, * the resources will exist until the workbench site is disposed. The supported * services are: *

*
    *
  • {@link ICommandService}
  • *
  • {@link IContextService}
  • *
  • {@link IHandlerService}
  • *
  • {@link IBindingService}. Resources allocated through this service will * not be cleaned up until the workbench shuts down.
  • *
*

* This interface is not intended to be implemented or extended by clients. *

* * @see org.blueberry.ui.IWorkbenchPartSite * @see org.blueberry.ui.part.IPageSite * @since 2.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IWorkbenchSite : public IServiceLocator { // IAdaptable, IShellProvider { berryInterfaceMacro(IWorkbenchSite, berry); - virtual ~IWorkbenchSite() {} + virtual ~IWorkbenchSite(); /** * Returns the page containing this workbench site. * * @return the page containing this workbench site */ virtual SmartPointer GetPage() = 0; /** * Returns the selection provider for this workbench site. * * @return the selection provider, or null if none */ virtual SmartPointer GetSelectionProvider() = 0; /** * Returns the shell for this workbench site. Not intended to be called from * outside the UI thread. Clients should call IWorkbench.getDisplay() to * gain access to the display rather than calling getShell().getDisplay(). * * @return the shell for this workbench site */ virtual SmartPointer GetShell() = 0; /** * Returns the workbench window containing this workbench site. * * @return the workbench window containing this workbench site */ virtual SmartPointer GetWorkbenchWindow() = 0; /** * Sets the selection provider for this workbench site. * * @param provider * the selection provider, or null to clear it */ virtual void SetSelectionProvider(SmartPointer provider) = 0; }; } #endif /*BERRYIWORKBENCHSITE_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.cpp new file mode 100644 index 0000000000..5446e29d13 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchWindow.h" + +namespace berry +{ + +IWorkbenchWindow::~IWorkbenchWindow() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.h index 70fb7fbbae..59547e4de8 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIWorkbenchWindow.h @@ -1,206 +1,206 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHWINDOW_H_ #define BERRYIWORKBENCHWINDOW_H_ #include #include #include #include "berryIPageService.h" #include "berryShell.h" #include "services/berryIServiceLocator.h" namespace berry { struct IPartService; struct ISelectionService; struct IWorkbenchPage; struct IWorkbench; /** * \ingroup org_blueberry_ui * * A workbench window is a top level window in a workbench. Visually, a * workbench window has a menubar, a toolbar, a status bar, and a main area for * displaying a single page consisting of a collection of views and editors. *

* Each workbench window has a collection of 0 or more pages; the active page is * the one that is being presented to the end user; at most one page is active * in a window at a time. *

*

* The workbench window supports a few {@link IServiceLocator services} by * default. If these services are used to allocate resources, it is important to * remember to clean up those resources after you are done with them. Otherwise, * the resources will exist until the workbench window is closed. The supported * services are: *

*
    *
  • {@link ICommandService}
  • *
  • {@link IContextService}
  • *
  • {@link IHandlerService}
  • *
  • {@link IBindingService}. Resources allocated through this service will * not be cleaned up until the workbench shuts down.
  • *
*

* This interface is not intended to be implemented by clients. *

* * @see IWorkbenchPage * @noimplement This interface is not intended to be implemented by clients. * */ struct BERRY_UI IWorkbenchWindow : public IPageService, public IServiceLocator, public virtual Object { berryInterfaceMacro(IWorkbenchWindow, berry); /** * Closes this workbench window. *

* If the window has an open editor with unsaved content, the user will be * given the opportunity to save it. *

* * @return true if the window was successfully closed, and * false if it is still open */ virtual bool Close() = 0; /** * Returns the currently active page for this workbench window. * * @return the active page, or null if none */ virtual SmartPointer GetActivePage() = 0; /** * Sets or clears the currently active page for this workbench window. * * @param page * the new active page */ virtual void SetActivePage(SmartPointer page) = 0; /** * Returns the part service which tracks part activation within this * workbench window. * * @return the part service */ virtual IPartService* GetPartService() = 0; /** * Returns the selection service which tracks selection within this * workbench window. * * @return the selection service */ virtual ISelectionService* GetSelectionService() = 0; /** * Returns this workbench window's shell. * * @return the shell containing this window's controls or null * if the shell has not been created yet or if the window has been closed */ virtual Shell::Pointer GetShell() = 0; /** * Returns the workbench for this window. * * @return the workbench */ virtual IWorkbench* GetWorkbench() = 0; /** * Returns whether the specified menu is an application menu as opposed to * a part menu. Application menus contain items which affect the workbench * or window. Part menus contain items which affect the active part (view * or editor). *

* This is typically used during "in place" editing. Application menus * should be preserved during menu merging. All other menus may be removed * from the window. *

* * @param menuId * the menu id * @return true if the specified menu is an application * menu, and false if it is not */ //virtual bool IsApplicationMenu(const std::string& menuId) = 0; /** * Creates and opens a new workbench page. The perspective of the new page * is defined by the specified perspective ID. The new page become active. *

* Note: Since release 2.0, a window is limited to contain at most * one page. If a page exist in the window when this method is used, then * another window is created for the new page. Callers are strongly * recommended to use the IWorkbench.showPerspective APIs to * programmatically show a perspective. *

* * @param perspectiveId * the perspective id for the window's initial page * @param input * the page input, or null if there is no current * input. This is used to seed the input for the new page's * views. * @return the new workbench page * @exception WorkbenchException * if a page could not be opened * * @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable) */ virtual SmartPointer OpenPage(const std::string& perspectiveId, IAdaptable* input) = 0; /** * Creates and opens a new workbench page. The default perspective is used * as a template for creating the page. The page becomes active. *

* Note: Since release 2.0, a window is limited to contain at most * one page. If a page exist in the window when this method is used, then * another window is created for the new page. Callers are strongly * recommended to use the IWorkbench.showPerspective APIs to * programmatically show a perspective. *

* * @param input * the page input, or null if there is no current * input. This is used to seed the input for the new page's * views. * @return the new workbench window * @exception WorkbenchException * if a page could not be opened * * @see IWorkbench#showPerspective(String, IWorkbenchWindow, IAdaptable) */ virtual SmartPointer OpenPage(IAdaptable* input) = 0; - virtual ~IWorkbenchWindow() {} + virtual ~IWorkbenchWindow(); }; } #endif /*BERRYIWORKBENCHWINDOW_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.cpp index 20059d6e98..3a732beaa5 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.cpp @@ -1,27 +1,32 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIDialog.h" namespace berry { const int IDialog::NONE = 0; const int IDialog::ERR = 1; const int IDialog::INFORMATION = 2; const int IDialog::QUESTION = 3; const int IDialog::WARNING = 4; +IDialog::~IDialog() +{ + +} + } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.h b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.h index 58ecf6973d..404cead286 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIDialog.h @@ -1,67 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIDIALOG_H_ #define BERRYIDIALOG_H_ #include #include #include namespace berry { /** * \ingroup org_blueberry_ui * */ struct BERRY_UI IDialog : public virtual Object { berryInterfaceMacro(IDialog, berry); /** * Constant for a dialog with no image (value 0). */ const static int NONE; // = 0; /** * Constant for a dialog with an error image (value 1). */ const static int ERR; // = 1; /** * Constant for a dialog with an info image (value 2). */ const static int INFORMATION; // = 2; /** * Constant for a dialog with a question image (value 3). */ const static int QUESTION; // = 3; /** * Constant for a dialog with a warning image (value 4). */ const static int WARNING; // = 4; enum ReturnCode { OK, CANCEL }; + ~IDialog(); + virtual int Open() = 0; + }; } #endif /*BERRYIDIALOG_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.cpp new file mode 100644 index 0000000000..99e0564844 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIShowViewDialog.h" + + +namespace berry { + +IShowViewDialog::~IShowViewDialog () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.h b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.h index a7bec3a9d9..be4019c112 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/dialogs/berryIShowViewDialog.h @@ -1,42 +1,44 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISHOWVIEWDIALOG_H_ #define BERRYISHOWVIEWDIALOG_H_ #include "berryIDialog.h" #include #include "berryIViewDescriptor.h" namespace berry { /** * \ingroup org_blueberry_ui * */ struct BERRY_UI IShowViewDialog : public IDialog { berryInterfaceMacro(IShowViewDialog, berry); + ~IShowViewDialog(); + virtual std::vector GetSelection() = 0; }; } #endif /*BERRYISHOWVIEWDIALOG_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.cpp index edd9328d65..7ac0560745 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.cpp @@ -1,55 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryGuiTkIControlListener.h" namespace berry { namespace GuiTk { +IControlListener::~IControlListener() +{ +} + void IControlListener::Events ::AddListener(IControlListener::Pointer l) { if (l.IsNull()) return; Types types = l->GetEventTypes(); if (types & MOVED) movedEvent += Delegate(l.GetPointer(), &IControlListener::ControlMoved); if (types & RESIZED) resizedEvent += Delegate(l.GetPointer(), &IControlListener::ControlResized); if (types & ACTIVATED) activatedEvent += Delegate(l.GetPointer(), &IControlListener::ControlActivated); if (types & DESTROYED) destroyedEvent += Delegate(l.GetPointer(), &IControlListener::ControlDestroyed); } void IControlListener::Events ::RemoveListener(IControlListener::Pointer l) { if (l.IsNull()) return; movedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlMoved); resizedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlResized); activatedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlActivated); destroyedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlDestroyed); } } } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.h b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.h index 5bc1456aea..9286ad489a 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkIControlListener.h @@ -1,242 +1,240 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYGUITKICONTROLLISTENER_H_ #define BERRYGUITKICONTROLLISTENER_H_ #include #include #include #include "berryGuiTkControlEvent.h" namespace berry { namespace GuiTk { /** * Classes which implement this interface provide methods * that deal with the events that are generated by moving * and resizing controls. *

* After creating an instance of a class that implements * this interface it can be added to a control using the * addControlListener method and removed using * the removeControlListener method. When a * control is moved or resized, the appropriate method will * be invoked. *

* * @see ControlAdapter * @see ControlEvent */ struct BERRY_UI IControlListener: public virtual Object { berryInterfaceMacro(IControlListener, berry); struct BERRY_UI Events { enum Type { NONE = 0x00000000, MOVED = 0x00000001, RESIZED = 0x00000002, ACTIVATED = 0x00000004, DESTROYED = 0x00000008, ALL = 0xffffffff }; BERRY_DECLARE_FLAGS(Types, Type) typedef Message1 EventType; EventType movedEvent; EventType resizedEvent; EventType activatedEvent; EventType destroyedEvent; void AddListener(IControlListener::Pointer listener); void RemoveListener(IControlListener::Pointer listener); private: typedef MessageDelegate1 Delegate; }; - virtual ~IControlListener() - { - } + virtual ~IControlListener(); virtual Events::Types GetEventTypes() const = 0; /** * Sent when the location (x, y) of a control changes relative * to its parent (or relative to the display, for Shells). * * @param e an event containing information about the move */ virtual void ControlMoved(ControlEvent::Pointer /*e*/) { } /** * Sent when the size (width, height) of a control changes. * * @param e an event containing information about the resize */ virtual void ControlResized(ControlEvent::Pointer /*e*/) { } virtual void ControlActivated(ControlEvent::Pointer /*e*/) { } virtual void ControlDestroyed(ControlEvent::Pointer /*e*/) { } }; template struct ControlMovedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlMovedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const { return Events::MOVED; } void ControlMoved(ControlEvent::Pointer e) { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; template struct ControlResizedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlResizedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const { return Events::RESIZED; } void ControlResized(ControlEvent::Pointer e) { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; template struct ControlActivatedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlActivatedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const { return Events::ACTIVATED; } void ControlActivated(ControlEvent::Pointer e) { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; template struct ControlDestroyedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlDestroyedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const { return Events::DESTROYED; } void ControlDestroyed(ControlEvent::Pointer e) { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; } } BERRY_DECLARE_OPERATORS_FOR_FLAGS(berry::GuiTk::IControlListener::Events::Types) #endif /* BERRYGUITKICONTROLLISTENER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.cpp index 56dd1164aa..226d69c6af 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.cpp @@ -1,45 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryGuiTkISelectionListener.h" namespace berry { namespace GuiTk { +ISelectionListener::~ISelectionListener() +{ +} + void ISelectionListener::Events ::AddListener(ISelectionListener::Pointer l) { if (l.IsNull()) return; selected += Delegate(l.GetPointer(), &ISelectionListener::WidgetSelected); defaultSelected += Delegate(l.GetPointer(), &ISelectionListener::WidgetDefaultSelected); } void ISelectionListener::Events ::RemoveListener(ISelectionListener::Pointer l) { if (l.IsNull()) return; selected -= Delegate(l.GetPointer(), &ISelectionListener::WidgetSelected); defaultSelected -= Delegate(l.GetPointer(), &ISelectionListener::WidgetDefaultSelected); } } } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.h b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.h index 01e0e8d88b..16911c078f 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/guitk/berryGuiTkISelectionListener.h @@ -1,102 +1,102 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYGUITKISELECTIONLISTENER_H_ #define BERRYGUITKISELECTIONLISTENER_H_ #include #include #include "berryGuiTkSelectionEvent.h" namespace berry { namespace GuiTk { /** * Classes which implement this interface provide methods * that deal with the events that are generated when selection * occurs in a control. *

* After creating an instance of a class that implements * this interface it can be added to a control using the * addSelectionListener method and removed using * the removeSelectionListener method. When * selection occurs in a control the appropriate method * will be invoked. *

* * @see SelectionAdapter * @see SelectionEvent */ struct BERRY_UI ISelectionListener: public virtual Object { berryInterfaceMacro(ISelectionListener, berry); struct BERRY_UI Events { typedef Message1 EventType; EventType selected; EventType defaultSelected; void AddListener(ISelectionListener::Pointer listener); void RemoveListener(ISelectionListener::Pointer listener); private: typedef MessageDelegate1 Delegate; }; - virtual ~ISelectionListener() {} + virtual ~ISelectionListener(); /** * Sent when selection occurs in the control. *

* For example, selection occurs in a List when the user selects * an item or items with the keyboard or mouse. On some platforms, * the event occurs when a mouse button or key is pressed. On others, * it happens when the mouse or key is released. The exact key or * mouse gesture that causes this event is platform specific. *

* * @param e an event containing information about the selection */ virtual void WidgetSelected(SelectionEvent::Pointer /*e*/) {} /** * Sent when default selection occurs in the control. *

* For example, on some platforms default selection occurs in a List * when the user double-clicks an item or types return in a Text. * On some platforms, the event occurs when a mouse button or key is * pressed. On others, it happens when the mouse or key is released. * The exact key or mouse gesture that causes this event is platform * specific. *

* * @param e an event containing information about the default selection */ virtual void WidgetDefaultSelected(SelectionEvent::Pointer /*e*/) {} }; } } #endif /* BERRYGUITKISELECTIONLISTENER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.cpp index 955244c2c6..8a0be19aed 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.cpp @@ -1,27 +1,32 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIHandlerActivation.h" #include #include "berryIHandlerService.h" namespace berry { const int IHandlerActivation::ROOT_DEPTH = 1; +IHandlerActivation::~IHandlerActivation() +{ + +} + } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.h b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.h index deda8961d4..8a03749cda 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerActivation.h @@ -1,120 +1,122 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIHANDLERACTIVATION_H_ #define BERRYIHANDLERACTIVATION_H_ #include "internal/berryIEvaluationResultCache.h" #include namespace berry { struct IHandler; struct IHandlerService; /** *

* A token representing the activation of a handler. This token can later be * used to cancel that activation. Without this token, then handler will only * become inactive if the component in which the handler was activated is * destroyed. *

*

* This interface is not intended to be implemented or extended by clients. *

* * @since 3.1 * @see org.eclipse.ui.ISources * @see org.eclipse.ui.ISourceProvider */ struct BERRY_UI IHandlerActivation : public IEvaluationResultCache { berryInterfaceMacro(IHandlerActivation, berry) + ~IHandlerActivation(); + /** * The depth at which the root exists. * * @since 3.2 */ static const int ROOT_DEPTH; // = 1; /** * Clears the cached computation of the isActive method, if * any. This method is only intended for internal use. It provides a * mechanism by which ISourceProvider events can invalidate * state on a IHandlerActivation instance. * * @deprecated Use {@link IEvaluationResultCache#clearResult()} instead. */ virtual void ClearActive() = 0; /** * Returns the identifier of the command whose handler is being activated. * * @return The command identifier; never null. */ virtual std::string GetCommandId() const = 0; /** * Returns the depth at which this activation was created within the * services hierarchy. The root of the hierarchy is at a depth of * 1. This is used as the final tie-breaker in the event * that no other method can be used to determine a winner. * * @return The depth at which the handler was inserted into the services * hierarchy; should be a positive integer. * @since 3.2 */ virtual int GetDepth() const = 0; /** * Returns the handler that should be activated. * * @return The handler; may be null. */ virtual SmartPointer GetHandler() const = 0; /** * Returns the handler service from which this activation was requested. * This is used to ensure that an activation can only be retracted from the * same service which issued it. * * @return The handler service; never null. */ virtual SmartPointer GetHandlerService() const = 0; /** * Returns whether this handler activation is currently active -- given the * current state of the workbench. This method should cache its computation. * The cache will be cleared by a call to clearActive. * * @param context * The context in which this state should be evaluated; must not * be null. * @return true if the activation is currently active; * false otherwise. * @deprecated Use * {@link IEvaluationResultCache#evaluate(IEvaluationContext)} * instead. */ virtual bool IsActive(SmartPointer context) const = 0; }; } #endif /* BERRYIHANDLERACTIVATION_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.cpp new file mode 100644 index 0000000000..cb3fa9169d --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.cpp @@ -0,0 +1,29 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIHandlerService.h" + +#include "berryIEvaluationContext.h" + + +namespace berry { + +IHandlerService::~IHandlerService () +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.h b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.h index 33a773a232..bad39e1a2d 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/handlers/berryIHandlerService.h @@ -1,431 +1,434 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIHANDLERSERVICE_H_ #define BERRYIHANDLERSERVICE_H_ #include "services/berryIServiceWithSources.h" #include "common/berryCommandExceptions.h" namespace berry { class Command; class ExecutionEvent; class ParameterizedCommand; class Expression; class UIElement; +class IEvaluationContext; struct IHandler; struct IHandlerActivation; /** *

* Provides services related to activating and deactivating handlers within the * workbench. *

*

* This service can be acquired from your service locator: *

  *  IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class);
  * 
*
    *
  • This service is available globally.
  • *
*

* @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. * * @since 3.1 */ struct BERRY_UI IHandlerService : public IServiceWithSources { berryInterfaceMacro(IHandlerService, berry) + ~IHandlerService(); + /** *

* Activates the given handler from a child service. This is used by slave * and nested services to promote handler activations up to the root. By * using this method, it is possible for handlers coming from a more nested * component to override the nested component. *

* * @param activation * The activation that is local to the child service; must not be * null. * @return A token which can be used to later cancel the activation. Only * someone with access to this token can cancel the activation. The * activation will automatically be cancelled if the service locator * context from which this service was retrieved is destroyed. This * activation is local to this service (i.e., it is not the * activation that is passed as a parameter). * @since 3.2 */ virtual SmartPointer ActivateHandler(SmartPointer activation) = 0; /** *

* Activates the given handler within the context of this service. If this * service was retrieved from the workbench, then this handler will be * active globally. If the service was retrieved from a nested component, * then the handler will only be active within that component. *

*

* Also, it is guaranteed that the handlers submitted through a particular * service will be cleaned up when that services is destroyed. So, for * example, a service retrieved from a IWorkbenchPartSite * would deactivate all of its handlers when the site is destroyed. *

* * @param commandId * The identifier for the command which this handler handles; * must not be null. * @param handler * The handler to activate; must not be null. * @return A token which can be used to later cancel the activation. Only * someone with access to this token can cancel the activation. The * activation will automatically be cancelled if the context from * which this service was retrieved is destroyed. */ virtual SmartPointer ActivateHandler( const std::string& commandId, SmartPointer handler) = 0; /** *

* Activates the given handler within the context of this service. The * handler becomes active when expression evaluates to * true. This is the same as calling * {@link #activateHandler(String, IHandler, Expression, boolean)} with * global==false. *

*

* Also, it is guaranteed that the handlers submitted through a particular * service will be cleaned up when that service is destroyed. So, for * example, a service retrieved from a IWorkbenchPartSite * would deactivate all of its handlers when the site is destroyed. *

* * @param commandId * The identifier for the command which this handler handles; * must not be null. * @param handler * The handler to activate; must not be null. * @param expression * This expression must evaluate to true before * this handler will really become active. The expression may be * null if the handler should always be active. * @return A token which can be used to later cancel the activation. Only * someone with access to this token can cancel the activation. The * activation will automatically be cancelled if the context from * which this service was retrieved is destroyed. * * @see org.eclipse.ui.ISources * @since 3.2 */ virtual SmartPointer ActivateHandler( const std::string& commandId, SmartPointer handler, SmartPointer expression) = 0; /** *

* Activates the given handler within the context of this service. The * handler becomes active when expression evaluates to * true. if global==false, then this * handler service must also be the active service to active the handler. * For example, the handler service on a part is active when that part is * active. *

*

* Also, it is guaranteed that the handlers submitted through a particular * service will be cleaned up when that services is destroyed. So, for * example, a service retrieved from a IWorkbenchPartSite * would deactivate all of its handlers when the site is destroyed. *

* * @param commandId * The identifier for the command which this handler handles; * must not be null. * @param handler * The handler to activate; must not be null. * @param expression * This expression must evaluate to true before * this handler will really become active. The expression may be * null if the handler should always be active. * @param global * Indicates that the handler should be activated irrespectively * of whether the corresponding workbench component (e.g., * window, part, etc.) is active. * @return A token which can be used to later cancel the activation. Only * someone with access to this token can cancel the activation. The * activation will automatically be cancelled if the context from * which this service was retrieved is destroyed. * * @see org.eclipse.ui.ISources * @since 3.2 */ virtual SmartPointer ActivateHandler(const std::string& commandId, SmartPointer handler, SmartPointer expression, bool global) = 0; /** *

* Activates the given handler within the context of this service. The * handler becomes active when expression evaluates to * true. *

*

* Also, it is guaranteed that the handlers submitted through a particular * service will be cleaned up when that services is destroyed. So, for * example, a service retrieved from a IWorkbenchPartSite * would deactivate all of its handlers when the site is destroyed. *

* * @param commandId * The identifier for the command which this handler handles; * must not be null. * @param handler * The handler to activate; must not be null. * @param expression * This expression must evaluate to true before * this handler will really become active. The expression may be * null if the handler should always be active. * @param sourcePriorities * The source priorities for the expression. * @return A token which can be used to later cancel the activation. Only * someone with access to this token can cancel the activation. The * activation will automatically be cancelled if the context from * which this service was retrieved is destroyed. * * @see org.eclipse.ui.ISources * @deprecated Use * {@link IHandlerService#activateHandler(String, IHandler, Expression)} * instead. */ virtual SmartPointer ActivateHandler(const std::string& commandId, SmartPointer handler, SmartPointer expression, int sourcePriorities) = 0; /** * Creates an execution event based on an SWT event. This execution event * can then be passed to a command for execution. * * @param command * The command for which an execution event should be created; * must not be null. * @param event * The SWT event triggering the command execution; may be * null. * @return An execution event suitable for calling * {@link Command#executeWithChecks(ExecutionEvent)}. * @since 3.2 * @see Command#executeWithChecks(ExecutionEvent) */ virtual SmartPointer CreateExecutionEvent( SmartPointer command, SmartPointer uielement) = 0; /** * Creates a parameterized execution event based on an SWT event and a * parameterized command. This execution event can then be passed to a * command for execution. * * @param command * The parameterized command for which an execution event should * be created; must not be null. * @param event * The SWT event triggering the command execution; may be * null. * @return An execution event suitable for calling * {@link Command#executeWithChecks(ExecutionEvent)}. * @since 3.2 * @see ParameterizedCommand#getCommand() * @see Command#executeWithChecks(ExecutionEvent) */ virtual SmartPointer CreateExecutionEvent( SmartPointer command, SmartPointer uielement) = 0; /** * Deactivates the given handler within the context of this service. If the * handler was activated with a different service, then it must be * deactivated from that service instead. It is only possible to retract a * handler activation with this method. That is, you must have the same * IHandlerActivation used to activate the handler. * * @param activation * The token that was returned from a call to * activateHandler; must not be null. */ virtual void DeactivateHandler(SmartPointer activation) = 0; /** * Deactivates the given handlers within the context of this service. If the * handler was activated with a different service, then it must be * deactivated from that service instead. It is only possible to retract a * handler activation with this method. That is, you must have the same * IHandlerActivation used to activate the handler. * * @param activations * The tokens that were returned from a call to * activateHandler. This collection must only * contain instances of IHandlerActivation. The * collection must not be null. */ virtual void DeactivateHandlers( const std::vector >& activations) = 0; /** * Executes the command with the given identifier and no parameters. * * @param commandId * The identifier of the command to execute; must not be * null. * @param event * The SWT event triggering the command execution; may be * null. * @return The return value from the execution; may be null. * @throws ExecutionException * If the handler has problems executing this command. * @throws NotDefinedException * If the command you are trying to execute is not defined. * @throws NotEnabledException * If the command you are trying to execute is not enabled. * @throws NotHandledException * If there is no handler. * @since 3.2 * @see Command#executeWithChecks(ExecutionEvent) */ virtual Object::Pointer ExecuteCommand(const std::string& commandId, SmartPointer uielement) throw(ExecutionException, NotDefinedException, NotEnabledException, NotHandledException) = 0; /** * Executes the given parameterized command. * * @param command * The parameterized command to be executed; must not be * null. * @param event * The SWT event triggering the command execution; may be * null. * @return The return value from the execution; may be null. * @throws ExecutionException * If the handler has problems executing this command. * @throws NotDefinedException * If the command you are trying to execute is not defined. * @throws NotEnabledException * If the command you are trying to execute is not enabled. * @throws NotHandledException * If there is no handler. * @since 3.2 * @see Command#executeWithChecks(ExecutionEvent) */ virtual Object::Pointer ExecuteCommand( SmartPointer command, SmartPointer uielement) throw(ExecutionException, NotDefinedException, NotEnabledException, NotHandledException) = 0; /** * Executes the given parameterized command in the provided context. It * takes care of finding the correct active handler given the context, calls * {@link IHandler2#setEnabled(Object)} to update the enabled state if * supported, and executes with that handler. * * @param command * The parameterized command to be executed; must not be * null. * @param event * The SWT event triggering the command execution; may be * null. * @param context * the evaluation context to run against. Must not be * null * @return The return value from the execution; may be null. * @throws ExecutionException * If the handler has problems executing this command. * @throws NotDefinedException * If the command you are trying to execute is not defined. * @throws NotEnabledException * If the command you are trying to execute is not enabled. * @throws NotHandledException * If there is no handler. * @since 3.4 * @see Command#executeWithChecks(ExecutionEvent) * @see #createContextSnapshot(boolean) */ virtual Object::Pointer ExecuteCommandInContext( SmartPointer command, SmartPointer uielement, SmartPointer context) throw(ExecutionException, NotDefinedException, NotEnabledException, NotHandledException) = 0; /** * This method creates a copy of the application context returned by * {@link #getCurrentState()}. * * @param includeSelection * if true, include the default variable and * selection variables * @return an context filled with the current set of variables. If selection * is not included, the default variable is an empty collection * @since 3.4 */ virtual SmartPointer CreateContextSnapshot(bool includeSelection) = 0; /** * Returns an evaluation context representing the current state of the * world. This is equivalent to the application context required by * {@link ExecutionEvent}. * * @return the current state of the application; never null. * @see ParameterizedCommand#executeWithChecks(Object, Object) * @see ExecutionEvent#ExecutionEvent(Command, java.util.Map, Object, * Object) * @see org.eclipse.ui.services.IEvaluationService */ virtual SmartPointer GetCurrentState() const = 0; /** *

* Reads the handler information from the registry. This will overwrite any * of the existing information in the handler service. This method is * intended to be called during start-up. When this method completes, this * handler service will reflect the current state of the registry. *

*/ virtual void ReadRegistry() = 0; /** * Sets the help context identifier to associate with a particular handler. * * @param handler * The handler with which to register a help context identifier; * must not be null. * @param helpContextId * The help context identifier to register; may be * null if the help context identifier should be * removed. * @since 3.2 */ virtual void SetHelpContextId(SmartPointer handler, const std::string& helpContextId) = 0; }; } #endif /* BERRYIHANDLERSERVICE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.cpp new file mode 100644 index 0000000000..bb10708d61 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIDropTarget.h" + + +namespace berry { + +IDropTarget::~IDropTarget() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.h index d9bb504358..3601b5265c 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIDropTarget.h @@ -1,69 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIDROPTARGET_H_ #define BERRYIDROPTARGET_H_ #include #include "berryRectangle.h" #include "tweaklets/berryDnDTweaklet.h" namespace berry { /** * This interface is used to drop objects. It knows how to drop a particular object * in a particular location. IDropTargets are typically created by IDragOverListeners, and * it is the job of the IDragOverListener to supply the drop target with information about * the object currently being dragged. * * @see IDragOverListener */ struct IDropTarget : public Object { berryObjectMacro(IDropTarget); + ~IDropTarget(); + /** * Drops the object in this position */ virtual void Drop() = 0; /** * Returns a cursor id describing this drop operation * * @return a cursor id describing this drop operation */ virtual DnDTweaklet::CursorType GetCursor() = 0; /** * Returns a rectangle (screen coordinates) describing the target location * for this drop operation. * * @return a snap rectangle or null if this drop target does not have a specific snap * location. */ virtual Rectangle GetSnapRectangle() = 0; /** * This is called whenever a drag operation is cancelled */ virtual void DragFinished(bool dropPerformed) = 0; }; } #endif /* BERRYIDROPTARGET_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.cpp new file mode 100644 index 0000000000..e4cd1ea06a --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIEvaluationResultCache.h" + + +namespace berry { + +IEvaluationResultCache::~IEvaluationResultCache() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.h index be1ddc3cd1..b1ae7d3bdf 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIEvaluationResultCache.h @@ -1,97 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIEVALUATIONRESULTCACHE_H_ #define BERRYIEVALUATIONRESULTCACHE_H_ #include #include namespace berry { struct IEvaluationContext; class Expression; /** *

* A cache of the result of an expression. This also provides the source * priority for the expression. *

*

* This interface is not intended to be implemented or extended by clients. *

* * @since 3.2 * @see org.eclipse.ui.ISources * @see org.eclipse.ui.ISourceProvider */ struct IEvaluationResultCache : public Object { berryInterfaceMacro(IEvaluationResultCache, berry) + ~IEvaluationResultCache(); + /** * Clears the cached computation of the evaluate method, if * any. This method is only intended for internal use. It provides a * mechanism by which ISourceProvider events can invalidate * state on a IEvaluationResultCache instance. */ virtual void ClearResult() = 0; /** * Returns the expression controlling the activation or visibility of this * item. * * @return The expression associated with this item; may be * null. */ virtual SmartPointer GetExpression() = 0; /** * Returns the priority that has been given to this expression. * * @return The priority. * @see ISources */ virtual int GetSourcePriority() const = 0; /** * Evaluates the expression -- given the current state of the workbench. * This method should cache its computation. The cache will be cleared by a * call to clearResult. * * @param context * The context in which this state should be evaluated; must not * be null. * @return true if the expression currently evaluates to * true; false otherwise. */ virtual bool Evaluate(SmartPointer context) = 0; /** * Forces the cached result to be a particular value. This will not * notify any users of the cache that it has changed. * * @param result * The cached result to use. * @since 3.3 */ virtual void SetResult(bool result) = 0; }; } #endif /* BERRYIEVALUATIONRESULTCACHE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.cpp new file mode 100644 index 0000000000..94f4bec069 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryILayoutContainer.h" + + +namespace berry { + +ILayoutContainer::~ILayoutContainer() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.h index c25ead62d4..575e67a67f 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryILayoutContainer.h @@ -1,120 +1,122 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYILAYOUTCONTAINER_H_ #define BERRYILAYOUTCONTAINER_H_ #include "berryLayoutPart.h" #include "berryPartPane.h" #include namespace berry { /** * \ingroup org_blueberry_ui_internal * */ struct ILayoutContainer : virtual public Object { berryObjectMacro(ILayoutContainer); + ~ILayoutContainer(); + typedef std::list ChildrenType; virtual bool AllowsAdd(LayoutPart::Pointer toAdd) = 0; /** * Add a child to the container. */ virtual void Add(LayoutPart::Pointer newPart) = 0; /** * Returns a list of layout children. */ virtual ChildrenType GetChildren() = 0; /** * Remove a child from the container. */ virtual void Remove(LayoutPart::Pointer part) = 0; /** * Replace one child with another */ virtual void Replace(LayoutPart::Pointer oldPart, LayoutPart::Pointer newPart) = 0; virtual void FindSashes(LayoutPart::Pointer toFind, PartPane::Sashes& result) = 0; /** * When a layout part closes, focus will return to the previously active part. * This method determines whether the parts in this container should participate * in this behavior. If this method returns true, its parts may automatically be * given focus when another part is closed. * * @return true iff the parts in this container may be given focus when the active * part is closed */ virtual bool AllowsAutoFocus() = 0; /** * Called by child parts to request a zoom in, given an immediate child * * @param toZoom * @since 3.1 */ //public void childRequestZoomIn(LayoutPart toZoom); /** * Called by child parts to request a zoom out * * @since 3.1 */ //public void childRequestZoomOut(); /** * Returns true iff the given child is obscured due to the fact that the container is zoomed into * another part. * * @param toTest * @return * @since 3.1 */ //public boolean childObscuredByZoom(LayoutPart toTest); /** * Returns true iff we are zoomed into the given part, given an immediate child of this container. * * @param toTest * @return * @since 3.1 */ //public boolean childIsZoomed(LayoutPart toTest); /** * Called when the preferred size of the given child has changed, requiring a * layout to be triggered. * * @param childThatChanged the child that triggered the new layout */ virtual void ResizeChild(LayoutPart::Pointer childThatChanged) = 0; }; } #endif /*BERRYILAYOUTCONTAINER_H_*/ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.cpp new file mode 100644 index 0000000000..7caa248b15 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIServiceLocatorCreator.h" + + +namespace berry { + +IServiceLocatorCreator::~IServiceLocatorCreator() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.h index e40786c880..3e9a7b556e 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIServiceLocatorCreator.h @@ -1,85 +1,87 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISERVICELOCATORCREATOR_H_ #define BERRYISERVICELOCATORCREATOR_H_ #include #include namespace berry { struct IServiceLocator; struct IServiceFactory; struct IDisposable; /** * When creating components this service can be used to create the appropriate * service locator for the new component. For use with the component framework. *

* Note: Must not be implemented or extended by clients. *

*

* PROVISIONAL. This class or interface has been added as part * of a work in progress. There is a guarantee neither that this API will work * nor that it will remain the same. Please do not use this API without * consulting with the Platform/UI team. This might disappear in 3.4 M5. *

* * * @since 3.4 */ struct IServiceLocatorCreator : public virtual Object { berryInterfaceMacro(IServiceLocatorCreator, berry); + ~IServiceLocatorCreator(); + /** * Creates a service locator that can be used for hosting a new service * context. It will have the appropriate child services created as needed, * and can be used with the Dependency Injection framework to reuse * components (by simply providing your own implementation for certain * services). * * @param parent * the parent locator * @param factory * a factory that can lazily provide services if requested. This * may be null * @param owner * an object whose {@link IDisposable#dispose()} method will be * called on the UI thread if the created service locator needs * to be disposed (typically, because a plug-in contributing * services to the service locator via an * {@link AbstractServiceFactory} is no longer available). The * owner can be any object that implements {@link IDisposable}. * The recommended implementation of the owner's dispose method * is to do whatever is necessary to stop using the created * service locator, and then to call * {@link IDisposable#dispose()} on the service locator. * @return the created service locator. The returned service locator will be * an instance of {@link IDisposable}. */ virtual SmartPointer CreateServiceLocator( const WeakPointer parent, const SmartPointer factory, WeakPointer owner) = 0; }; } #endif /* BERRYISERVICELOCATORCREATOR_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.cpp new file mode 100644 index 0000000000..905efc28b9 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIStackableContainer.h" + + +namespace berry { + +IStackableContainer::~IStackableContainer() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.h index 7efb0fc9f1..355676aa6f 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStackableContainer.h @@ -1,125 +1,127 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISTACKABLECONTAINER_H_ #define BERRYISTACKABLECONTAINER_H_ #include "berryStackablePart.h" #include "berryPartPane.h" #include namespace berry { /** * \ingroup org_blueberry_ui_internal * */ struct IStackableContainer : virtual public Object { berryObjectMacro(IStackableContainer); typedef std::list ChildrenType; + ~IStackableContainer(); + virtual bool AllowsAdd(StackablePart::Pointer toAdd) = 0; /** * Add a child to the container. */ virtual void Add(StackablePart::Pointer newPart) = 0; /** * Returnd the id for this stackable container */ virtual std::string GetID() const = 0; /** * Returns a list of layout children. */ virtual ChildrenType GetChildren() const = 0; /** * Remove a child from the container. */ virtual void Remove(StackablePart::Pointer part) = 0; /** * Replace one child with another */ virtual void Replace(StackablePart::Pointer oldPart, StackablePart::Pointer newPart) = 0; virtual void FindSashes(PartPane::Sashes& result) = 0; /** * When a layout part closes, focus will return to the previously active part. * This method determines whether the parts in this container should participate * in this behavior. If this method returns true, its parts may automatically be * given focus when another part is closed. * * @return true iff the parts in this container may be given focus when the active * part is closed */ virtual bool AllowsAutoFocus() = 0; /** * Called by child parts to request a zoom in, given an immediate child * * @param toZoom * @since 3.1 */ //public void childRequestZoomIn(LayoutPart toZoom); /** * Called by child parts to request a zoom out * * @since 3.1 */ //public void childRequestZoomOut(); /** * Returns true iff the given child is obscured due to the fact that the container is zoomed into * another part. * * @param toTest * @return * @since 3.1 */ //public boolean childObscuredByZoom(LayoutPart toTest); /** * Returns true iff we are zoomed into the given part, given an immediate child of this container. * * @param toTest * @return * @since 3.1 */ //public boolean childIsZoomed(LayoutPart toTest); /** * Called when the preferred size of the given child has changed, requiring a * layout to be triggered. * * @param childThatChanged the child that triggered the new layout */ virtual void ResizeChild(StackablePart::Pointer childThatChanged) = 0; }; } #endif /* BERRYISTACKABLECONTAINER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.cpp new file mode 100644 index 0000000000..d7b08887da --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIStickyViewManager.h" + + +namespace berry { + +IStickyViewManager::~IStickyViewManager() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.h index 79dd64b548..80e79f0653 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIStickyViewManager.h @@ -1,52 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISTICKYVIEWMANAGER_H_ #define BERRYISTICKYVIEWMANAGER_H_ #include #include #include #include namespace berry { class Perspective; struct IStickyViewManager : public Object { berryInterfaceMacro(IStickyViewManager, berry) + ~IStickyViewManager(); + virtual void Remove(const std::string& perspectiveId) = 0; virtual void Add(const std::string& perspectiveId, const std::set& stickyViewSet) = 0; virtual void Clear() = 0; virtual void Update(SmartPointer oldPersp, SmartPointer newPersp) = 0; virtual void Save(IMemento::Pointer memento) = 0; virtual void Restore(IMemento::Pointer memento) = 0; }; } #endif /* BERRYISTICKYVIEWMANAGER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.cpp new file mode 100644 index 0000000000..e11d07f3f3 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIWorkbenchLocationService.h" + + +namespace berry { + +IWorkbenchLocationService::~IWorkbenchLocationService() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.h index 4b37535d3f..3a28314eea 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryIWorkbenchLocationService.h @@ -1,82 +1,84 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIWORKBENCHLOCATIONSERVICE_H_ #define BERRYIWORKBENCHLOCATIONSERVICE_H_ #include #include namespace berry { struct IWorkbench; struct IWorkbenchWindow; struct IWorkbenchPartSite; struct IPageSite; /** * Query where you are in the workbench hierarchy. * * @since 3.4 */ struct IWorkbenchLocationService : public Object { berryInterfaceMacro(IWorkbenchLocationService, berry) + ~IWorkbenchLocationService(); + /** * Get the service scope. * * @return the service scope. May return null. * @see IServiceScopes#PARTSITE_SCOPE */ virtual std::string GetServiceScope() const = 0; /** * A more numeric representation of the service level. * * @return the level - 0==workbench, 1==workbench window, etc */ virtual int GetServiceLevel() const = 0; /** * @return the workbench. May return null. */ virtual IWorkbench* GetWorkbench() const = 0; /** * @return the workbench window in this service locator hierarchy. May * return null. */ virtual SmartPointer GetWorkbenchWindow() const = 0; /** * @return the part site in this service locator hierarchy. May return * null. */ virtual SmartPointer GetPartSite() const = 0; /** * @return the inner page site for a page based view in this service locator * hierarchy. May return null. * @see PageBookView */ virtual SmartPointer GetPageSite() const = 0; }; } #endif /* BERRYIWORKBENCHLOCATIONSERVICE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.cpp new file mode 100644 index 0000000000..091bc77c53 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.cpp @@ -0,0 +1,27 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIIntroDescriptor.h" + + +namespace berry { + +IIntroDescriptor::~IIntroDescriptor() +{ +} + +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.h index 953328343f..66363dbdaa 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroDescriptor.h @@ -1,76 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIINTRODESCRIPTOR_H_ #define BERRYIINTRODESCRIPTOR_H_ #include #include #include "intro/berryIIntroPart.h" #include #include namespace berry { /** * Describes an introduction extension. * * @since 3.0 */ struct IIntroDescriptor : public Object { berryInterfaceMacro(IIntroDescriptor, berry) + ~IIntroDescriptor(); + /** * Creates an instance of the intro part defined in the descriptor. */ virtual IIntroPart::Pointer CreateIntro() throw(CoreException) = 0; /** * Returns the role of the intro part (view or editor) * @return the role of the part */ virtual int GetRole() const = 0; /** * Returns the part id. * * @return the id of the part */ virtual std::string GetId() const = 0; /** * Returns the descriptor of the image for this part. * * @return the descriptor of the image to display next to this part */ virtual ImageDescriptor::Pointer GetImageDescriptor() const = 0; /** * Return the label override string for this part. * * @return the label override string or the empty string if one has not * been specified */ virtual std::string GetLabelOverride() const = 0; }; } #endif /* BERRYIINTRODESCRIPTOR_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.cpp new file mode 100644 index 0000000000..612b17ce59 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIIntroRegistry.h" + +namespace berry +{ + +IIntroRegistry::~IIntroRegistry() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.h index 536a338748..f0f69dd747 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/intro/berryIIntroRegistry.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIINTROREGISTRY_H_ #define BERRYIINTROREGISTRY_H_ #include "berryIIntroDescriptor.h" #include namespace berry { /** * Registry for introduction elements. * * @since 3.0 */ struct IIntroRegistry { - virtual ~IIntroRegistry() {}; + virtual ~IIntroRegistry(); /** * Return the number of introduction extensions known by this registry. * * @return the number of introduction extensions known by this registry */ virtual int GetIntroCount() const = 0; /** * Return the introduction extensions known by this registry. * * @return the introduction extensions known by this registry */ virtual std::vector GetIntros() const = 0; /** * Return the introduction extension that is bound to the given product. * * @param productId the product identifier * @return the introduction extension that is bound to the given product, * or null if there is no such binding */ virtual IIntroDescriptor::Pointer GetIntroForProduct(const std::string& productId) const = 0; /** * Find an intro descriptor with the given identifier. * * @param id the id * @return the intro descriptor, or null */ virtual IIntroDescriptor::Pointer GetIntro(const std::string& id) const = 0; }; } #endif /* BERRYIINTROREGISTRY_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.cpp new file mode 100644 index 0000000000..4b84a5144a --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIIntroManager.h" + +namespace berry +{ + +IIntroManager::~IIntroManager() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.h b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.h index 5fe36095b8..8e8f01a824 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroManager.h @@ -1,141 +1,141 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIINTROMANAGER_H_ #define BERRYIINTROMANAGER_H_ #include "berryIIntroPart.h" #include namespace berry { /** * Manages the intro part that introduces the product to new users. * The intro part is typically shown the first time a product is started up. *

* The initial behavior of the intro part is controlled by the application * from via the {@link org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()} * method. *

*

* See {@link org.eclipse.ui.intro.IIntroPart} for details on where intro parts * come from. *

*

* This interface is not intended to be extended or implemented by clients. *

* * @see org.eclipse.ui.IWorkbench#getIntroManager() * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IIntroManager { - virtual ~IIntroManager() {} + virtual ~IIntroManager(); /** * Closes the given intro part. * * @param part the intro part * @return true if the intro part was closed, and * false otherwise. false is returned * if part is null or it is not the intro part returned * by {@link #getIntro()}. */ virtual bool CloseIntro(IIntroPart::Pointer part) = 0; /** * Returns the intro part. Returns null if there is no intro * part, if it has been previously closed via {@link #closeIntro(IIntroPart)} * or if there is an intro part but {@link #showIntro(IWorkbenchWindow, boolean)} * has not yet been called to create it. * * @return the intro part, or null if none is available */ virtual IIntroPart::Pointer GetIntro() const = 0; /** * Return whether an intro is available. Note that this checks whether * there is an applicable intro part that could be instantiated and shown * to the user. * Use {@link #getIntro()} to discover whether an intro part has already * been created. * * @return true if there is an intro that could be shown, and * false if there is no intro */ virtual bool HasIntro() const = 0; /** * Return the standby state of the given intro part. * * @param part the intro part * @return true if the part in its partially * visible standy mode, and false if in its fully visible state. * false is returned if part is null or it is not * the intro part returned by {@link #getIntro()}. */ virtual bool IsIntroStandby(IIntroPart::Pointer part) const = 0; /** * Sets the standby state of the given intro part. Intro part usually should * render themselves differently in the full and standby modes. In standby * mode, the part should be partially visible to the user but otherwise * allow them to work. In full mode, the part should be fully visible and * be the center of the user's attention. *

* This method does nothing if the part is null or is not * the intro part returned by {@link #getIntro()}. *

* * @param part the intro part, or null * @param standby true to put the part in its partially * visible standy mode, and false to make it fully visible. */ virtual void SetIntroStandby(IIntroPart::Pointer part, bool standby) = 0; /** * Shows the intro part in the given workbench window. If the intro part has * not been created yet, one will be created. If the intro part is currently * being shown in some workbench window, that other window is made active. * * @param preferredWindow the preferred workbench window, or * null to indicate the currently active workbench window * @param standby true to put the intro part in its partially * visible standy mode, and false to make it fully visible * @return the newly-created or existing intro part, or null * if no intro part is available or if preferredWindow is * null and there is no currently active workbench window */ virtual IIntroPart::Pointer ShowIntro( IWorkbenchWindow::Pointer preferredWindow, bool standby) = 0; /** * Returns true if there is an intro content detector and it * reports that new intro content is available. * * @return true if new intro content is available * * @since 3.3 */ virtual bool IsNewContentAvailable() = 0; }; } #endif /* BERRYIINTROMANAGER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.cpp new file mode 100644 index 0000000000..531d71d12b --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIIntroPart.h" + +namespace berry +{ + +IIntroPart::~IIntroPart() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.h b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.h index e1116c7bc4..7bee9624f1 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroPart.h @@ -1,212 +1,214 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIINTROPART_H_ #define BERRYIINTROPART_H_ #include #include #include #include #include #include "berryIIntroSite.h" #include namespace berry { /** * The intro part is a visual component within the workbench responsible for * introducing the product to new users. The intro part is typically shown the * first time a product is started up. *

* The intro part implementation is contributed to the workbench via the * org.blueberry.ui.intro extension point. There can be several * intro part implementations, and associations between intro part * implementations and products. The workbench will only make use of the intro * part implementation for the current product (as given by * {@link berry::Platform#GetProduct()}. There is at most one * intro part instance in the entire workbench, and it resides in exactly one * workbench window at a time. *

*

* This interface in not intended to be directly implemented. Rather, clients * providing a intro part implementation should subclass * {@link berry::IntroPart}. *

* * @see IIntroManager#ShowIntro(IWorkbenchWindow::Pointer, bool) * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IIntroPart : public virtual Object { // IAdaptable { berryInterfaceMacro(IIntroPart, berry) + ~IIntroPart(); + /** * The property id for getTitleImage and * getTitle. * * @since 3.2 this property now covers changes to getTitle in * addition to getTitleImage */ //static const int PROP_TITLE = IWorkbenchPart::PROP_TITLE; /** * Returns the site for this intro part. * * @return the intro site */ virtual IIntroSite::Pointer GetIntroSite() const = 0; /** * Initializes this intro part with the given intro site. A memento is * passed to the part which contains a snapshot of the part state from a * previous session. Where possible, the part should try to recreate that * state. *

* This method is automatically called by the workbench shortly after * part construction. It marks the start of the intro's lifecycle. Clients * must not call this method. *

* * @param site the intro site * @param memento the intro part state or null if there is no previous * saved state * @exception PartInitException if this part was not initialized * successfully */ virtual void Init(IIntroSite::Pointer site, IMemento::Pointer memento) throw(PartInitException) = 0; /** * Sets the standby state of this intro part. An intro part should render * itself differently in the full and standby modes. In standby mode, the * part should be partially visible to the user but otherwise allow them * to work. In full mode, the part should be fully visible and be the center * of the user's attention. *

* This method is automatically called by the workbench at appropriate * times. Clients must not call this method directly (call * {@link IIntroManager#setIntroStandby(IIntroPart, boolean)} instead. *

* * @param standby true to put this part in its partially * visible standy mode, and false to make it fully visible */ virtual void StandbyStateChanged(bool standby) = 0; /** * Saves the object state within a memento. *

* This method is automatically called by the workbench at appropriate * times. Clients must not call this method directly. *

* * @param memento a memento to receive the object state */ virtual void SaveState(IMemento::Pointer memento) = 0; /** * Adds a listener for changes to properties of this intro part. * Has no effect if an identical listener is already registered. *

* The properties ids are as follows: *

    *
  • IIntroPart.PROP_TITLE
  • *
*

* * @param listener a property listener */ virtual void AddPropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Creates the SWT controls for this intro part. *

* Clients should not call this method (the workbench calls this method when * it needs to, which may be never). *

*

* For implementors this is a multi-step process: *

    *
  1. Create one or more controls within the parent.
  2. *
  3. Set the parent layout as needed.
  4. *
  5. Register any global actions with the IActionService.
  6. *
  7. Register any popup menus with the IActionService.
  8. *
  9. Register a selection provider with the ISelectionService * (optional).
  10. *
*

* * @param parent the parent control */ virtual void CreatePartControl(void* parent) = 0; /** * Returns the title image of this intro part. If this value changes * the part must fire a property listener event with * {@link IIntroPart#PROP_TITLE}. *

* The title image is usually used to populate the title bar of this part's * visual container. Since this image is managed by the part itself, callers * must not dispose the returned image. *

* * @return the title image */ virtual void* GetTitleImage() const = 0; /** * Returns the title of this intro part. If this value changes * the part must fire a property listener event with * {@link IIntroPart#PROP_TITLE}. *

* The title is used to populate the title bar of this part's visual * container. *

* * @return the intro part title (not null) * @since 3.2 */ virtual std::string GetPartName() const = 0; /** * Removes the given property listener from this intro part. * Has no affect if an identical listener is not registered. * * @param listener a property listener */ virtual void RemovePropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Asks this part to take focus within the workbench. *

* Clients should not call this method (the workbench calls this method at * appropriate times). To have the workbench activate a part, use * {@link IIntroManager#showIntro(IWorkbenchWindow, boolean)}. *

*/ virtual void SetFocus() = 0; }; } Q_DECLARE_INTERFACE(berry::IIntroPart, "org.blueberry.IIntroPart") #endif /* BERRYIINTROPART_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.cpp new file mode 100644 index 0000000000..dae3d4e578 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIIntroSite.h" + +namespace berry +{ + +IIntroSite::~IIntroSite() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.h b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.h index 104c606ff5..95494b5a4b 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/intro/berryIIntroSite.h @@ -1,70 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIINTROSITE_H_ #define BERRYIINTROSITE_H_ #include namespace berry { /** * The primary interface between an intro part and the workbench. *

* The workbench exposes its implemention of intro part sites via this * interface, which is not intended to be implemented or extended by clients. *

* * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IIntroSite : public IWorkbenchSite { berryInterfaceMacro(IIntroSite, berry) + ~IIntroSite(); + /** * Returns the part registry extension id for this intro site's part. *

* The name comes from the id attribute in the configuration * element. *

* * @return the registry extension id */ virtual std::string GetId() const = 0; /** * Returns the unique identifier of the plug-in that defines this intro * site's part. * * @return the unique identifier of the declaring plug-in * @see org.eclipse.core.runtime.IPluginDescriptor#getUniqueIdentifier() */ virtual std::string GetPluginId() const = 0; /** * Returns the action bars for this part site. * The intro part has exclusive use of its site's action bars. * * @return the action bars */ //virtual IActionBars GetActionBars() const = 0; }; } #endif /* BERRYIINTROSITE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.cpp index a4fd475fcb..5e4144648a 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.cpp @@ -1,38 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIPresentablePart.h" #include "berryIWorkbenchPartConstants.h" namespace berry { const int IPresentablePart::PROP_DIRTY = IWorkbenchPartConstants::PROP_DIRTY; const int IPresentablePart::PROP_INPUT = IWorkbenchPartConstants::PROP_INPUT; const int IPresentablePart::PROP_TITLE = IWorkbenchPartConstants::PROP_TITLE; const int IPresentablePart::PROP_CONTENT_DESCRIPTION = IWorkbenchPartConstants::PROP_CONTENT_DESCRIPTION; const int IPresentablePart::PROP_PART_NAME = IWorkbenchPartConstants::PROP_PART_NAME; const int IPresentablePart::PROP_BUSY = 0x92; const int IPresentablePart::PROP_TOOLBAR = 0x93; const int IPresentablePart::PROP_HIGHLIGHT_IF_BACK = 0x94; const int IPresentablePart::PROP_PANE_MENU = 0x302; const int IPresentablePart::PROP_PREFERRED_SIZE = IWorkbenchPartConstants::PROP_PREFERRED_SIZE; +IPresentablePart::~IPresentablePart() +{ + +} + } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.h b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.h index 62ac2dffb1..c125ed1359 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentablePart.h @@ -1,267 +1,269 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPRESENTABLEPART_H_ #define BERRYIPRESENTABLEPART_H_ #include #include "berryISizeProvider.h" #include "berryRectangle.h" #include "berryIPropertyChangeListener.h" namespace berry { /** * This is a skin's interface to the contents of a view or editor. Note that this * is essentially the same as IWorkbenchPart, except it does not provide access * to lifecycle events and allows repositioning of the part. * * Not intended to be implemented by clients. * * @since 3.0 * @since 3.4 now extends {@link org.blueberry.ui.ISizeProvider} * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IPresentablePart : public Object, public ISizeProvider { berryInterfaceMacro(IPresentablePart, berry); + ~IPresentablePart(); + /** * The property id for isDirty. */ static const int PROP_DIRTY; // = IWorkbenchPartConstants.PROP_DIRTY; /** * The property id for getEditorInput. */ static const int PROP_INPUT; // = IWorkbenchPartConstants.PROP_INPUT; /** * The property id for getTitle, getTitleImage * and getTitleToolTip. */ static const int PROP_TITLE; // = IWorkbenchPartConstants.PROP_TITLE; /** * The property id for IWorkbenchPart2.getContentDescription() */ static const int PROP_CONTENT_DESCRIPTION; // = IWorkbenchPartConstants.PROP_CONTENT_DESCRIPTION; /** * The property id for IWorkbenchPart2.getContentDescription() */ static const int PROP_PART_NAME; // = IWorkbenchPartConstants.PROP_PART_NAME; /** * The property id for isBusy. */ static const int PROP_BUSY; // = 0x92; /** * The property id for toolbar changes */ static const int PROP_TOOLBAR; // = 0x93; /** * The property id for highlighting the * part if it is not in front. */ static const int PROP_HIGHLIGHT_IF_BACK; // = 0x94; /** * The property id for pane menu changes */ static const int PROP_PANE_MENU; // = 0x302; /** * The property id for preferred size changes * @since 3.4 */ static const int PROP_PREFERRED_SIZE; // = IWorkbenchPartConstants.PROP_PREFERRED_SIZE; /** * Sets the bounds of this part. * * @param bounds bounding rectangle (not null) */ virtual void SetBounds(const Rectangle& bounds) = 0; /** * Notifies the part whether or not it is visible in the current * perspective. A part is visible iff any part of its widgetry can * be seen. * * @param isVisible true if the part has just become visible, false * if the part has just become hidden */ virtual void SetVisible(bool isVisible) = 0; /** * Forces this part to have focus. */ virtual void SetFocus() = 0; /** * Adds a listener for changes to properties of this workbench part. * Has no effect if an identical listener is already registered. *

* The properties ids are defined by the PROP_* constants, above. *

* * @param listener a property listener (not null) */ virtual void AddPropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Remove a listener that was previously added using addPropertyListener. * * @param listener a property listener (not null) */ virtual void RemovePropertyListener(IPropertyChangeListener::Pointer listener) = 0; /** * Returns the short name of the part. This is used as the text on * the tab when this part is stacked on top of other parts. * * @return the short name of the part (not null) */ virtual std::string GetName() const = 0; /** * Returns the title of this workbench part. If this value changes * the part must fire a property listener event with * PROP_TITLE. *

* The title is used to populate the title bar of this part's visual * container. *

* * @return the workbench part title (not null) */ virtual std::string GetTitle() const = 0; /** * Returns the status message from the part's title, or the empty string if none. * This is a substring of the part's title. A typical title will consist of * the part name, a separator, and a status message describing the current contents. *

* Presentations can query getName() and getTitleStatus() if they want to display * the status message and name separately, or they can use getTitle() if they want * to display the entire title. *

* * @return the status message or the empty string if none (not null) */ virtual std::string GetTitleStatus() const = 0; /** * Returns the title image of this workbench part. If this value changes * the part must fire a property listener event with * PROP_TITLE. *

* The title image is usually used to populate the title bar of this part's * visual container. Since this image is managed by the part itself, callers * must not dispose the returned image. *

* * @return the title image */ virtual void* GetTitleImage() = 0; /** * Returns the title tool tip text of this workbench part. If this value * changes the part must fire a property listener event with * PROP_TITLE. *

* The tool tip text is used to populate the title bar of this part's * visual container. *

* * @return the workbench part title tool tip (not null) */ virtual std::string GetTitleToolTip() const = 0; /** * Returns true iff the contents of this part have changed recently. For * editors, this indicates that the part has changed since the last save. * For views, this indicates that the view contains interesting changes * that it wants to draw the user's attention to. * * @return true iff the part is dirty */ virtual bool IsDirty() const = 0; /** * Return true if the the receiver is currently in a busy state. * @return boolean true if busy */ virtual bool IsBusy() const = 0; /** * Returns true iff this part can be closed * * @return true iff this part can be closed * @since 3.1 */ virtual bool IsCloseable() const = 0; /** * Returns the local toolbar for this part, or null if this part does not * have a local toolbar. Callers must not dispose or downcast the return value. * * @return the local toolbar for the part, or null if none */ virtual void* GetToolBar() = 0; /** * Returns the menu for this part or null if none * * @return the menu for this part or null if none */ //virtual IPartMenu getMenu(); /** * Returns an SWT control that can be used to indicate the tab order for * this part. This can be returned as part of the result to * {@link StackPresentation#getTabList(IPresentablePart)}. Any other use of this control is * unsupported. This may return a placeholder control that is only * meaningful in the context of getTabList. * * @return the part's control (not null) */ virtual void* GetControl() = 0; /** * Get a property from the part's arbitrary property set. *

* Note: this is a different set of properties than the ones covered * by the PROP_* constants. *

* * @param key * The property key to retrieve. Must not be null. * @return the property, or null if that property is not set. * @since 3.3 */ virtual std::string GetPartProperty(const std::string& key) const = 0; }; } #endif /* BERRYIPRESENTABLEPART_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.cpp index 45cc023f7c..563a6de5e6 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.cpp @@ -1,29 +1,34 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIPresentationFactory.h" #include "berryConstants.h" namespace berry { +IPresentationFactory::~IPresentationFactory() +{ + +} + int IPresentationFactory::SASHTYPE_NORMAL = 0; int IPresentationFactory::SASHTYPE_FLOATING = 1 << 1; int IPresentationFactory::SASHORIENTATION_HORIZONTAL = Constants::HORIZONTAL; // 1<<8 int IPresentationFactory::SASHORIENTATION_VERTICAL = Constants::VERTICAL; // 1<<9 } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.h b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.h index 70a8055e7a..ae2ba8077c 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationFactory.h @@ -1,187 +1,187 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPRESENTATIONFACTORY_H_ #define BERRYIPRESENTATIONFACTORY_H_ #include #include "berryStackPresentation.h" #include namespace berry { /** * This is a factory for presentation objects that control the appearance of * editors, views and other components in the workbench. * * @since 3.0 */ class BERRY_UI IPresentationFactory { public: berryManifestMacro(IPresentationFactory, berry); - virtual ~IPresentationFactory() {} + virtual ~IPresentationFactory(); /** * Bit value for the createSash method's 'style' parameter. * @since 3.4 */ static int SASHTYPE_NORMAL; // = 0; /** * Bit value for the createSash method's 'style' parameter. * @since 3.4 */ static int SASHTYPE_FLOATING; // = 1<<1; /** * Bit value for the createSash method's 'style' parameter. * @since 3.4 */ static int SASHORIENTATION_HORIZONTAL; // = SWT.HORIZONTAL; // 1<<8 /** * Bit value for the createSash method's 'style' parameter. * @since 3.4 */ static int SASHORIENTATION_VERTICAL; // = SWT.VERTICAL; // 1<<9 /** * Creates an editor presentation for presenting editors. *

* The presentation creates its controls under the given parent composite. *

* * @param parent * the parent composite to use for the presentation's controls * @param site * the site used for communication between the presentation and * the workbench * @return a newly created part presentation */ virtual StackPresentation::Pointer CreateEditorPresentation( void* parent, IStackPresentationSite::Pointer site) = 0; /** * Creates a stack presentation for presenting regular docked views. *

* The presentation creates its controls under the given parent composite. *

* * @param parent * the parent composite to use for the presentation's controls * @param site * the site used for communication between the presentation and * the workbench * @return a newly created part presentation */ virtual StackPresentation::Pointer CreateViewPresentation(void* parent, IStackPresentationSite::Pointer site) = 0; /** * Creates a standalone stack presentation for presenting a standalone view. * A standalone view cannot be docked together with other views. The title * of a standalone view may be hidden. *

* The presentation creates its controls under the given parent composite. *

* * @param parent * the parent composite to use for the presentation's controls * @param site * the site used for communication between the presentation and * the workbench * @param showTitle * true to show the title for the view, * false to hide it * @return a newly created part presentation */ virtual StackPresentation::Pointer CreateStandaloneViewPresentation( void* parent, IStackPresentationSite::Pointer site, bool showTitle) = 0; /** * Creates the status line manager for the window. * Subclasses may override. * * @return the window's status line manager */ // public IStatusLineManager createStatusLineManager() { // return new StatusLineManager(); // } /** * Creates the control for the window's status line. * Subclasses may override. * * @param statusLine the window's status line manager * @param parent the parent composite * @return the window's status line control */ // public Control createStatusLineControl(IStatusLineManager statusLine, // Composite parent) { // return ((StatusLineManager) statusLine).createControl(parent, SWT.NONE); // } /** * Returns a globally unique identifier for this type of presentation factory. This is used * to ensure that one presentation is not restored from mementos saved by a different * presentation. * * @return a globally unique identifier for this type of presentation factory. */ virtual std::string GetId() = 0; /** * Creates the Sash control that is used to separate view and editor parts. * * @param parent the parent composite * @param style A bit set giving both the 'type' of the desired sash and * its orientation (i.e. one 'SASHTYPE' value and one "SASHORIENTATION" value). * @return the sash control * @since 3.4 */ virtual void* CreateSash(void* parent, int style) = 0; // { // int orientation = style & (SASHORIENTATION_HORIZONTAL // | SASHORIENTATION_VERTICAL); // Sash sash = new Sash(parent, orientation | SWT.SMOOTH); // return sash; // } /** * Returns the size of the Sash control that is used to separate view and editor parts. * * @param style A bit set giving both the 'type' of the desired sash and * its orientation. * @return the sash size * @since 3.4 */ virtual int GetSashSize(int style) = 0; /** * Applies changes of the current theme to the user interface. */ virtual void UpdateTheme() = 0; }; } Q_DECLARE_INTERFACE(berry::IPresentationFactory, "org.blueberry.IPresentationFactory") #endif /* BERRYABSTRACTPRESENTATIONFACTORY_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.cpp new file mode 100644 index 0000000000..77c6087eab --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIPresentationSerializer.h" + +namespace berry +{ + +IPresentationSerializer::~IPresentationSerializer() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.h b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.h index 17ead8cef7..d94c374feb 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIPresentationSerializer.h @@ -1,66 +1,66 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPRESENTATIONSERIALIZER_H_ #define BERRYIPRESENTATIONSERIALIZER_H_ #include "berryIPresentablePart.h" #include namespace berry { /** * This interface is given to a StackPresentation when it is loading or saving * its state. * * Not intended to be implemented by clients * * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ struct IPresentationSerializer { /** * Returns a unique identifier for the given part. The identifier can later * be used to restore the original part by calling getPart(...). This identifier * is guaranteed to be unique within a particular StackPresentation. However, * the same part may be assigned a different ID each time the presentation is saved. * * @param part a part to be identified (not null) * @return a unique identifier for the part (not null) */ virtual std::string GetId(IPresentablePart::Pointer part) = 0; /** * Returns a presentable part, given an id that was generated when the presentation * was saved. * * @param id an ID that was generated by getId(IPresentablePart) when the presentation * was saved * @return the presentable part associated with the given id, or null if none. Note * that even if the ID was valid when the presentation was saved, it may not * be valid when the presentation is restored. Callers must be prepared * to handle a null result. */ virtual IPresentablePart::Pointer GetPart(const std::string& id) = 0; - virtual ~IPresentationSerializer() {} + virtual ~IPresentationSerializer(); }; } #endif /* BERRYIPRESENTATIONSERIALIZER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.cpp index b07871c2e7..ee6c917934 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.cpp @@ -1,25 +1,30 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIStackPresentationSite.h" namespace berry { int IStackPresentationSite::STATE_MINIMIZED = 0; int IStackPresentationSite::STATE_MAXIMIZED = 1; int IStackPresentationSite::STATE_RESTORED = 2; +IStackPresentationSite::~IStackPresentationSite() +{ + +} + } diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.h b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.h index 289b88b7b5..ea4a549e2e 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/presentations/berryIStackPresentationSite.h @@ -1,191 +1,193 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISTACKPRESENTATIONSITE_H_ #define BERRYISTACKPRESENTATIONSITE_H_ #include #include #include "berryIPresentablePart.h" #include #include "berryPoint.h" namespace berry { /** * Represents the main interface between a StackPresentation and the workbench. * * Not intended to be implemented by clients. * * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ struct BERRY_UI IStackPresentationSite : public Object { berryInterfaceMacro(IStackPresentationSite, berry); static int STATE_MINIMIZED; // = 0; static int STATE_MAXIMIZED; // = 1; static int STATE_RESTORED; // = 2; + ~IStackPresentationSite(); + /** * Sets the state of the container. Called by the presentation when the * user causes the the container to be minimized, maximized, etc. * * @param newState one of the STATE_* constants */ virtual void SetState(int newState) = 0; /** * Returns the current state of the site (one of the STATE_* constants) * * @return the current state of the site (one of the STATE_* constants) */ virtual int GetState() = 0; /** * Returns true iff the site supports the given state * * @param state one of the STATE_* constants, above * @return true iff the site supports the given state */ virtual bool SupportsState(int state) = 0; /** * Begins dragging the given part * * @param beingDragged the part to drag (not null) * @param initialPosition the mouse position at the time of the initial mousedown * (display coordinates, not null) * @param keyboard true iff the drag was initiated via mouse dragging, * and false if the drag may be using the keyboard */ virtual void DragStart(IPresentablePart::Pointer beingDragged, Point& initialPosition, bool keyboard) = 0; /** * Closes the given set of parts. * * @param toClose the set of parts to close (Not null. All of the entries must be non-null) */ virtual void Close(const std::vector& toClose) = 0; /** * Begins dragging the entire stack of parts * * @param initialPosition the mouse position at the time of the initial mousedown (display coordinates, * not null) * @param keyboard true iff the drag was initiated via mouse dragging, * and false if the drag may be using the keyboard */ virtual void DragStart(Point& initialPosition, bool keyboard) = 0; /** * Returns true iff this site will allow the given part to be closed * * @param toClose part to test (not null) * @return true iff the part may be closed */ virtual bool IsCloseable(IPresentablePart::Pointer toClose) = 0; /** * Returns true iff the given part can be dragged. If this * returns false, the given part should not trigger a drag. * * @param toMove part to test (not null) * @return true iff this part is a valid drag source */ virtual bool IsPartMoveable(IPresentablePart::Pointer toMove) = 0; /** * Returns true iff this entire stack can be dragged * * @return true iff the stack can be dragged */ virtual bool IsStackMoveable() = 0; /** * Makes the given part active * * @param toSelect */ virtual void SelectPart(IPresentablePart::Pointer toSelect) = 0; /** * Returns the currently selected part or null if the stack is empty * * @return the currently selected part or null if the stack is empty */ virtual IPresentablePart::Pointer GetSelectedPart() = 0; /** * Adds system actions to the given menu manager. The site may * make use of the following group ids: *
    *
  • close, for close actions
  • *
  • size, for resize actions
  • *
  • misc, for miscellaneous actions
  • *
* The presentation can control the insertion position by creating * these group IDs where appropriate. * * @param menuManager the menu manager to populate */ //virtual void AddSystemActions(IMenuManager menuManager); /** * Notifies the workbench that the preferred size of the presentation has * changed. Hints to the workbench that it should trigger a layout at the * next opportunity. * * @since 3.1 */ virtual void FlushLayout() = 0; /** * Returns the list of presentable parts currently in this site * * @return the list of presentable parts currently in this site * @since 3.1 */ virtual std::list GetPartList() = 0; /** * Returns the property with the given id or null. Folder * properties are an extensible mechanism for perspective authors to * customize the appearance of view stacks. The list of customizable * properties is determined by the presentation factory, and set in the * perspective factory. * * @param id * Must not be null. * @return property value, or null if the property is not * set. * @since 3.3 */ virtual std::string GetProperty(const std::string& id) = 0; }; } #endif /* BERRYISTACKPRESENTATIONSITE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.cpp new file mode 100644 index 0000000000..bb4ce1a119 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIDisposable.h" + +namespace berry +{ + +IDisposable::~IDisposable() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.h b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.h index ced7ed505b..05ad52c1d5 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIDisposable.h @@ -1,67 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIDISPOSABLE_H_ #define BERRYIDISPOSABLE_H_ #include #include #include namespace berry { /** *

* The interface that should be implemented by services that make themselves * available through the IAdaptable mechanism. This is the * interface that drives the majority of services provided at the workbench * level. *

*

* A service has life-cycle. When the constructor completes, the service must be * fully functional. When it comes time for the service to go away, then the * service will receive a {@link #dispose()} call. At this point, the service * must release all resources and detach all listeners. A service can only be * disposed once; it cannot be reused. *

*

* This interface has nothing to do with OSGi services. *

*

* This interface can be extended or implemented by clients. *

* * @since 3.2 */ struct BERRY_UI IDisposable : public virtual Object { berryInterfaceMacro(IDisposable, berry) + ~IDisposable(); + /** * Disposes of this service. All resources must be freed. All listeners must * be detached. Dispose will only be called once during the life cycle of a * service. */ virtual void Dispose() = 0; }; } #endif /* BERRYIDISPOSABLE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.cpp new file mode 100644 index 0000000000..c4aa53b308 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryINestable.h" + +namespace berry +{ + +INestable::~INestable() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.h b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.h index ea01387862..7a399ca201 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryINestable.h @@ -1,80 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYINESTABLE_H_ #define BERRYINESTABLE_H_ #include #include #include namespace berry { /** *

* A service which can appear on a component which is wholly contained with * another component. The component on which it appears can be active or * inactive -- depending on the state of the application. For example, a * workbench part is a component which appears within a workbench window. This * workbench part can either be active or inactive, depending on what the user * is doing. *

*

* Services implement this interface, and are then notified by the component * when the activation changes. It is the responsibility of the component to * notify such services when the activation changes. *

*

* This class is not intended for use outside of the * org.blueberry.ui.workbench plug-in. *

*

* PROVISIONAL. This class or interface has been added as part * of a work in progress. There is a guarantee neither that this API will work * nor that it will remain the same. Please do not use this API without * consulting with the Platform/UI team. *

*

* This class should eventually move to org.blueberry.ui.services. *

* * @since 3.2 */ struct BERRY_UI INestable : public virtual Object { berryInterfaceMacro(INestable, berry) + ~INestable(); + /** * Notifies this service that the component within which it exists has * become active. The service should modify its state as appropriate. * */ virtual void Activate() = 0; /** * Notifies this service that the component within which it exists has * become inactive. The service should modify its state as appropriate. */ virtual void Deactivate() = 0; }; } #endif /* BERRYINESTABLE_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.cpp new file mode 100644 index 0000000000..0dee9cfc4a --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIServiceFactory.h" + +namespace berry +{ + +IServiceFactory::~IServiceFactory() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.h b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.h index 91c44b4b1e..e0938f94be 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceFactory.h @@ -1,74 +1,76 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISERVICEFACTORY_H_ #define BERRYISERVICEFACTORY_H_ #include #include #include #include namespace berry { struct IServiceLocator; /** * A factory for creating services for use with the * org.blueberry.ui.services extension point. You are given a * service locator to look up other services, and can retrieve your parent * service (if one has already been created). * * @since 3.4 */ struct BERRY_UI IServiceFactory : public virtual Object { berryInterfaceMacro(IServiceFactory, berry); + ~IServiceFactory(); + /** * When a service locator cannot find a service it will request one from the * registry, which will call this factory create method. *

* You can use the locator to get any needed services and a parent service * locator will be provided if you need access to the parent service. If the * parent object return from the parent locator is not null * it can be cast to the service interface that is requested. The parent * service locator will only return the serviceInterface service. *

* * @param serviceInterface * the service we need to create. Will not be null. * @param parentLocator * A locator that can return a parent service instance if * desired. The parent service can be cast to serviceInterface. * Will not be null. * @param locator * the service locator which can be used to retrieve dependent * services. Will not be null * @return the created service or null */ virtual Object::Pointer Create(const std::string& serviceInterface, const SmartPointer parentLocator, const SmartPointer locator) const = 0; }; } Q_DECLARE_INTERFACE(berry::IServiceFactory, "org.blueberry.IServiceFactory") #endif /* BERRYISERVICEFACTORY_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.cpp new file mode 100644 index 0000000000..90a9f8865a --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIServiceLocator.h" + +namespace berry +{ + +IServiceLocator::~IServiceLocator() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.h b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.h index d0c870a892..4e75f00e65 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceLocator.h @@ -1,79 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISERVICELOCATOR_H_ #define BERRYISERVICELOCATOR_H_ #include #include #include namespace berry { /** *

* A component with which one or more services are registered. The services can * be retrieved from this locator using some key -- typically the class * representing the interface the service must implement. For example: *

* *
  * IHandlerService service = (IHandlerService) workbenchWindow
  *    .getService(IHandlerService.class);
  * 
* *

* This interface is not to be implemented or extended by clients. *

* * @since 3.2 */ struct BERRY_UI IServiceLocator : public virtual Object { berryInterfaceMacro(IServiceLocator, berry) + ~IServiceLocator(); + /** * Retrieves the service corresponding to the given API. * * @param api * This is the interface that the service implements. Must not be * null. * @return The service, or null if no such service could be * found. */ virtual Object::Pointer GetService(const std::string& api) = 0; /** * Whether this service exists within the scope of this service locator. * This does not include looking for the service within the scope of the * parents. This method can be used to determine whether a particular * service supports nesting in this scope. * * @param api * This is the interface that the service implements. Must not be * null. * @return true iff the service locator can find a service * for the given API; false otherwise. */ virtual bool HasService(const std::string& api) const = 0; }; } #endif /* BERRYISERVICELOCATOR_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.cpp new file mode 100644 index 0000000000..72befd519e --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryIServiceWithSources.h" + +namespace berry +{ + +IServiceWithSources::~IServiceWithSources() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.h b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.h index d14a7698ca..75a79a334f 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/services/berryIServiceWithSources.h @@ -1,66 +1,68 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISERVICEWITHSOURCES_H_ #define BERRYISERVICEWITHSOURCES_H_ #include "berryIDisposable.h" namespace berry { struct ISourceProvider; /** *

* A service that responds to changes in one or more sources. These sources can * be plugged into the service. Sources represent a common event framework for * services. *

*

* Clients must not extend or implement. *

* */ struct BERRY_UI IServiceWithSources : public IDisposable { berryInterfaceMacro(IServiceWithSources, berry) + ~IServiceWithSources(); + /** * Adds a source provider to this service. A source provider will notify the * service when the source it provides changes. An example of a source might * be an active editor or the current selection. This amounts to a pluggable * state tracker for the service. * * @param provider * The provider to add; must not be null. */ virtual void AddSourceProvider(SmartPointer provider) = 0; /** * Removes a source provider from this service. Most of the time, this * method call is not required as source providers typically share the same * life span as the workbench itself. * * @param provider * The provider to remove; must not be null. */ virtual void RemoveSourceProvider(SmartPointer provider) = 0; }; } #endif /* BERRYISERVICEWITHSOURCES_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.cpp new file mode 100644 index 0000000000..1a9a419efc --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryITracker.h" + +namespace berry +{ + +ITracker::~ITracker() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.h b/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.h index b96b324a1f..c3f0f7207e 100755 --- a/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/tweaklets/berryITracker.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYITRACKER_H_ #define BERRYITRACKER_H_ #include "berryDnDTweaklet.h" #include "berryRectangle.h" #include "guitk/berryGuiTkIControlListener.h" namespace berry { /** * Instances of this class implement a rubber banding rectangle that is * drawn onto a parent control or display. * These rectangles can be specified to respond to mouse and key events * by either moving or resizing themselves accordingly. Trackers are * typically used to represent window geometries in a lightweight manner. * */ struct ITracker { - virtual ~ITracker() {} + virtual ~ITracker(); virtual Rectangle GetRectangle() = 0; virtual void SetRectangle(const Rectangle& rectangle) = 0; virtual void SetCursor(DnDTweaklet::CursorType cursor) = 0; virtual bool Open() = 0; virtual void AddControlListener(GuiTk::IControlListener::Pointer listener) = 0; virtual void RemoveControlListener(GuiTk::IControlListener::Pointer listener) = 0; }; } #endif /* BERRYITRACKER_H_ */ diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.cpp new file mode 100644 index 0000000000..f31dce5674 --- /dev/null +++ b/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.cpp @@ -0,0 +1,26 @@ +/*========================================================================= + + Program: BlueBerry Platform + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) German Cancer Research Center, Division of Medical and + Biological Informatics. All rights reserved. + See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + + =========================================================================*/ + +#include "berryISafeRunnableRunner.h" + +namespace berry +{ + +ISafeRunnableRunner::~ISafeRunnableRunner() +{ +} +} diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.h b/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.h index 15aabe4912..c3034edffd 100644 --- a/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.h +++ b/BlueBerry/Bundles/org.blueberry.ui/src/util/berryISafeRunnableRunner.h @@ -1,61 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYISAFERUNNABLERUNNER_H_ #define BERRYISAFERUNNABLERUNNER_H_ #include #include #include #include namespace berry { /** * Runs a safe runnables. *

* Clients may provide their own implementation to change * how safe runnables are run from within the workbench. *

* * @see SafeRunnable#GetRunner() * @see SafeRunnable#SetRunner(ISafeRunnableRunner::Pointer) * @see SafeRunnable#Run(ISafeRunnable::Pointer) */ struct BERRY_UI ISafeRunnableRunner : public Object { public: berryInterfaceMacro(ISafeRunnableRunner, berry) + ~ISafeRunnableRunner(); + /** * Runs the runnable. All ISafeRunnableRunners must catch any exception * thrown by the ISafeRunnable and pass the exception to * ISafeRunnable::HandleException(). * @param code the code executed as a save runnable * * @see SafeRunnable#Run(ISafeRunnable::Pointer) */ virtual void Run(ISafeRunnable::Pointer code) = 0; }; } #endif /* BERRYISAFERUNNABLERUNNER_H_ */ diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.cpp b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.cpp index c6d11755e2..2ab25e871d 100644 --- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.cpp +++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.cpp @@ -1,26 +1,28 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkIRenderWindowPart.h" namespace mitk { const QString IRenderWindowPart::DECORATION_BORDER = "border"; const QString IRenderWindowPart::DECORATION_LOGO = "logo"; const QString IRenderWindowPart::DECORATION_MENU = "menu"; const QString IRenderWindowPart::DECORATION_BACKGROUND = "background"; +IRenderWindowPart::~IRenderWindowPart() {} + } diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h index b557f214bb..57cb329506 100644 --- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h +++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h @@ -1,190 +1,190 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIRENDERWINDOWPART_H #define MITKIRENDERWINDOWPART_H #include #include #include #include #include #include #include class QmitkRenderWindow; namespace mitk { struct IRenderingManager; class SliceNavigationController; /** * \ingroup org_mitk_gui_common * * \brief Interface for a MITK Workbench Part providing a render window. * * This interface allows generic access to Workbench parts which provide some * kind of render window. The interface is intended to be implemented by * subclasses of berry::IWorkbenchPart. Usually, the interface is implemented * by a Workbench editor. * * A IRenderWindowPart provides zero or more QmitkRenderWindow instances which can * be controlled via this interface. QmitkRenderWindow instances have an associated * \e id, which is implementation specific. However, implementations should consider * to use one of the following ids for certain QmitkRenderWindow instances to maximize * reusability (they are free to map multiple ids to one QmitkRenderWindow internally): *
    *
  • transversal
  • *
  • sagittal
  • *
  • coronal
  • *
  • 3d
  • *
* * \see ILinkedRenderWindowPart * \see IRenderWindowPartListener * \see QmitkAbstractRenderEditor */ struct MITK_GUI_COMMON_PLUGIN IRenderWindowPart { static const QString DECORATION_BORDER; // = "border" static const QString DECORATION_LOGO; // = "logo" static const QString DECORATION_MENU; // = "menu" static const QString DECORATION_BACKGROUND; // = "background; - virtual ~IRenderWindowPart() {} + virtual ~IRenderWindowPart(); /** * Get the currently active (focused) render window. * Focus handling is implementation specific. * * \return The active QmitkRenderWindow instance; NULL * if no render window is active. */ virtual QmitkRenderWindow* GetActiveRenderWindow() const = 0; /** * Get all render windows with their ids. * * \return A hash map mapping the render window id to the QmitkRenderWindow instance. */ virtual QHash GetRenderWindows() const = 0; /** * Get a render window with a specific id. * * \param id The render window id. * \return The QmitkRenderWindow instance for id */ virtual QmitkRenderWindow* GetRenderWindow(const QString& id) const = 0; /** * Get the rendering manager used by this render window part. * * \return The current IRenderingManager instance or NULL * if no rendering manager is used. */ virtual mitk::IRenderingManager* GetRenderingManager() const = 0; /** * Request an update of all render windows. * * \param requestType Specifies the type of render windows for which an update * will be requested. */ virtual void RequestUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) = 0; /** * Force an immediate update of all render windows. * * \param requestType Specifies the type of render windows for which an immediate update * will be requested. */ virtual void ForceImmediateUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) = 0; /** * Get the SliceNavigationController for controlling time positions. * * \return A SliceNavigationController if the render window supports this * operation; otherwise returns NULL. */ virtual mitk::SliceNavigationController* GetTimeNavigationController() const = 0; /** * Get the selected position in the render window with id id * or in the active render window if id is NULL. * * \param id The render window id. * \return The currently selected position in world coordinates. */ virtual mitk::Point3D GetSelectedPosition(const QString& id = QString()) const = 0; /** * Set the selected position in the render window with id id * or in the active render window if id is NULL. * * \param pos The position in world coordinates which should be selected. * \param id The render window id in which the selection should take place. */ virtual void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) = 0; /** * Enable \e decorations like colored borders, menu widgets, logos, text annotations, etc. * * Decorations are implementation specific. A set of standardized decoration names is listed * in GetDecorations(). * * \param enable If true enable the decorations specified in decorations, * otherwise disable them. * \param decorations A list of decoration names. If empty, all supported decorations are affected. * * \see GetDecorations() */ virtual void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) = 0; /** * Return if a specific decoration is enabled. * * \return true if the decoration is enabled, false if it is disabled * or unknown. * * \see GetDecorations() */ virtual bool IsDecorationEnabled(const QString& decoration) const = 0; /** * Get a list of supported decorations. * * The following decoration names are standardized and should not be used for other decoration types: *
    *
  • \e DECORATION_BORDER Any border decorations like colored rectangles, etc. *
  • \e DECORATION_MENU Menus associated with render windows *
  • \e DECORATION_BACKGROUND All kinds of backgrounds (patterns, gradients, etc.) except for solid colored backgrounds *
  • \e DECORATION_LOGO Any kind of logo overlayed on the rendered scene *
* * \return A list of supported decoration names. */ virtual QStringList GetDecorations() const = 0; }; } Q_DECLARE_INTERFACE(mitk::IRenderWindowPart, "org.mitk.ui.IRenderWindowPart") #endif // MITKIRENDERWINDOWPART_H