WizardObject.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef WIZARDOBJECT_H
00011 #define WIZARDOBJECT_H
00012 
00013 #include "Subject.h"
00014 #include "Serializable.h"
00015 
00016 #include <string>
00017 #include <vector>
00018 
00019 class WizardItem;
00020 
00021 /**
00022  *  The basic wizard type.
00023  *
00024  *  The WizardObject class is the basic class containing items representing plug-ins,
00025  *  desktop services, and specifically defined values that are sequenced together to
00026  *  define a unique process.  To use the WizardObject in a plug-in, the wizard items
00027  *  must already be defined.  The getItems() method returns a vector of WizardItem
00028  *  pointers containing the specific information about each item.
00029  *
00030  *  This subclass of Subject will notify upon the following conditions:
00031  *  - The wizard is populated from an XML file.
00032  *  - Everything documented in Subject.
00033  *
00034  *  @see       WizardItem
00035  */
00036 class WizardObject : public Subject, public Serializable
00037 {
00038 public:
00039    /**
00040     *  Sets the wizard name.
00041     *
00042     *  @param   name
00043     *           The wizard name.
00044     */
00045    virtual void setName(const std::string& name) = 0;
00046 
00047    /**
00048     *  Returns the wizard name.
00049     *
00050     *  @return  The wizard name.
00051     */
00052    virtual const std::string& getName() const = 0;
00053 
00054    /**
00055     *  Returns all items in the wizard.
00056     *
00057     *  This method returns pointers to all of the items stored in the wizard.  The order
00058     *  within the returned vector defines the execution order for each item.
00059     *
00060     *  @return  The vector of WizardItem pointers. The pointers in this vector will never be \c NULL.
00061     *
00062     *  @see     WizardItem
00063     */
00064    virtual const std::vector<WizardItem*>& getItems() const = 0;
00065 
00066    /**
00067     *  Queries whether this wizard operates entirely in batch mode.
00068     *
00069     *  @return  TRUE if the wizard operates in batch mode, otherwise FALSE.
00070     *
00071     *  @see     WizardObject
00072     */
00073    virtual bool isBatch() const = 0;
00074 
00075    /**
00076     *  Returns the menu location and command name from which the wizard is
00077     *  executed.
00078     *
00079     *  The menu location of the wizard is returned as a string, which is
00080     *  formatted with bracket characters ([,]) to specify a toolbar, and 
00081     *  a slash (/) to indicate submenu levels.  The toolbar name must come
00082     *  first in the string.  A slash immediately following the toolbar name
00083     *  specifys that the submenus and command should be added to the default
00084     *  toolbar menu, which has the same name as the toolbar.  If a slash does
00085     *  not follow the toolbar name, the menus and command are added directly
00086     *  to the toolbar.  If the string does not include a toolbar name, the
00087     *  menus and command are added to the main menu bar.  The string cannot
00088     *  end with a slash, and the name after the last slash indicates the
00089     *  command name.  Examples of the menu string include
00090     *  "[Wizard]Import/MyLoadWizard", "&Tools/PlotManager", and
00091     *  "[Geo]/Georeference".
00092     *
00093     *  @return  The plug-in menu location and command name.  An empty string
00094     *           is returned if the wizard does not have a menu location,
00095     *           indicating that it should not be executed from the menus.
00096     */
00097    virtual const std::string& getMenuLocation() const = 0;
00098 
00099    /**
00100     *  Returns the execution order of a wizard item.
00101     *
00102     *  @param   pItem
00103     *           The wizard item to query for its execution order.
00104     *
00105     *  @return  The one-based execution order for the wizard item.  If \c NULL
00106     *           is passed in or the given item does not exist in the wizard, a
00107     *           value of -1 is returned.
00108     */
00109    virtual int getExecutionOrder(WizardItem* pItem) const = 0;
00110 
00111 protected:
00112    /**
00113     * This should be destroyed by calling ObjectFactory::destroyObject.
00114     */
00115    virtual ~WizardObject() {}
00116 };
00117 
00118 #endif

Software Development Kit - Opticks 4.9.0 Build 16218