Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ComObject.h

Go to the documentation of this file.
00001 #ifndef ComObjectH
00002 #define ComObjectH
00003 /*******************************************************************************
00004 Copyright 2000,2001,2002 Petr Kulhanek
00005 
00006     This file is part of Core plugin.
00007 
00008     Core plugin is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     Core plugin is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with Core plugin; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 *******************************************************************************/
00022 /*******************************************************************************
00023 ** PROJEKT:             Projekt NEMESIS
00024 ** SOUBOR:              ComObject
00025 ** ÚČEL:                třída popisující základní vlastnosti objektu
00026 ** VERZE:               1.0
00027 ** JAZYK:               CBuilder C++
00028 ** CÍLOVÝ POČÍTAČ:      IBM PC
00029 ** PROGRAMÁTOR:         Petr Kulhánek
00030 ** HISTORIE ÚPRAV:
00031 VERZE   DATUM       POZNÁMKA
00032 1.0     02.09.2000  třída vznikla pro zvýšení modularizace celého kódu
00033                 2000-11-01      vytvoření univerzální třídy pro libovolný objekt pluginu,
00034                                 původní funkce, které mají využití pouze v projektu NEMESIS
00035                     byly přeneseny do třídy CExtObject
00036 *******************************************************************************/
00037 
00041 /* HLAVIČKOVÉ SOUBORY *********************************************************/
00042 
00043 #include "CoreMainHeader.h"
00044 #include "TemplList.h"
00045 #include "Plugins.h"
00046 #include "ExtendedUUID.h"
00047 #include "SimpleList.h"
00048 
00049 /* KONEC HLAVIČKOVÝCH SOUBORů *************************************************/
00050 
00051 class CPluginObjectDescription;
00052 
00053 class CVisObject;
00054 
00055 /* DEFINICE TŘÍD **************************************************************/
00056 
00058 
00061 class NEMESIS_CORE_PACKAGE CComObject : public CObject{
00062     public:
00063   // konstrukce a destrukce objektu --------------------------------------------
00064 
00065   // metody - konstruktur a destruktor
00066             __fastcall CComObject(CComObject* owner,CPluginObjectInfo* objectinfo);
00067             __fastcall CComObject(CComObject* owner,CPluginObjectInfo* objectinfo,const CSmallString& name);
00068             __fastcall CComObject(CVisObject* owner,CPluginObjectInfo* objectinfo);
00069             __fastcall CComObject(CVisObject* owner,CPluginObjectInfo* objectinfo,const CSmallString& name);
00070 
00071     virtual __fastcall ~CComObject(void);
00072 
00073   // popis a identifikace objektu ----------------------------------------------
00074   // metody - jméno a popis
00075 
00076 
00077     inline void  __fastcall SetName(const CSmallString& name);
00078     inline const CSmallString&  __fastcall GetName(void) const;
00079 
00080 
00081     inline void  __fastcall SetDescription(const CSmallString& name);
00082     inline const CSmallString&  __fastcall GetDescription(void) const;
00083 
00084   // metody - identifikace objektu
00085     inline const CExtUUID&              __fastcall GetType(void) const;           // typ prvku
00086     inline const CExtUUID&          __fastcall GetCategory(void) const;    // uuid kategorie do které patří
00087     inline CPluginObjectInfo*       __fastcall GetPluginObjectInfo(void) const;
00088 
00089     // virtual method allows change image of object for example in
00090     // uniform enumerator implementation of different objects
00091     virtual int                  __fastcall GetImageIndex(void) const;   // image index objektu v centrálním seznamu obrázků
00092 
00093   // metody - získání lokalizovaných dat
00094     inline const CSmallString  __fastcall GetLocaleString(const CSmallString& univalue);
00095 
00096   // zjišťovací operace
00097     inline CComObject* __fastcall GetComOwner(void);
00098     void __fastcall SetOwner(CComObject* owner);
00099     void __fastcall SetOwner(CVisObject* owner);
00100 
00101   // sekce soukromých dat ------------------------------------------------------
00102 
00103     public:
00104     virtual  void    __fastcall SetIndex(int index);
00105     virtual  int     __fastcall GetIndex(void) const;
00106 
00107     private:
00108         CPluginObjectInfo*                              ObjectInfo;                     // informace o objektu pluginu
00109     int                             UIndex;             // jednoznačný indexový identifikátor
00110     CSmallString                    Name;               // jméno objektu
00111     CSmallString                    Description;        // popis objektu
00112 
00113     // vlastní následující objekty
00114     CSimpleList<CComObject>         ComObjects;
00115     CSimpleList<CVisObject>         VisObjects;
00116     CComObject*                     ComOwner;
00117     CVisObject*                     VisOwner;
00118     friend class CVisObject;
00119     };
00120 
00121 /* KONEC DEFINICE TŘÍD ********************************************************/
00122 
00123 inline void  __fastcall CComObject::SetName(const CSmallString& name)
00124 {
00125  Name = name;
00126 }
00127 
00128 //------------------------------------------------------------------------------
00129 
00130 inline const CSmallString&  __fastcall CComObject::GetName(void) const
00131 {
00132  return(Name);
00133 }
00134 
00135 //------------------------------------------------------------------------------
00136 
00137 inline void  __fastcall CComObject::SetDescription(const CSmallString& descrip)
00138 {
00139  Description = descrip;
00140 }
00141 
00142 //------------------------------------------------------------------------------
00143 
00144 inline const CSmallString&  __fastcall CComObject::GetDescription(void) const
00145 {
00146  return(Description);
00147 }
00148 
00149 //------------------------------------------------------------------------------
00150 
00151 inline CPluginObjectInfo*       __fastcall CComObject::GetPluginObjectInfo(void) const
00152 {
00153  return(ObjectInfo);
00154 }
00155 
00156 //------------------------------------------------------------------------------
00157 
00158 inline const CExtUUID& __fastcall CComObject::GetType(void) const
00159 {
00160  static CExtUUID uuid;
00161  if( ObjectInfo == NULL ) return(uuid);
00162  return(ObjectInfo->GetObjectUUID());
00163 }
00164 
00165 //---------------------------------------------------------------------------
00166 
00167 inline const CExtUUID& __fastcall CComObject::GetCategory(void) const
00168 {
00169  static CExtUUID uuid;
00170  if( ObjectInfo == NULL ) return(uuid);
00171  return(ObjectInfo->GetCategory());
00172 }
00173 
00174 //---------------------------------------------------------------------------
00175 
00176 inline const CSmallString __fastcall CComObject::GetLocaleString(const CSmallString& univalue)
00177 {
00178  if( ObjectInfo == NULL ) return("");
00179  return(ObjectInfo->GetLocaleString(univalue));
00180 }
00181 
00182 //---------------------------------------------------------------------------
00183 
00184 inline CComObject* __fastcall CComObject::GetComOwner(void)
00185 {
00186  return(ComOwner);
00187 }
00188 
00189 //---------------------------------------------------------------------------
00190 
00191 #endif

Generated on Sun Feb 9 12:53:50 2003 for NemesisCore by doxygen1.3-rc2