plugin.h

Go to the documentation of this file.
00001 // $Id: plugin.h 1282 2006-06-09 09:46:49Z alex $
00002 // This files defines various items required by the plug in manager
00003 // At present, this includes:-
00004 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00005 ================================XARAHEADERSTART===========================
00006  
00007                Xara LX, a vector drawing and manipulation program.
00008                     Copyright (C) 1993-2006 Xara Group Ltd.
00009        Copyright on certain contributions may be held in joint with their
00010               respective authors. See AUTHORS file for details.
00011 
00012 LICENSE TO USE AND MODIFY SOFTWARE
00013 ----------------------------------
00014 
00015 This file is part of Xara LX.
00016 
00017 Xara LX is free software; you can redistribute it and/or modify it
00018 under the terms of the GNU General Public License version 2 as published
00019 by the Free Software Foundation.
00020 
00021 Xara LX and its component source files are distributed in the hope
00022 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00023 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00024 See the GNU General Public License for more details.
00025 
00026 You should have received a copy of the GNU General Public License along
00027 with Xara LX (see the file GPL in the root directory of the
00028 distribution); if not, write to the Free Software Foundation, Inc., 51
00029 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00030 
00031 
00032 ADDITIONAL RIGHTS
00033 -----------------
00034 
00035 Conditional upon your continuing compliance with the GNU General Public
00036 License described above, Xara Group Ltd grants to you certain additional
00037 rights. 
00038 
00039 The additional rights are to use, modify, and distribute the software
00040 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00041 library and any other such library that any version of Xara LX relased
00042 by Xara Group Ltd requires in order to compile and execute, including
00043 the static linking of that library to XaraLX. In the case of the
00044 "CDraw" library, you may satisfy obligation under the GNU General Public
00045 License to provide source code by providing a binary copy of the library
00046 concerned and a copy of the license accompanying it.
00047 
00048 Nothing in this section restricts any of the rights you have under
00049 the GNU General Public License.
00050 
00051 
00052 SCOPE OF LICENSE
00053 ----------------
00054 
00055 This license applies to this program (XaraLX) and its constituent source
00056 files only, and does not necessarily apply to other Xara products which may
00057 in part share the same code base, and are subject to their own licensing
00058 terms.
00059 
00060 This license does not apply to files in the wxXtra directory, which
00061 are built into a separate library, and are subject to the wxWindows
00062 license contained within that directory in the file "WXXTRA-LICENSE".
00063 
00064 This license does not apply to the binary libraries (if any) within
00065 the "libs" directory, which are subject to a separate license contained
00066 within that directory in the file "LIBS-LICENSE".
00067 
00068 
00069 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00070 ----------------------------------------------
00071 
00072 Subject to the terms of the GNU Public License (see above), you are
00073 free to do whatever you like with your modifications. However, you may
00074 (at your option) wish contribute them to Xara's source tree. You can
00075 find details of how to do this at:
00076   http://www.xaraxtreme.org/developers/
00077 
00078 Prior to contributing your modifications, you will need to complete our
00079 contributor agreement. This can be found at:
00080   http://www.xaraxtreme.org/developers/contribute/
00081 
00082 Please note that Xara will not accept modifications which modify any of
00083 the text between the start and end of this header (marked
00084 XARAHEADERSTART and XARAHEADEREND).
00085 
00086 
00087 MARKS
00088 -----
00089 
00090 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00091 designs are registered or unregistered trademarks, design-marks, and/or
00092 service marks of Xara Group Ltd. All rights in these marks are reserved.
00093 
00094 
00095       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00096                         http://www.xara.com/
00097 
00098 =================================XARAHEADEREND============================
00099  */
00100 
00101 // PlugInItem
00102 // This defines the basic requirements to store details on a plug-in
00103 
00104 // PlugInPath
00105 // This defines a stored path which is defined by the user and then
00106 // parsed for plug-ins.
00107 
00108 // PlugInPathList
00109 // This stores the list of PlugInPath items.
00110 
00111 #ifndef INC_PLUGINITEM
00112 #define INC_PLUGINITEM
00113 
00114 //#include "list.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00115 //#include "pathname.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00116 
00117 class KernelBitmap;
00118 class Document;
00119 
00120 // Define the current types of plug-in that we know about
00121 typedef enum TypeOfPlugIn
00122 {
00123     PLUGIN_PHOTOSHOP = 0,   // PhotoShop bitmap effect plug-ins
00124     PLUGIN_XTRA,            // FreeHand Xtra plug-ins
00125     PLUGIN_BFX,             // Built in bitmap effect plug-ins
00126     
00127     PLUGIN_UNKNOWN
00128 }; 
00129 
00130 /**************************************************************************************
00131 
00132 >   class PlugInItem : public ListItem
00133 
00134     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
00135     Created:    10/12/96
00136     Purpose:    Provides the minimum requirement to store details on a plug-in. 
00137 
00138 **************************************************************************************/
00139 
00140 class PlugInItem : public ListItem
00141 {
00142     // Declare the class for memory tracking
00143     CC_DECLARE_DYNAMIC(PlugInItem);
00144 
00145 public:
00146     // Construction and destruction
00147     PlugInItem();
00148 
00149     // return a string describing a unique identifier for the plug-ins this handler is interested in
00150     virtual String_32 GetUniqueID() const   = 0; 
00151     // return a unique type for this kind of plug-in
00152     virtual TypeOfPlugIn GetTypeOfPlugIn() const = 0;
00153 
00154 public:
00155     // Get useful details on a plug-in
00156     INT32   GetPathNameID() { return m_PathNameID; } const
00157     String_32& GetModuleName() { return m_ModuleName; } const
00158     String_32& GetFilterName() { return m_FilterName; } const
00159     String_32& GetFamilyName() { return m_FamilyName; } const
00160     String_32& GetPlugInName() { return m_PlugInName; } const
00161 //  String_32& GetOpToken() { return m_OpToken; } const
00162 
00163     // Set useful details on a plug-in, should only be done by the plug-in handler
00164     void SetPathNameID( const INT32 NewID ) { m_PathNameID = NewID; }
00165     void SetModuleName( const String_32& NewName ) { m_ModuleName = NewName; }
00166     void SetFilterName( const String_32& NewName ) { m_FilterName = NewName; }
00167     void SetFamilyName( const String_32& NewName ) { m_FamilyName = NewName; }
00168     void SetPlugInName( const String_32& NewName ) { m_PlugInName = NewName; }
00169 //  void SetOpToken( const String_32& NewName ) { m_OpToken = NewName; }
00170 
00171 protected:
00172     INT32 m_PathNameID;             // ID of the pathname that we are associated with
00173     String_32 m_ModuleName;         // Filename of module
00174     String_32 m_FilterName;         // Filter name
00175     String_32 m_FamilyName;         // Family or Main menu name
00176     String_32 m_PlugInName;         // Plug-in name or Sub menu name
00177 
00178 //  String_32 m_OpToken;            // Plug-in name or Sub menu name
00179     
00180 public:
00181     // Operations available
00182     // Find out about a plug-in
00183     virtual BOOL About();
00184 
00185     virtual BOOL Apply(KernelBitmap *pInputBitmap, Document* pDocument,
00186                        KernelBitmap **ppOutputBitmap = NULL);
00187     virtual BOOL ApplyLastFilter(KernelBitmap *pInputBitmap, Document* pDocument,
00188                                  KernelBitmap **ppOutputBitmap = NULL);
00189 
00190     // Checking if a bitmap's colour depth is suitable
00191     virtual BOOL IsBitmapModeOk(INT32 ColourDepth, BOOL GreyScale);
00192 };
00193 
00194 /**************************************************************************************
00195 
00196 >   class PlugInPath : public ListItem
00197 
00198     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
00199     Created:    9/12/96
00200     Purpose:    Represents a pathname object that the user has requested that all plug-ins
00201                 be loaded in from.
00202     SeeAlso:    PlugInPathList;
00203 
00204 **************************************************************************************/
00205 
00206 class PlugInPath : public ListItem
00207 {
00208     CC_DECLARE_DYNAMIC(PlugInPath)
00209 
00210 public:
00211     // Adds a newly saved pathname to the list
00212     PlugInPath( const PathName& NewPath, INT32 ID, BOOL IsHidden = FALSE);
00213 
00214     PathName GetPathName() const { return m_Path; }
00215     String_256 GetPathNameAsString() const { return m_Path.GetPath(); }
00216     INT32 GetPathNameID() { return m_PathNameID; }
00217     BOOL IsHidden() { return m_IsHidden; }
00218 
00219 protected:
00220     // Pointer to the pathname to use.
00221     PathName m_Path;
00222     INT32 m_PathNameID;
00223     BOOL m_IsHidden;
00224 };
00225 
00226 /**************************************************************************************
00227 
00228 >   class PlugInPathList : public List
00229 
00230     Author:     Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
00231     Created:    9/12/96
00232     Purpose:    Holds a list of Pathnames that the PlugInManager will use to search for
00233                 plug-ins. The list is set up by the user in the plug-ins options tab.
00234     SeeAlso:    PlugInPath; 
00235 
00236 **************************************************************************************/
00237 
00238 class PlugInPathList : public List
00239 {
00240     CC_DECLARE_DYNAMIC(PlugInPathList)
00241 
00242 public:
00243     PlugInPathList();
00244     ~PlugInPathList();
00245 
00246     // When searching the pathname list, you MUST use the following
00247     // as otherwise you will get unknown effects
00248     PlugInPath * GetFirstPath();
00249     PlugInPath * GetNextPath( const PlugInPath * pCurrentItem);
00250 
00251     PlugInPath *AddPathName( const PathName& NewPath, BOOL IsHidden = FALSE);   
00252     BOOL DeletePathName( const PathName& OldPath );
00253 
00254     BOOL RemoveHiddenItems();
00255 
00256 protected:
00257     INT32 m_IDCounter;
00258 };
00259 
00260 #endif // INC_PLUGINITEM

Generated on Sat Nov 10 03:46:31 2007 for Camelot by  doxygen 1.4.4