oaPlugInVCInterfaces.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaPlugInVCInterfaces.h
00004 //
00005 // This file contains the definitions for Version Control interface classes.
00006 // These include:
00007 //
00008 //  IDMObjectStatus
00009 //      This interface represents a pairing of a DM object with a version
00010 //      control status. This interface is intended to be used in conjunction
00011 //      with the IBaseIter interface to pass collections of object/status pairs
00012 //      between OA and the VC/DM plug-ins. In most cases, OA will allocate the
00013 //      memory for the collection, and the plug-in will iterate the it calling
00014 //      "setStatus" with the actual status of the file in the repository.
00015 //
00016 //  IDMObjectStatus::StatusEnum
00017 //      This enumeration represents a bit-field that can hold all of the status
00018 //      information for a given file. The rules for plug-in implementors and
00019 //      clients are:
00020 //      *   You must be able to deal with a status value that contains a bit
00021 //          that wasn't defined at the time your code was compiled (simple
00022 //          masking will deal with this)
00023 //      *   You can set or clear any flag that was in effect at the time your
00024 //          code was compiled.
00025 //      Rules that the interface will follow:
00026 //      *   The set of bits that are currently defined will not change their
00027 //          values, or be removed, after the interface has been declared as
00028 //          finalized.
00029 //      *   New bits can be added to the set of values but can only occupy
00030 //          unused spaces in the bitfield.
00031 //
00032 //  IDMObjectStatusIter
00033 //      This is a particular expansion of the IIter interface to iterate
00034 //      components via IDMObjectStatus interface pointers.
00035 //
00036 //  IVersion
00037 //      This interface is a generic representation of a version. It is
00038 //      implemented by a version class in the VC plug-in. The functionality
00039 //      that OA DM is interested in is limited to getting the display name (that
00040 //      is, the string representation of the version) and comparing it to other
00041 //      versions. Additional capability can be implemented by the VC plug-in by
00042 //      defining and implementing custom interfaces. These interfaces can be
00043 //      accessed by the VC plug-in when the version object is passed back in
00044 //      to it, for example in the "getFiles" method of the IVersionControl
00045 //      interface.
00046 //
00047 //  IDMObjectVersion
00048 //      This interface is used to represent an association between an IDMObject
00049 //      and an IVersion. It's generally used in conjunction with the
00050 //      IDMObjectVersionIter. The setVersion method is defined for the case
00051 //      where OA DM is requesting the version information for a collection of
00052 //      IDMObjects. Output parameters are used in the "get" methods to enforce
00053 //      the reference counting rules for interfaces.
00054 //
00055 //  IDMObjectVersionIter
00056 //      This is a particular expansion of the IIter interface to iterate
00057 //      components via IDMObjectVersion interface pointers.
00058 //
00059 // IVCMessageObserver
00060 //      This interface is implemented by a client of the Version Control system
00061 //      recieve observer messages resulting from VC operations. The OpEnum
00062 //      represents the values that can be passed to the "operation" parameter
00063 //      of the onMessageOut function and indicate what VC operation generated
00064 //      the message. The "msgType" parameter takes one of the MsgTypeEnum values
00065 //      to indicate to the client severity and disposition information about
00066 //      the message. The return value of onMessageOut is used if the cQueryOk
00067 //      message type is indicated - this allows the client the opportunity to
00068 //      query the user if the operation that the VC system is about to perform
00069 //      is "OK" or should be aborted. This will usualy happen when the VC system
00070 //      finds it needs to perform some destructive action resulting from the
00071 //      requested operation and wants verification that this is ok.
00072 //
00073 //  IVCSystem
00074 //      this interfaces is implemented by an object in the version control
00075 //      system that is capabable of reporting on general attributes of the
00076 //      system. It will generally be a "singleton" object, meaning that the
00077 //      same instance of the object is returned no matter how many times the
00078 //      plug-in system requests it (although this behaviour isn't strictly
00079 //      required).
00080 //
00081 //  IVCPlugIn
00082 //      This is an abstract class which specifies the interface for a version
00083 //      control plug-in. It is used from OA to initialize the VC plug-in. It is
00084 //      typically impemented by a stand-alone version control plug-in that is
00085 //      designed to be aggregated by a separate DM plug-in. A DM plug-in that
00086 //      also directly implements version control would *not* implement this
00087 //      interface - the "init" function on ILib serves to initialize these types
00088 //      of plug-ins
00089 //
00090 //      NOTE that both IVCPlugIn and IVersionControl would be implemented by
00091 //      a the same object in a stand alone version control system. An instance
00092 //      of this component would be created for each instance of a DM plug-in
00093 //      component. This implies that there will be one instance of this
00094 //      component per library that is controlled by this system. The library
00095 //      name for this instance is passed in through the "init" call. This
00096 //      information can be gathered by the vc system in order to be able to
00097 //      respond to the "getControlledLibs" function on the IVCSystem interface.
00098 //
00099 //  IVersionControl
00100 //      This is an abstract class which specifies the interface for version
00101 //      control. This interface is used from OA to access the version control
00102 //      functionality. It can be impemented by DM plug-ins that also implement
00103 //      version control functionality, or by a stand-alone version control
00104 //      plug-in can be aggregated by a DM plug-in.
00105 //
00106 // *****************************************************************************
00107 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00108 // Integration Initiative, this material may not be copied, modified,
00109 // re-published, uploaded, executed, or distributed in any way, in any medium,
00110 // in whole or in part, without prior written permission from Cadence.
00111 //
00112 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00113 //                           All Rights Reserved.
00114 //
00115 //  $Author: icftcm $
00116 //  $Revision: #1 $
00117 //  $Date: 2010/08/09 $
00118 //  $State: Exp $
00119 // *****************************************************************************
00120 // *****************************************************************************
00121 
00122 
00123 
00124 #if !defined(oaPlugInVCInterfaces_P)
00125 #define oaPlugInVCInterfaces_P
00126 
00127 
00128 
00129 // *****************************************************************************
00130 // Nested includes
00131 // *****************************************************************************
00132 #include "oaPlugInDMInterfaces.h"
00133 
00134 
00135 
00136 // *****************************************************************************
00137 // Declare and define types in the OpenAccess namespace.
00138 // *****************************************************************************
00139 BEGIN_OA_PLUGIN_NAMESPACE
00140 
00141 
00142 
00143 // *****************************************************************************
00144 // Forward Public Class Declarations
00145 // *****************************************************************************
00146 class IDMObject;
00147 class IDMAccess;
00148 class IDMContainer;
00149 
00150 
00151 
00152 // *****************************************************************************
00153 // IDMObjectStatus
00154 // *****************************************************************************
00155 extern OA_PLUGIN_DLL_API const Guid IID_IDMObjectStatus;
00156 
00157 class OA_PLUGIN_DLL_API IDMObjectStatus : public IBase {
00158 public:
00159     enum StatusEnum {
00160         cControlled = 0x00000001,
00161         cEditable   = 0x00000002,
00162         cUpToDate   = 0x00000004,
00163         cAdded      = 0x00000008,
00164         cDeleted    = 0x00000010,
00165         cModified   = 0x00000020,
00166         cLocked     = 0x00000040,
00167         cMerged     = 0x00000080,
00168         cConflict   = 0x00000100,
00169         cMissing    = 0x00000200,
00170         cRemote     = 0x00000400,
00171 
00172         cAllStatus  = 0xFFFFFFFF
00173     };
00174 
00175     virtual void            getDMObject(IDMObject *&object) = 0;
00176     virtual oa::oaUInt4     getStatus() = 0;
00177 
00178     static const Guid       &getId();
00179 };
00180 
00181 
00182 
00183 // *****************************************************************************
00184 // IDMObjectStatusIter
00185 // *****************************************************************************
00186 extern OA_PLUGIN_DLL_API const Guid IID_IDMObjectStatusIter;
00187 typedef IIter<IDMObjectStatus*, &IID_IDMObjectStatusIter> IDMObjectStatusIter;
00188 
00189 
00190 
00191 // *****************************************************************************
00192 // IVersion
00193 // *****************************************************************************
00194 extern OA_PLUGIN_DLL_API const Guid IID_IVersion;
00195 
00196 class OA_PLUGIN_DLL_API IVersion : public IBase {
00197 public:
00198     virtual SRef<IString>   getVCSystemName() = 0;
00199     virtual SRef<IString>   getDisplayName() = 0;
00200     virtual oa::oaUInt4     compare(IVersion *other) = 0;
00201 
00202     static const Guid       &getId();
00203 };
00204 
00205 
00206 
00207 // *****************************************************************************
00208 // IVersionIter
00209 // *****************************************************************************
00210 extern OA_PLUGIN_DLL_API const Guid IID_IVersionIter;
00211 typedef IIter<IVersion*, &IID_IVersionIter> IVersionIter;
00212 
00213 
00214 
00215 // *****************************************************************************
00216 // IDMObjectVersion
00217 // *****************************************************************************
00218 extern OA_PLUGIN_DLL_API const Guid IID_IDMObjectVersion;
00219 
00220 class OA_PLUGIN_DLL_API IDMObjectVersion : public IBase {
00221 public:
00222     virtual void            getDMObject(IDMObject *&object) = 0;
00223     virtual void            getVersion(IVersion *&version) = 0;
00224 
00225     static const Guid       &getId();
00226 };
00227 
00228 
00229 
00230 // *****************************************************************************
00231 // IDMObjectVersionIter
00232 // *****************************************************************************
00233 extern OA_PLUGIN_DLL_API const Guid IID_IDMObjectVersionIter;
00234 typedef IIter<IDMObjectVersion*, &IID_IDMObjectVersionIter> IDMObjectVersionIter;
00235 
00236 
00237 
00238 // *****************************************************************************
00239 // IVCMessageObserver
00240 // *****************************************************************************
00241 extern OA_PLUGIN_DLL_API const Guid IID_IVCMessageObserver;
00242 
00243 class OA_PLUGIN_DLL_API IVCMessageObserver : public IBase {
00244 public:
00245 
00246     virtual oa::oaUInt4     onMessageOut(IDMObject      *object,
00247                                          oa::oaUInt4    operation,
00248                                          oa::oaUInt4    msgType,
00249                                          const char     *text) = 0;
00250 
00251     static const Guid       &getId();
00252 };
00253 
00254 
00255 
00256 // *****************************************************************************
00257 // IVCSystem
00258 // *****************************************************************************
00259 extern OA_PLUGIN_DLL_API const Guid IID_IVCSystem;
00260 
00261 class OA_PLUGIN_DLL_API IVCSystem : public IBase {
00262 public:
00263     virtual SRef<IString>   getName() = 0;
00264     virtual bool            testCapability(oa::oaUInt4 capability) = 0;
00265 
00266     virtual void            getControlledLibs(IDMLibIter *&libs) = 0;
00267 
00268     virtual void            newVersionObject(IVersion   *&version,
00269                                              const char *displayName = NULL) = 0;
00270 
00271     static const Guid       &getId();
00272 };
00273 
00274 
00275 
00276 // *****************************************************************************
00277 // IVCPlugIn
00278 // *****************************************************************************
00279 extern OA_PLUGIN_DLL_API const Guid IID_IVCPlugIn;
00280 
00281 class OA_PLUGIN_DLL_API IVCPlugIn : public IBase {
00282 public:
00283     virtual bool            init(const char *dmSystemName,
00284                                  const char *libName,
00285                                  IDMAccess  *dmAccess,
00286                                  IAttrIter  *attrs) = 0;
00287 
00288     virtual bool            setAttributes(IAttrIter *attrs) = 0;
00289     virtual void            getAttributes(IAttrIter *&attrs) = 0;
00290     virtual void            newVersionObject(IVersion   *&version,
00291                                              const char *displayName = NULL) = 0;
00292 
00293     static const Guid       &getId();
00294 };
00295 
00296 
00297 
00298 // *****************************************************************************
00299 // IVersionControl
00300 // *****************************************************************************
00301 extern OA_PLUGIN_DLL_API const Guid IID_IVersionControl;
00302 
00303 class OA_PLUGIN_DLL_API IVersionControl : public IBase {
00304 public:
00305     virtual void            getVCSystem(IVCSystem *&system) = 0;
00306 
00307     virtual void            addObserver(IVCMessageObserver *observer) = 0;
00308     virtual void            removeObserver(IVCMessageObserver *observer) = 0;
00309 
00310     virtual oa::oaUInt4     getStatus(IDMObject     *object,
00311                                       oa::oaUInt4   mask = IDMObjectStatus::cAllStatus) = 0;
00312     virtual void            getStatus(IDMObjectStatusIter   *&info,
00313                                       IDMContainer          *cont,
00314                                       oa::oaUInt4           depth = oacCellViewFileVCQueryDepth,
00315                                       oa::oaUInt4           mask = IDMObjectStatus::cAllStatus) = 0;
00316 
00317     virtual void            getControlledObjects(IDMObjectIter  *&objects,
00318                                                  oa::oaUInt4    depth = oacCellViewFileVCQueryDepth,
00319                                                  IDMObject      *top = NULL,
00320                                                  bool           localOnly = false) = 0;
00321 
00322     virtual void            getVersions(IVersionIter    *&versions,
00323                                         IDMObject       *object) = 0;
00324     virtual void            getWorkingVersion(IVersion  *&version,
00325                                               IDMObject *object) = 0;
00326     virtual void            getWorkingVersions(IDMObjectVersionIter *&objects,
00327                                                IDMContainer         *cont,
00328                                                oa::oaUInt4          depth = oacCellViewFileVCQueryDepth) = 0;
00329 
00330     virtual void            update(IVersion     *version,
00331                                    IDMObject    *object,
00332                                    bool         recurse = true,
00333                                    const char   *options = NULL) = 0;
00334 
00335     virtual void            makeEditable(IDMObject  *object,
00336                                          bool       lock,
00337                                          bool       recurse = true,
00338                                          const char *options = NULL) = 0;
00339     virtual void            cancelEdit(IDMObject    *object,
00340                                        bool         recurse = true,
00341                                        const char   *options = NULL) = 0;
00342     virtual void            commitEdits(IDMObject   *object,
00343                                         const char  *comment,
00344                                         bool        recurse = true,
00345                                         bool        keepEditable = false,
00346                                         const char  *options = NULL) = 0;
00347 
00348     virtual void            setControlled(IDMObject     *object,
00349                                           bool          recurse = true,
00350                                           const char    *options = NULL) = 0;
00351     virtual void            unsetControlled(IDMObject   *object,
00352                                             bool        recurse = true,
00353                                             bool        keepLocal = true,
00354                                             const char  *options = NULL) = 0;
00355 
00356     static const Guid       &getId();
00357 };
00358 
00359 
00360 
00361 END_OA_PLUGIN_NAMESPACE
00362 
00363 #endif

Return to top of page